@feedmepos/mf-inventory-portal 0.0.25-dev.26 → 0.0.25-dev.29
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/{App-FlLD43pf.js → App-Dek8Vr9-.js} +2 -2
- package/dist/{ApprovalView-DwTvIjyF.js → ApprovalView-CTMpqFzM.js} +2 -2
- package/dist/{BindingsDialog-Ctxe-2eR.js → BindingsDialog-DGLQikYF.js} +2 -2
- package/dist/{BindingsPicker-DpHgBr9I.js → BindingsPicker-DZG8wO4I.js} +1 -1
- package/dist/{BindingsTable-C0onBRN2.js → BindingsTable-Tph1IEs_.js} +1 -1
- package/dist/ClosingDraftView-BIe2OifC.js +1340 -0
- package/dist/{ClosingTemplateView-MRYukFc9.js → ClosingTemplateView-fYv2BOaN.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DLo0_EnE.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-XmL-gUij.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-vMjhugJb.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D6BOjf8w.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-C81Jfejj.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-q_i3hoJt.js} +1 -1
- package/dist/{IngredientGroupView-CRK2IXYi.js → IngredientGroupView-_klRRaoz.js} +1 -1
- package/dist/{IngredientsView-BVJDcDaw.js → IngredientsView-OHYrf3Vy.js} +4 -4
- package/dist/{IntegrationView-D2xZ-auL.js → IntegrationView-CT1ljdzD.js} +1 -1
- package/dist/{InventoryBindingForm-D2nu9Ffp.js → InventoryBindingForm-hJ2E32Un.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DTcqJhdD.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Dde7uicJ.js} +3 -3
- package/dist/{InventoryBindingSummary-BrfjSG-X.js → InventoryBindingSummary-DRTbyHoD.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BuSqcjGE.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DIXSbpB8.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DNDFZjc2.js → PremiumBadge.vue_vue_type_script_setup_true_lang-zD7DXiNm.js} +1 -1
- package/dist/{PublishView-C53GSTpI.js → PublishView-C6AyRnRY.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-BJwg7kN3.js → PurchaseOrderPrintPreview-BFhh-w-p.js} +1 -1
- package/dist/{ReceiveRequestView-DSVVaWMp.js → ReceiveRequestView-lyDlAN_-.js} +961 -962
- package/dist/{RecipeView-BHQqcnww.js → RecipeView-BqHUhG3G.js} +3 -3
- package/dist/{StockView-Cnn-wHVz.js → StockView-Bnz2taY1.js} +7 -7
- package/dist/{SupplierView-B87uSeNG.js → SupplierView-DMQLdwUq.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BtEavLOY.js → TransferDetails.vue_vue_type_script_setup_true_lang-BXxhHSsA.js} +4 -4
- package/dist/{TransferTemplateView-6bRr_A5Y.js → TransferTemplateView-BUY6mdtl.js} +7 -7
- package/dist/{UnitView-Ck94whT5.js → UnitView-DeM8bX16.js} +3 -3
- package/dist/{WarehouseView-BceoB6Cq.js → WarehouseView-COIAUO97.js} +1 -1
- package/dist/api/netsuite.d.ts +16 -0
- package/dist/{app-CtbmMi1h.js → app-u6OMpgtW.js} +8239 -8220
- package/dist/app.js +1 -1
- package/dist/{decimal-D1zkJPMb.js → decimal-DEqSst5w.js} +1 -1
- package/dist/{feature-OQuluLLR.js → feature-C1kPnnci.js} +139 -131
- package/dist/{format-unit-display-nGgm9HEU.js → format-unit-display-DU4cd95Q.js} +2 -2
- package/dist/{index-DZ88SgFi.js → index-Bsk-N25H.js} +2 -2
- package/dist/{stock-DZzQZdU1.js → stock-lQC0XzWE.js} +1 -1
- package/dist/stores/feature.d.ts +4 -1
- package/dist/stores/integration/netsuite.d.ts +16 -0
- package/dist/{supplier-C7vjGYYz.js → supplier-BKH1HGUY.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-DKsbfBJ5.js → use-ingredient-select-dialog-7ZzAy4V4.js} +1 -1
- package/dist/{use-inventory-binding-dialog-BM3hVdj-.js → use-inventory-binding-dialog-BGbh-pc0.js} +1 -1
- package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +2 -2
- package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +2 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +6 -0
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +6 -0
- package/dist/views/receive-request/import/export.d.ts +2 -4
- package/dist/{vue-i18n-kwkYkNRD.js → vue-i18n-B9A1NhGp.js} +409 -409
- package/package.json +3 -3
- package/dist/ClosingDraftView-bACYchEO.js +0 -1308
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
import { defineComponent as ae, onMounted as Le, onUnmounted as
|
|
2
|
-
import { H as
|
|
3
|
-
import { u as
|
|
4
|
-
import { _ as wt, u as
|
|
5
|
-
import { u as
|
|
6
|
-
import { useDialog as It, useBreakpoints as nt, components as ce, FmButtonVariant as
|
|
7
|
-
import { P as
|
|
8
|
-
import { _ as Dt, F as Tt, a as Vt, b as Pt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import { u as at } from "./feature-
|
|
10
|
-
import { c as ye, u as
|
|
1
|
+
import { defineComponent as ae, onMounted as Le, onUnmounted as At, renderSlot as Et, h as U, reactive as ht, computed as O, openBlock as S, createElementBlock as F, Fragment as ne, renderList as ge, createElementVNode as a, toDisplayString as q, unref as s, resolveComponent as D, createVNode as b, withCtx as R, createCommentVNode as N, ref as A, createBlock as Q, watch as be, normalizeClass as X, createTextVNode as Ie, normalizeStyle as kt, nextTick as Mt, mergeProps as Xe, isRef as Ce, createSlots as Ut, Teleport as Ot, normalizeProps as Nt, guardReactiveProps as Bt } from "vue";
|
|
2
|
+
import { H as Ze, J as zt, Y as Lt, Z as we, b as He, l as qe, i as me, a0 as Je, K as xt, as as Ht, A as ze, M as jt, m as St, ab as We, E as pe, at as Qt, a as et, au as Yt, av as Kt, aw as Xt, G as tt, O as st, u as je, ax as Zt, $ as Gt, T as Jt, ay as Wt, B as Ct, d as Re, v as es, w as ts, x as ss, az as Be, a5 as vt, y as os, _ as ns, z as as, N as yt } from "./app-u6OMpgtW.js";
|
|
3
|
+
import { u as ot, a as ls, P as Ke, b as rs, _ as is, g as us } from "./TransferDetails.vue_vue_type_script_setup_true_lang-BXxhHSsA.js";
|
|
4
|
+
import { _ as wt, u as ms, i as ds, e as cs } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-zD7DXiNm.js";
|
|
5
|
+
import { u as ps } from "./useTabStorage-BkIVScW_.js";
|
|
6
|
+
import { useDialog as It, useBreakpoints as nt, components as ce, FmButtonVariant as fs, useSnackbar as De, useProxiedModel as Ft } from "@feedmepos/ui-library";
|
|
7
|
+
import { P as oe, u as $t } from "./format-unit-display-DU4cd95Q.js";
|
|
8
|
+
import { _ as Dt, F as Tt, a as Vt, b as Pt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-D6BOjf8w.js";
|
|
9
|
+
import { u as at } from "./feature-C1kPnnci.js";
|
|
10
|
+
import { c as ye, u as vs, _ as ys, l as bs } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-XmL-gUij.js";
|
|
11
11
|
import { useI18n as fe } from "@feedmepos/mf-common";
|
|
12
|
-
import { defineStore as
|
|
13
|
-
import { u as lt } from "./supplier-
|
|
14
|
-
import { _ as
|
|
15
|
-
import { u as
|
|
12
|
+
import { defineStore as gs } from "pinia";
|
|
13
|
+
import { u as lt } from "./supplier-BKH1HGUY.js";
|
|
14
|
+
import { _ as _s } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
15
|
+
import { u as hs } from "./vue-i18n-B9A1NhGp.js";
|
|
16
16
|
import "./array-hChJVZLE.js";
|
|
17
|
-
const
|
|
17
|
+
const ks = /* @__PURE__ */ ae({
|
|
18
18
|
__name: "MountListener",
|
|
19
19
|
emits: ["mounted", "unmounted"],
|
|
20
|
-
setup(
|
|
21
|
-
const r =
|
|
22
|
-
return Le(() => r("mounted")),
|
|
20
|
+
setup(f, { emit: x }) {
|
|
21
|
+
const r = x;
|
|
22
|
+
return Le(() => r("mounted")), At(() => r("unmounted")), (l, C) => Et(l.$slots, "default");
|
|
23
23
|
}
|
|
24
|
-
}), Rt =
|
|
25
|
-
const
|
|
26
|
-
return { multiSelect: async (t,
|
|
27
|
-
const u =
|
|
28
|
-
return
|
|
24
|
+
}), Rt = gs("inventoryMultiSelectDialog", () => {
|
|
25
|
+
const f = It(), { t: x } = fe();
|
|
26
|
+
return { multiSelect: async (t, m, d) => {
|
|
27
|
+
const u = d ?? ((e) => e), { promise: h, resolve: o } = Promise.withResolvers();
|
|
28
|
+
return f.open({
|
|
29
29
|
title: "Select items",
|
|
30
30
|
closeButton: !0,
|
|
31
|
-
contentComponent:
|
|
31
|
+
contentComponent: Ze,
|
|
32
32
|
contentComponentProps: {
|
|
33
|
-
modelValue:
|
|
33
|
+
modelValue: m ?? [],
|
|
34
34
|
items: t,
|
|
35
35
|
virtualScroll: !0,
|
|
36
|
-
onClose: () =>
|
|
36
|
+
onClose: () => o(null)
|
|
37
37
|
},
|
|
38
38
|
primaryActions: {
|
|
39
|
-
text:
|
|
39
|
+
text: x("common.confirm"),
|
|
40
40
|
close: !0
|
|
41
41
|
},
|
|
42
42
|
secondaryActions: {
|
|
43
|
-
text:
|
|
43
|
+
text: x("common.close"),
|
|
44
44
|
close: !0,
|
|
45
45
|
variant: "tertiary"
|
|
46
46
|
}
|
|
47
47
|
}).onPrimary((e) => {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
}),
|
|
51
|
-
}, singleSelect: async (t,
|
|
52
|
-
const u =
|
|
53
|
-
return
|
|
48
|
+
const i = e.map((c) => u(c));
|
|
49
|
+
o(i);
|
|
50
|
+
}), h;
|
|
51
|
+
}, singleSelect: async (t, m, d) => {
|
|
52
|
+
const u = d ?? ((e) => e), { promise: h, resolve: o } = Promise.withResolvers();
|
|
53
|
+
return f.open({
|
|
54
54
|
title: "Select items",
|
|
55
55
|
closeButton: !0,
|
|
56
|
-
contentComponent:
|
|
56
|
+
contentComponent: Ze,
|
|
57
57
|
contentComponentProps: {
|
|
58
|
-
modelValue:
|
|
58
|
+
modelValue: m ? [m] : [],
|
|
59
59
|
items: t,
|
|
60
60
|
virtualScroll: !0,
|
|
61
|
-
onClose: () =>
|
|
61
|
+
onClose: () => o(void 0),
|
|
62
62
|
singleSelect: !0
|
|
63
63
|
},
|
|
64
64
|
primaryActions: {
|
|
65
|
-
text:
|
|
65
|
+
text: x("common.confirm"),
|
|
66
66
|
close: !0
|
|
67
67
|
},
|
|
68
68
|
secondaryActions: {
|
|
69
|
-
text:
|
|
69
|
+
text: x("common.close"),
|
|
70
70
|
close: !0,
|
|
71
71
|
variant: "tertiary"
|
|
72
72
|
}
|
|
73
73
|
}).onPrimary((e) => {
|
|
74
74
|
if (!e.length)
|
|
75
|
-
return
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
}),
|
|
79
|
-
}, confirmation: async (t,
|
|
80
|
-
const { promise:
|
|
81
|
-
return
|
|
75
|
+
return o(null);
|
|
76
|
+
const i = u(e[0]);
|
|
77
|
+
o(i);
|
|
78
|
+
}), h;
|
|
79
|
+
}, confirmation: async (t, m, d, u, h) => {
|
|
80
|
+
const { promise: o, resolve: e } = Promise.withResolvers();
|
|
81
|
+
return f.open({
|
|
82
82
|
title: t,
|
|
83
|
-
message: typeof
|
|
83
|
+
message: typeof m == "string" ? m : void 0,
|
|
84
84
|
contentComponent: U(
|
|
85
|
-
|
|
85
|
+
ks,
|
|
86
86
|
{
|
|
87
87
|
onUnmounted: () => {
|
|
88
88
|
e(null);
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
|
-
|
|
91
|
+
m
|
|
92
92
|
),
|
|
93
93
|
contentComponentProps: {},
|
|
94
|
-
primaryActions:
|
|
95
|
-
text:
|
|
94
|
+
primaryActions: d ?? {
|
|
95
|
+
text: x("common.confirm"),
|
|
96
96
|
close: !0
|
|
97
97
|
},
|
|
98
98
|
secondaryActions: u ?? {
|
|
99
|
-
text:
|
|
99
|
+
text: x("common.close"),
|
|
100
100
|
close: !0,
|
|
101
101
|
variant: "tertiary"
|
|
102
102
|
},
|
|
103
|
-
tertiaryActions:
|
|
103
|
+
tertiaryActions: h,
|
|
104
104
|
closeButton: !0,
|
|
105
105
|
dismissAway: !0
|
|
106
106
|
}).onPrimary(() => {
|
|
107
|
-
e((
|
|
107
|
+
e((d == null ? void 0 : d.value) ?? !0);
|
|
108
108
|
}).onSecondary(() => {
|
|
109
109
|
e((u == null ? void 0 : u.value) ?? !1);
|
|
110
110
|
}).onTertiary(() => {
|
|
111
|
-
e((
|
|
112
|
-
}),
|
|
111
|
+
e((h == null ? void 0 : h.value) ?? void 0);
|
|
112
|
+
}), o;
|
|
113
113
|
} };
|
|
114
114
|
});
|
|
115
|
-
function Ge(
|
|
116
|
-
return
|
|
117
|
-
const
|
|
118
|
-
return Lt(
|
|
115
|
+
function Ge(f) {
|
|
116
|
+
return f.reduce((x, r) => {
|
|
117
|
+
const l = r.measurement ? zt(r.quantity, r.measurement.conversion) : r.quantity;
|
|
118
|
+
return Lt(x, l);
|
|
119
119
|
}, we.reset());
|
|
120
120
|
}
|
|
121
|
-
var K = /* @__PURE__ */ ((
|
|
122
|
-
const
|
|
121
|
+
var K = /* @__PURE__ */ ((f) => (f.Code = "Code", f.Name = "Name", f.TemplateName = "TemplateName", f.Amount = "Amount", f.Cost = "Cost", f.Delete = "Delete", f))(K || {});
|
|
122
|
+
const xs = () => (fe(), U(
|
|
123
123
|
wt,
|
|
124
124
|
{
|
|
125
125
|
zIndex: 50,
|
|
@@ -127,32 +127,32 @@ const So = () => (fe(), U(
|
|
|
127
127
|
},
|
|
128
128
|
`Total (${St()})`
|
|
129
129
|
));
|
|
130
|
-
function
|
|
131
|
-
const { t:
|
|
130
|
+
function Ss(f) {
|
|
131
|
+
const { t: x } = fe(), r = ht({}), { breakpoints: l } = nt(), C = at(), t = He(), m = Rt();
|
|
132
132
|
Le(() => {
|
|
133
|
-
for (const
|
|
134
|
-
if (!
|
|
133
|
+
for (const o of f.items) {
|
|
134
|
+
if (!o.totalCost)
|
|
135
135
|
continue;
|
|
136
|
-
const e = ye(
|
|
137
|
-
supplier:
|
|
138
|
-
}),
|
|
139
|
-
e ? r[
|
|
136
|
+
const e = ye(o.sku, o.quantity, o.measurement, {
|
|
137
|
+
supplier: f.supplier
|
|
138
|
+
}), i = o.totalCost ?? we.reset();
|
|
139
|
+
e ? r[o.sku._id] = e.amount !== i.amount || e.precision !== i.precision : r[o.sku._id] = !0;
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
|
-
function
|
|
143
|
-
var
|
|
144
|
-
return !!(((
|
|
142
|
+
function d(o) {
|
|
143
|
+
var i, c, y, k, I, v, p;
|
|
144
|
+
return !!(((c = (i = o.defaultCost) == null ? void 0 : i.costPerUnit) == null ? void 0 : c.amount) ?? ((p = (v = (I = (k = (y = f.supplier) == null ? void 0 : y.supplyItems) == null ? void 0 : k.find((V) => V.skuId === o._id)) == null ? void 0 : I.defaultCost) == null ? void 0 : v.costPerUnit) == null ? void 0 : p.amount));
|
|
145
145
|
}
|
|
146
146
|
const u = [
|
|
147
147
|
{
|
|
148
148
|
id: "Code",
|
|
149
|
-
header: () =>
|
|
149
|
+
header: () => x("inventory.transfer.form.items.table.Code"),
|
|
150
150
|
accessorKey: "code",
|
|
151
151
|
size: 200,
|
|
152
|
-
cell(
|
|
153
|
-
var
|
|
154
|
-
const e =
|
|
155
|
-
return (
|
|
152
|
+
cell(o) {
|
|
153
|
+
var i;
|
|
154
|
+
const e = o.row.original;
|
|
155
|
+
return (i = e.subItems) != null && i.length ? U(
|
|
156
156
|
"span",
|
|
157
157
|
{ class: "text-fm-color-typo-primary fm-typo-en-body-md-600 line-clamp-1" },
|
|
158
158
|
e.sku.code
|
|
@@ -173,10 +173,10 @@ function Co(p) {
|
|
|
173
173
|
)
|
|
174
174
|
) : U(ce.FmTextField, {
|
|
175
175
|
modelValue: e.code,
|
|
176
|
-
"onUpdate:modelValue": (
|
|
177
|
-
|
|
176
|
+
"onUpdate:modelValue": (c) => {
|
|
177
|
+
f.updateItem({
|
|
178
178
|
...e,
|
|
179
|
-
code:
|
|
179
|
+
code: c
|
|
180
180
|
});
|
|
181
181
|
},
|
|
182
182
|
key: e.sku._id,
|
|
@@ -188,12 +188,12 @@ function Co(p) {
|
|
|
188
188
|
},
|
|
189
189
|
{
|
|
190
190
|
id: "Name",
|
|
191
|
-
header: () =>
|
|
191
|
+
header: () => x("inventory.transfer.form.items.table.Name"),
|
|
192
192
|
minSize: 300,
|
|
193
|
-
cell(
|
|
194
|
-
var
|
|
195
|
-
const e =
|
|
196
|
-
return (
|
|
193
|
+
cell(o) {
|
|
194
|
+
var i;
|
|
195
|
+
const e = o.row.original;
|
|
196
|
+
return (i = e.subItems) != null && i.length ? U(
|
|
197
197
|
"span",
|
|
198
198
|
{ class: "text-fm-color-typo-primary fm-typo-en-body-md-600 line-clamp-1" },
|
|
199
199
|
e.sku.name
|
|
@@ -214,10 +214,10 @@ function Co(p) {
|
|
|
214
214
|
)
|
|
215
215
|
) : U(ce.FmTextField, {
|
|
216
216
|
modelValue: e.name,
|
|
217
|
-
"onUpdate:modelValue": (
|
|
218
|
-
|
|
217
|
+
"onUpdate:modelValue": (c) => {
|
|
218
|
+
f.updateItem({
|
|
219
219
|
...e,
|
|
220
|
-
name:
|
|
220
|
+
name: c
|
|
221
221
|
});
|
|
222
222
|
},
|
|
223
223
|
key: e.sku._id,
|
|
@@ -229,12 +229,12 @@ function Co(p) {
|
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
231
|
id: "TemplateName",
|
|
232
|
-
header: () =>
|
|
232
|
+
header: () => x("inventory.transfer.form.items.table.Name"),
|
|
233
233
|
minSize: 300,
|
|
234
234
|
enableSorting: !1,
|
|
235
|
-
cell(
|
|
235
|
+
cell(o) {
|
|
236
236
|
var y, k;
|
|
237
|
-
const e =
|
|
237
|
+
const e = o.row.original, i = (y = e.subItems) != null && y.length ? e.sku.code : e.code, c = (k = e.subItems) != null && k.length ? e.sku.name : e.name;
|
|
238
238
|
return U(
|
|
239
239
|
ce.FmTooltip,
|
|
240
240
|
{ zIndex: 50 },
|
|
@@ -244,19 +244,19 @@ function Co(p) {
|
|
|
244
244
|
U(
|
|
245
245
|
"div",
|
|
246
246
|
{ class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
|
|
247
|
-
|
|
247
|
+
c
|
|
248
248
|
),
|
|
249
249
|
U(
|
|
250
250
|
"div",
|
|
251
251
|
{
|
|
252
252
|
class: "line-clamp-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
253
253
|
},
|
|
254
|
-
|
|
254
|
+
i
|
|
255
255
|
)
|
|
256
256
|
]);
|
|
257
257
|
},
|
|
258
258
|
content() {
|
|
259
|
-
return
|
|
259
|
+
return c;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
);
|
|
@@ -264,13 +264,13 @@ function Co(p) {
|
|
|
264
264
|
},
|
|
265
265
|
{
|
|
266
266
|
id: "Amount",
|
|
267
|
-
header: () =>
|
|
267
|
+
header: () => x("inventory.transfer.form.items.table.Amount"),
|
|
268
268
|
minSize: 200,
|
|
269
|
-
cell(
|
|
270
|
-
var
|
|
271
|
-
const e =
|
|
272
|
-
if ((
|
|
273
|
-
const
|
|
269
|
+
cell(o) {
|
|
270
|
+
var c, y, k, I, v;
|
|
271
|
+
const e = o.row.original;
|
|
272
|
+
if ((c = e.subItems) != null && c.length) {
|
|
273
|
+
const p = Ge(e.subItems);
|
|
274
274
|
return U(
|
|
275
275
|
"span",
|
|
276
276
|
{
|
|
@@ -281,13 +281,13 @@ function Co(p) {
|
|
|
281
281
|
U(
|
|
282
282
|
"span",
|
|
283
283
|
{ class: " fm-typo-en-body-md-600" },
|
|
284
|
-
`${me(
|
|
284
|
+
`${me(p)} ${e.sku.unit.abbrev}`
|
|
285
285
|
)
|
|
286
286
|
]
|
|
287
287
|
);
|
|
288
288
|
}
|
|
289
|
-
const
|
|
290
|
-
(
|
|
289
|
+
const i = (I = (k = (y = f.template) == null ? void 0 : y.purchaseOrder) == null ? void 0 : k.items) == null ? void 0 : I.find(
|
|
290
|
+
(p) => p.sku._id === e.sku._id
|
|
291
291
|
);
|
|
292
292
|
return U(Dt, {
|
|
293
293
|
style: {
|
|
@@ -299,32 +299,32 @@ function Co(p) {
|
|
|
299
299
|
},
|
|
300
300
|
key: e.sku._id,
|
|
301
301
|
unit: e.sku.unit,
|
|
302
|
-
"onUpdate:modelValue": (
|
|
302
|
+
"onUpdate:modelValue": (p) => {
|
|
303
303
|
const V = {
|
|
304
304
|
...e,
|
|
305
|
-
quantity:
|
|
306
|
-
measurement:
|
|
305
|
+
quantity: p.amount,
|
|
306
|
+
measurement: p.measurement
|
|
307
307
|
};
|
|
308
308
|
C.enableTotalCost && (V.totalCost = ye(e.sku, e.quantity, e.measurement, {
|
|
309
|
-
supplier:
|
|
309
|
+
supplier: f.supplier,
|
|
310
310
|
// NOTE: set undefined here if `manualTotalCost[row.sku._id] = false`, so that the function
|
|
311
311
|
// will return the auto calculated default cost instead of the manual total cost
|
|
312
312
|
manualTotalCost: r[e.sku._id] ? V.totalCost : void 0
|
|
313
|
-
})),
|
|
313
|
+
})), f.updateItem(V);
|
|
314
314
|
},
|
|
315
|
-
stepper:
|
|
316
|
-
disableUnit: !!
|
|
317
|
-
disabled:
|
|
315
|
+
stepper: i == null ? void 0 : i.quantityStep,
|
|
316
|
+
disableUnit: !!i,
|
|
317
|
+
disabled: f.disabled,
|
|
318
318
|
rules: [
|
|
319
319
|
Tt(
|
|
320
320
|
+me(
|
|
321
|
-
((
|
|
321
|
+
((v = e.quantity) == null ? void 0 : v.amount) === 0 ? { amount: 0, precision: 0 } : (i == null ? void 0 : i.minimumQuantity) ?? { amount: 0, precision: 0 }
|
|
322
322
|
)
|
|
323
323
|
),
|
|
324
324
|
Vt(
|
|
325
|
-
|
|
325
|
+
i != null && i.maximumQuantity ? +me(i == null ? void 0 : i.maximumQuantity) : 1 / 0
|
|
326
326
|
),
|
|
327
|
-
...
|
|
327
|
+
...i != null && i.quantityStep ? [Pt(i.quantityStep)] : []
|
|
328
328
|
],
|
|
329
329
|
applyDefaultRules: !0
|
|
330
330
|
});
|
|
@@ -333,29 +333,29 @@ function Co(p) {
|
|
|
333
333
|
},
|
|
334
334
|
{
|
|
335
335
|
id: "Cost",
|
|
336
|
-
header:
|
|
336
|
+
header: xs,
|
|
337
337
|
size: 180,
|
|
338
|
-
cell(
|
|
339
|
-
const e =
|
|
340
|
-
return !r[e.sku._id] &&
|
|
338
|
+
cell(o) {
|
|
339
|
+
const e = o.row.original, i = d(e.sku), c = l.value.xs || l.value.sm;
|
|
340
|
+
return !r[e.sku._id] && i ? U(
|
|
341
341
|
"div",
|
|
342
342
|
{
|
|
343
343
|
class: [
|
|
344
344
|
"flex gap-4 fm-typo-en-body-md-400 items-center",
|
|
345
|
-
|
|
345
|
+
f.disabled ? "text-fm-color-typo-disabled" : ""
|
|
346
346
|
],
|
|
347
347
|
key: e.sku._id
|
|
348
348
|
},
|
|
349
349
|
[
|
|
350
350
|
U(ce.FmButton, {
|
|
351
351
|
prependIcon: "edit",
|
|
352
|
-
variant:
|
|
353
|
-
disabled:
|
|
352
|
+
variant: fs.Tertiary,
|
|
353
|
+
disabled: f.disabled,
|
|
354
354
|
onClick() {
|
|
355
|
-
|
|
355
|
+
f.updateItem({
|
|
356
356
|
...e,
|
|
357
357
|
totalCost: ye(e.sku, e.quantity, e.measurement, {
|
|
358
|
-
supplier:
|
|
358
|
+
supplier: f.supplier
|
|
359
359
|
})
|
|
360
360
|
}), r[e.sku._id] = !0;
|
|
361
361
|
}
|
|
@@ -368,13 +368,13 @@ function Co(p) {
|
|
|
368
368
|
[
|
|
369
369
|
U(
|
|
370
370
|
"span",
|
|
371
|
-
|
|
371
|
+
c ? Je(
|
|
372
372
|
ye(e.sku, e.quantity, e.measurement, {
|
|
373
|
-
supplier:
|
|
373
|
+
supplier: f.supplier
|
|
374
374
|
})
|
|
375
375
|
) : me(
|
|
376
376
|
ye(e.sku, e.quantity, e.measurement, {
|
|
377
|
-
supplier:
|
|
377
|
+
supplier: f.supplier
|
|
378
378
|
})
|
|
379
379
|
)
|
|
380
380
|
),
|
|
@@ -383,10 +383,10 @@ function Co(p) {
|
|
|
383
383
|
{
|
|
384
384
|
class: [
|
|
385
385
|
"fm-typo-en-body-sm-400",
|
|
386
|
-
|
|
386
|
+
f.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
|
|
387
387
|
]
|
|
388
388
|
},
|
|
389
|
-
|
|
389
|
+
x("inventory.transfer.form.items.autoCalculated")
|
|
390
390
|
)
|
|
391
391
|
]
|
|
392
392
|
)
|
|
@@ -397,7 +397,7 @@ function Co(p) {
|
|
|
397
397
|
modelValue: me(e.totalCost ?? { amount: 0, precision: 0 }),
|
|
398
398
|
key: e.sku._id,
|
|
399
399
|
"onUpdate:modelValue": (y) => {
|
|
400
|
-
|
|
400
|
+
f.updateItem({
|
|
401
401
|
...e,
|
|
402
402
|
totalCost: {
|
|
403
403
|
...xt(+y),
|
|
@@ -409,29 +409,29 @@ function Co(p) {
|
|
|
409
409
|
},
|
|
410
410
|
{
|
|
411
411
|
prepend() {
|
|
412
|
-
return
|
|
412
|
+
return c ? U(
|
|
413
413
|
"div",
|
|
414
414
|
{
|
|
415
415
|
class: [
|
|
416
416
|
"text-fm-typo-en-body-lg-400",
|
|
417
|
-
|
|
417
|
+
f.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
418
418
|
]
|
|
419
419
|
},
|
|
420
420
|
St()
|
|
421
421
|
) : null;
|
|
422
422
|
},
|
|
423
423
|
append() {
|
|
424
|
-
return
|
|
424
|
+
return i ? U(ce.FmButton, {
|
|
425
425
|
prependIcon: "close",
|
|
426
426
|
variant: "tertiary",
|
|
427
|
-
disabled:
|
|
427
|
+
disabled: f.disabled,
|
|
428
428
|
onClick() {
|
|
429
|
-
|
|
429
|
+
f.updateItem({
|
|
430
430
|
...e,
|
|
431
431
|
// NOTE: different from PO template, if a default cost is reenabled,
|
|
432
432
|
// the total cost will automatically assigned
|
|
433
433
|
totalCost: ye(e.sku, e.quantity, e.measurement, {
|
|
434
|
-
supplier:
|
|
434
|
+
supplier: f.supplier
|
|
435
435
|
})
|
|
436
436
|
}), r[e.sku._id] = !1;
|
|
437
437
|
}
|
|
@@ -445,33 +445,33 @@ function Co(p) {
|
|
|
445
445
|
{
|
|
446
446
|
id: "Delete",
|
|
447
447
|
header: "",
|
|
448
|
-
cell(
|
|
448
|
+
cell(o) {
|
|
449
449
|
var y, k, I;
|
|
450
|
-
const e =
|
|
451
|
-
(
|
|
452
|
-
),
|
|
450
|
+
const e = o.row.original, i = (I = (k = (y = f.template) == null ? void 0 : y.purchaseOrder) == null ? void 0 : k.items) == null ? void 0 : I.find(
|
|
451
|
+
(v) => v.sku._id === e.sku._id
|
|
452
|
+
), c = (i == null ? void 0 : i.subItems) ?? [];
|
|
453
453
|
return U("div", { class: "flex justify-end" }, [
|
|
454
|
-
...
|
|
454
|
+
...c.length ? [
|
|
455
455
|
U(ce.FmButton, {
|
|
456
456
|
key: e.sku._id,
|
|
457
457
|
type: "button",
|
|
458
458
|
icon: "add_circle",
|
|
459
459
|
variant: "tertiary",
|
|
460
460
|
size: "md",
|
|
461
|
-
disabled:
|
|
461
|
+
disabled: f.disabled,
|
|
462
462
|
onClick: async () => {
|
|
463
463
|
var L;
|
|
464
|
-
const
|
|
464
|
+
const v = ((L = e.subItems) == null ? void 0 : L.map(($) => $.id)) ?? [], p = c.map(
|
|
465
465
|
($) => ({
|
|
466
466
|
label: $.name,
|
|
467
467
|
sublabel: $.code,
|
|
468
468
|
value: $.id
|
|
469
469
|
})
|
|
470
|
-
), V = await
|
|
470
|
+
), V = await m.multiSelect(p, v, ($) => {
|
|
471
471
|
var T;
|
|
472
|
-
return ((T = e.subItems) == null ? void 0 : T.find((
|
|
472
|
+
return ((T = e.subItems) == null ? void 0 : T.find((Y) => Y.id === $)) ?? c.find((Y) => Y.id === $);
|
|
473
473
|
}).then(($) => $ == null ? void 0 : $.filter((T) => T).map((T) => T));
|
|
474
|
-
V &&
|
|
474
|
+
V && f.updateItem({
|
|
475
475
|
...e,
|
|
476
476
|
subItems: V.length ? V : null
|
|
477
477
|
});
|
|
@@ -485,9 +485,9 @@ function Co(p) {
|
|
|
485
485
|
icon: "delete",
|
|
486
486
|
variant: "tertiary",
|
|
487
487
|
size: "md",
|
|
488
|
-
disabled:
|
|
488
|
+
disabled: f.disabled,
|
|
489
489
|
onClick: () => {
|
|
490
|
-
|
|
490
|
+
f.deleteItem(e);
|
|
491
491
|
}
|
|
492
492
|
})
|
|
493
493
|
]);
|
|
@@ -501,47 +501,47 @@ function Co(p) {
|
|
|
501
501
|
}
|
|
502
502
|
];
|
|
503
503
|
return {
|
|
504
|
-
columnDefs: O(() => C.enableTotalCost &&
|
|
505
|
-
(
|
|
504
|
+
columnDefs: O(() => C.enableTotalCost && f.transferType === oe.PURCHASE ? u : u.filter(
|
|
505
|
+
(o) => o.id !== "Cost"
|
|
506
506
|
/* Cost */
|
|
507
507
|
))
|
|
508
508
|
};
|
|
509
509
|
}
|
|
510
|
-
const
|
|
510
|
+
const Cs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, ws = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, Is = { class: "w-[450px] xs:w-full flex" }, Fs = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, $s = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, qt = /* @__PURE__ */ ae({
|
|
511
511
|
__name: "SupplierPriceHistory",
|
|
512
512
|
props: {
|
|
513
513
|
prices: {}
|
|
514
514
|
},
|
|
515
|
-
setup(
|
|
516
|
-
const
|
|
517
|
-
function r(
|
|
518
|
-
return
|
|
515
|
+
setup(f) {
|
|
516
|
+
const x = lt();
|
|
517
|
+
function r(l) {
|
|
518
|
+
return x.suppliers.find((C) => C._id === l);
|
|
519
519
|
}
|
|
520
|
-
return (
|
|
521
|
-
(
|
|
522
|
-
var
|
|
523
|
-
return
|
|
520
|
+
return (l, C) => (S(), F("div", Cs, [
|
|
521
|
+
(S(!0), F(ne, null, ge(Object.keys(l.prices), (t) => {
|
|
522
|
+
var m;
|
|
523
|
+
return S(), F("div", {
|
|
524
524
|
key: t,
|
|
525
525
|
class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
|
|
526
526
|
}, [
|
|
527
|
-
a("div",
|
|
528
|
-
a("div",
|
|
529
|
-
(
|
|
527
|
+
a("div", ws, q((m = r(t)) == null ? void 0 : m.name), 1),
|
|
528
|
+
a("div", Is, [
|
|
529
|
+
(S(!0), F(ne, null, ge(l.prices[t].slice(0, 3), (d) => {
|
|
530
530
|
var u;
|
|
531
|
-
return
|
|
532
|
-
key:
|
|
531
|
+
return S(), F("div", {
|
|
532
|
+
key: d.date,
|
|
533
533
|
class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
|
|
534
534
|
}, [
|
|
535
|
-
a("div",
|
|
536
|
-
a("span", null, q(
|
|
535
|
+
a("div", Fs, [
|
|
536
|
+
a("span", null, q(d.totalCost ? s(Je)(d.totalCost) : "No data"), 1),
|
|
537
537
|
C[0] || (C[0] = a("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
|
|
538
|
-
a("span", null, q(
|
|
539
|
-
a("span", null, q(((u =
|
|
538
|
+
a("span", null, q(s(me)(d.totalUnit, !1)), 1),
|
|
539
|
+
a("span", null, q(((u = d.measurement) == null ? void 0 : u.abbrev) ?? d.unit.abbrev), 1)
|
|
540
540
|
]),
|
|
541
|
-
a("div",
|
|
542
|
-
a("span", null, "(#" + q(
|
|
541
|
+
a("div", $s, [
|
|
542
|
+
a("span", null, "(#" + q(d.seqNumber) + ")", 1),
|
|
543
543
|
C[1] || (C[1] = a("span", null, q(" "), -1)),
|
|
544
|
-
a("span", null, q(
|
|
544
|
+
a("span", null, q(s(We)(new Date(d.date))), 1)
|
|
545
545
|
])
|
|
546
546
|
]);
|
|
547
547
|
}), 128))
|
|
@@ -550,10 +550,10 @@ const wo = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
550
550
|
}), 128))
|
|
551
551
|
]));
|
|
552
552
|
}
|
|
553
|
-
}),
|
|
553
|
+
}), Ds = { class: "flex flex-col gap-8 py-16" }, Ts = { class: "flex items-center" }, Vs = { class: "flex-1 flex gap-1 items-center" }, Ps = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Rs = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, qs = { class: "flex gap-8 w-full" }, As = { class: "flex-1 flex flex-col gap-4" }, Es = { class: "flex-1 flex flex-col gap-4" }, Ms = { class: "flex gap-8 w-full" }, Us = { class: "flex-1 flex flex-col gap-4" }, Os = {
|
|
554
554
|
key: 0,
|
|
555
555
|
class: "flex-1 flex flex-col gap-4"
|
|
556
|
-
},
|
|
556
|
+
}, Ns = /* @__PURE__ */ ae({
|
|
557
557
|
__name: "TransferItem",
|
|
558
558
|
props: {
|
|
559
559
|
cellByColId: {},
|
|
@@ -561,74 +561,74 @@ const wo = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
561
561
|
showComparePrice: { type: Boolean },
|
|
562
562
|
row: {}
|
|
563
563
|
},
|
|
564
|
-
setup(
|
|
565
|
-
const { t:
|
|
566
|
-
return (r,
|
|
567
|
-
var
|
|
564
|
+
setup(f) {
|
|
565
|
+
const { t: x } = fe();
|
|
566
|
+
return (r, l) => {
|
|
567
|
+
var m, d, u, h, o, e, i, c, y, k, I, v, p, V, L, $, T, Y, z, E, j, B, G, _, g, M, J;
|
|
568
568
|
const C = D("FmLabel"), t = D("FmSpacer");
|
|
569
|
-
return
|
|
570
|
-
a("div",
|
|
571
|
-
a("div",
|
|
572
|
-
a("span",
|
|
573
|
-
a("span",
|
|
569
|
+
return S(), F("div", Ds, [
|
|
570
|
+
a("div", Ts, [
|
|
571
|
+
a("div", Vs, [
|
|
572
|
+
a("span", Ps, " (" + q(r.row.original.sku.code) + ") ", 1),
|
|
573
|
+
a("span", Rs, q(r.row.original.sku.name), 1)
|
|
574
574
|
]),
|
|
575
575
|
a("div", null, [
|
|
576
|
-
b(
|
|
577
|
-
render: (u = (
|
|
578
|
-
props: (
|
|
576
|
+
b(s(pe), {
|
|
577
|
+
render: (u = (d = (m = r.cellByColId.Delete) == null ? void 0 : m.column) == null ? void 0 : d.columnDef) == null ? void 0 : u.cell,
|
|
578
|
+
props: (o = (h = r.cellByColId.Delete) == null ? void 0 : h.getContext) == null ? void 0 : o.call(h)
|
|
579
579
|
}, null, 8, ["render", "props"])
|
|
580
580
|
])
|
|
581
581
|
]),
|
|
582
|
-
a("div",
|
|
583
|
-
a("div",
|
|
582
|
+
a("div", qs, [
|
|
583
|
+
a("div", As, [
|
|
584
584
|
b(C, {
|
|
585
|
-
label:
|
|
585
|
+
label: s(x)(`inventory.transfer.form.items.table.${s(K).Code}`)
|
|
586
586
|
}, null, 8, ["label"]),
|
|
587
|
-
b(
|
|
588
|
-
render: (
|
|
589
|
-
props: (k = (y = r.cellByColId[
|
|
587
|
+
b(s(pe), {
|
|
588
|
+
render: (c = (i = (e = r.cellByColId[s(K).Code]) == null ? void 0 : e.column) == null ? void 0 : i.columnDef) == null ? void 0 : c.cell,
|
|
589
|
+
props: (k = (y = r.cellByColId[s(K).Code]) == null ? void 0 : y.getContext) == null ? void 0 : k.call(y)
|
|
590
590
|
}, null, 8, ["render", "props"]),
|
|
591
|
-
|
|
591
|
+
l[0] || (l[0] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
592
592
|
]),
|
|
593
|
-
a("div",
|
|
593
|
+
a("div", Es, [
|
|
594
594
|
b(C, {
|
|
595
|
-
label:
|
|
595
|
+
label: s(x)(`inventory.transfer.form.items.table.${s(K).Name}`)
|
|
596
596
|
}, null, 8, ["label"]),
|
|
597
|
-
b(
|
|
598
|
-
render: (
|
|
599
|
-
props: (L = (V = r.cellByColId[
|
|
597
|
+
b(s(pe), {
|
|
598
|
+
render: (p = (v = (I = r.cellByColId[s(K).Name]) == null ? void 0 : I.column) == null ? void 0 : v.columnDef) == null ? void 0 : p.cell,
|
|
599
|
+
props: (L = (V = r.cellByColId[s(K).Name]) == null ? void 0 : V.getContext) == null ? void 0 : L.call(V)
|
|
600
600
|
}, null, 8, ["render", "props"]),
|
|
601
|
-
|
|
601
|
+
l[1] || (l[1] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
602
602
|
])
|
|
603
603
|
]),
|
|
604
|
-
a("div",
|
|
605
|
-
a("div",
|
|
604
|
+
a("div", Ms, [
|
|
605
|
+
a("div", Us, [
|
|
606
606
|
b(C, {
|
|
607
|
-
label:
|
|
607
|
+
label: s(x)(`inventory.transfer.form.items.table.${s(K).Amount}`)
|
|
608
608
|
}, null, 8, ["label"]),
|
|
609
|
-
b(
|
|
610
|
-
render: (
|
|
611
|
-
props: (
|
|
609
|
+
b(s(pe), {
|
|
610
|
+
render: (Y = (T = ($ = r.cellByColId[s(K).Amount]) == null ? void 0 : $.column) == null ? void 0 : T.columnDef) == null ? void 0 : Y.cell,
|
|
611
|
+
props: (E = (z = r.cellByColId[s(K).Amount]) == null ? void 0 : z.getContext) == null ? void 0 : E.call(z)
|
|
612
612
|
}, null, 8, ["render", "props"]),
|
|
613
|
-
|
|
613
|
+
l[2] || (l[2] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
614
614
|
]),
|
|
615
|
-
r.cellByColId[
|
|
615
|
+
r.cellByColId[s(K).Cost] ? (S(), F("div", Os, [
|
|
616
616
|
b(wt, { "z-index": 50 }, {
|
|
617
617
|
default: R(() => [
|
|
618
618
|
b(C, {
|
|
619
|
-
label:
|
|
619
|
+
label: s(x)(`inventory.transfer.form.items.table.${s(K).Cost}2`)
|
|
620
620
|
}, null, 8, ["label"])
|
|
621
621
|
]),
|
|
622
622
|
_: 1
|
|
623
623
|
}),
|
|
624
|
-
b(
|
|
625
|
-
render: (G = (B = (j = r.cellByColId[
|
|
626
|
-
props: (g = (
|
|
624
|
+
b(s(pe), {
|
|
625
|
+
render: (G = (B = (j = r.cellByColId[s(K).Cost]) == null ? void 0 : j.column) == null ? void 0 : B.columnDef) == null ? void 0 : G.cell,
|
|
626
|
+
props: (g = (_ = r.cellByColId[s(K).Cost]) == null ? void 0 : _.getContext) == null ? void 0 : g.call(_)
|
|
627
627
|
}, null, 8, ["render", "props"]),
|
|
628
|
-
|
|
628
|
+
l[3] || (l[3] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
629
629
|
])) : N("", !0)
|
|
630
630
|
]),
|
|
631
|
-
r.showComparePrice && Object.keys(r.comparePriceBySku[(M = r.row.original.sku) == null ? void 0 : M._id] ?? {}).length > 0 ? (
|
|
631
|
+
r.showComparePrice && Object.keys(r.comparePriceBySku[(M = r.row.original.sku) == null ? void 0 : M._id] ?? {}).length > 0 ? (S(), F(ne, { key: 0 }, [
|
|
632
632
|
b(t, { class: "h-8" }),
|
|
633
633
|
b(qt, {
|
|
634
634
|
prices: r.comparePriceBySku[(J = r.row.original.sku) == null ? void 0 : J._id]
|
|
@@ -638,51 +638,51 @@ const wo = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
638
638
|
};
|
|
639
639
|
}
|
|
640
640
|
});
|
|
641
|
-
function
|
|
642
|
-
const
|
|
641
|
+
function Bs(f) {
|
|
642
|
+
const x = O({
|
|
643
643
|
get() {
|
|
644
|
-
const t =
|
|
644
|
+
const t = f.getEffectiveAt();
|
|
645
645
|
return t ? new Date(t) : null;
|
|
646
646
|
},
|
|
647
647
|
set(t) {
|
|
648
|
-
|
|
648
|
+
f.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
|
|
649
649
|
}
|
|
650
650
|
}), r = O({
|
|
651
651
|
get() {
|
|
652
|
-
return !!
|
|
652
|
+
return !!x.value;
|
|
653
653
|
},
|
|
654
654
|
set(t) {
|
|
655
|
-
t ?
|
|
655
|
+
t ? x.value = /* @__PURE__ */ new Date() : x.value = null;
|
|
656
656
|
}
|
|
657
|
-
}),
|
|
657
|
+
}), l = O({
|
|
658
658
|
get() {
|
|
659
|
-
return
|
|
659
|
+
return x.value === null ? "" : We(x.value);
|
|
660
660
|
},
|
|
661
661
|
set(t) {
|
|
662
|
-
t ?
|
|
662
|
+
t ? x.value = /* @__PURE__ */ new Date(`${t} ${C.value}`) : x.value = null;
|
|
663
663
|
}
|
|
664
664
|
}), C = O({
|
|
665
665
|
get() {
|
|
666
|
-
return
|
|
666
|
+
return x.value === null ? "" : Qt(x.value);
|
|
667
667
|
},
|
|
668
668
|
set(t) {
|
|
669
|
-
t ?
|
|
669
|
+
t ? x.value = /* @__PURE__ */ new Date(`${l.value} ${t}`) : x.value = null;
|
|
670
670
|
}
|
|
671
671
|
});
|
|
672
672
|
return {
|
|
673
|
-
backdatePo:
|
|
673
|
+
backdatePo: x,
|
|
674
674
|
backdateSwitch: r,
|
|
675
|
-
backdateModel:
|
|
675
|
+
backdateModel: l,
|
|
676
676
|
backdateTimeModel: C
|
|
677
677
|
};
|
|
678
678
|
}
|
|
679
|
-
const
|
|
679
|
+
const zs = {
|
|
680
680
|
width: "24",
|
|
681
681
|
height: "24",
|
|
682
682
|
viewBox: "0 0 24 24",
|
|
683
683
|
fill: "none",
|
|
684
684
|
xmlns: "http://www.w3.org/2000/svg"
|
|
685
|
-
},
|
|
685
|
+
}, Ls = ["fill"], Hs = ["fill"], js = ["stroke"], Qs = ["stroke"], Ys = /* @__PURE__ */ ae({
|
|
686
686
|
__name: "SparkIcon",
|
|
687
687
|
props: {
|
|
688
688
|
size: {
|
|
@@ -694,144 +694,144 @@ const Lo = {
|
|
|
694
694
|
default: "#c7c7cc"
|
|
695
695
|
}
|
|
696
696
|
},
|
|
697
|
-
setup(
|
|
698
|
-
return (
|
|
697
|
+
setup(f) {
|
|
698
|
+
return (x, r) => (S(), F("svg", zs, [
|
|
699
699
|
a("path", {
|
|
700
700
|
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",
|
|
701
|
-
fill:
|
|
702
|
-
}, null, 8,
|
|
701
|
+
fill: f.color
|
|
702
|
+
}, null, 8, Ls),
|
|
703
703
|
a("path", {
|
|
704
704
|
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",
|
|
705
|
-
fill:
|
|
706
|
-
}, null, 8,
|
|
705
|
+
fill: f.color
|
|
706
|
+
}, null, 8, Hs),
|
|
707
707
|
a("path", {
|
|
708
708
|
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",
|
|
709
|
-
stroke:
|
|
709
|
+
stroke: f.color,
|
|
710
710
|
"stroke-width": "1.5",
|
|
711
711
|
"stroke-linecap": "round",
|
|
712
712
|
"stroke-linejoin": "round"
|
|
713
|
-
}, null, 8,
|
|
713
|
+
}, null, 8, js),
|
|
714
714
|
a("path", {
|
|
715
715
|
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",
|
|
716
|
-
stroke:
|
|
716
|
+
stroke: f.color,
|
|
717
717
|
"stroke-width": "1.5",
|
|
718
718
|
"stroke-linecap": "round",
|
|
719
719
|
"stroke-linejoin": "round"
|
|
720
|
-
}, null, 8,
|
|
720
|
+
}, null, 8, Qs)
|
|
721
721
|
]));
|
|
722
722
|
}
|
|
723
|
-
}),
|
|
723
|
+
}), Ks = { class: "flex gap-8 items-center" }, Xs = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, Zs = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Gs = { class: "flex items-center w-full" }, Js = { class: "flex-1" }, Ws = { class: "fm-typo-en-title-sm-800" }, eo = { class: "flex items-start gap-8" }, to = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, so = { class: "flex gap-1" }, bt = /* @__PURE__ */ ae({
|
|
724
724
|
__name: "ForecastStock",
|
|
725
725
|
props: {
|
|
726
726
|
disabled: { type: Boolean }
|
|
727
727
|
},
|
|
728
728
|
emits: ["update:poItems"],
|
|
729
|
-
setup(
|
|
730
|
-
const r =
|
|
731
|
-
async function
|
|
729
|
+
setup(f, { emit: x }) {
|
|
730
|
+
const r = x, l = A(!1), C = A(7), t = ms(), m = De(), d = et(), { t: u } = fe();
|
|
731
|
+
async function h() {
|
|
732
732
|
if (C.value < 1)
|
|
733
733
|
return;
|
|
734
|
-
|
|
735
|
-
const
|
|
734
|
+
l.value = !1, await t.readPurchaseOrder(C.value);
|
|
735
|
+
const o = [];
|
|
736
736
|
if (t.purchaseOrderForecast.skus.length <= 0) {
|
|
737
|
-
|
|
737
|
+
m.open({
|
|
738
738
|
message: u("inventory.transfer.form.items.forecastStock.notAvailable"),
|
|
739
739
|
type: "info"
|
|
740
740
|
});
|
|
741
741
|
return;
|
|
742
742
|
}
|
|
743
|
-
const e = t.purchaseOrderForecast.skus.reduce((
|
|
744
|
-
const y =
|
|
745
|
-
if (
|
|
746
|
-
return
|
|
743
|
+
const e = t.purchaseOrderForecast.skus.reduce((i, c) => {
|
|
744
|
+
const y = d.skus.find((v) => v._id === c.id);
|
|
745
|
+
if (i.find((v) => v.sku._id === c.id) || !y)
|
|
746
|
+
return i;
|
|
747
747
|
const I = {
|
|
748
748
|
sku: y,
|
|
749
749
|
code: y.code,
|
|
750
750
|
name: y.name,
|
|
751
751
|
quantity: {
|
|
752
|
-
amount:
|
|
752
|
+
amount: c.amount,
|
|
753
753
|
precision: 0
|
|
754
754
|
}
|
|
755
755
|
};
|
|
756
|
-
return
|
|
757
|
-
},
|
|
756
|
+
return i.push(I), i;
|
|
757
|
+
}, o);
|
|
758
758
|
r("update:poItems", e);
|
|
759
759
|
}
|
|
760
|
-
return (
|
|
761
|
-
const
|
|
762
|
-
return
|
|
763
|
-
disabled:
|
|
760
|
+
return (o, e) => {
|
|
761
|
+
const i = D("FmButton"), c = D("FmIcon"), y = D("FmStepperField"), k = D("FmPopover");
|
|
762
|
+
return S(), Q(k, {
|
|
763
|
+
disabled: o.disabled,
|
|
764
764
|
class: "flex",
|
|
765
|
-
"show-popover":
|
|
766
|
-
onPopoverChanged: e[3] || (e[3] = (I) =>
|
|
765
|
+
"show-popover": l.value,
|
|
766
|
+
onPopoverChanged: e[3] || (e[3] = (I) => l.value = I)
|
|
767
767
|
}, {
|
|
768
768
|
"popover-button": R(() => [
|
|
769
|
-
b(
|
|
769
|
+
b(i, {
|
|
770
770
|
label: "unused",
|
|
771
771
|
variant: "secondary",
|
|
772
|
-
"text-color":
|
|
772
|
+
"text-color": o.disabled ? "disabled" : "primary",
|
|
773
773
|
"bg-color": "transparent",
|
|
774
|
-
"border-color":
|
|
775
|
-
disabled:
|
|
774
|
+
"border-color": o.disabled ? "disabled" : "primary",
|
|
775
|
+
disabled: o.disabled
|
|
776
776
|
}, {
|
|
777
777
|
default: R(() => [
|
|
778
|
-
a("div",
|
|
779
|
-
b(
|
|
778
|
+
a("div", Ks, [
|
|
779
|
+
b(Ys, {
|
|
780
780
|
size: 24,
|
|
781
|
-
color:
|
|
781
|
+
color: o.disabled ? "#c7c7cc" : "#ff7823"
|
|
782
782
|
}, null, 8, ["color"]),
|
|
783
|
-
a("div",
|
|
783
|
+
a("div", Xs, q(s(u)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
784
784
|
])
|
|
785
785
|
]),
|
|
786
786
|
_: 1
|
|
787
787
|
}, 8, ["text-color", "border-color", "disabled"])
|
|
788
788
|
]),
|
|
789
789
|
default: R(() => [
|
|
790
|
-
a("div",
|
|
791
|
-
a("div",
|
|
792
|
-
a("div",
|
|
793
|
-
b(
|
|
790
|
+
a("div", Zs, [
|
|
791
|
+
a("div", Gs, [
|
|
792
|
+
a("div", Js, [
|
|
793
|
+
b(_s, { "z-index": 99 }, {
|
|
794
794
|
default: R(() => [
|
|
795
|
-
a("p",
|
|
795
|
+
a("p", Ws, q(s(u)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
796
796
|
]),
|
|
797
797
|
_: 1
|
|
798
798
|
})
|
|
799
799
|
]),
|
|
800
|
-
b(
|
|
800
|
+
b(i, {
|
|
801
801
|
icon: "close",
|
|
802
802
|
size: "md",
|
|
803
803
|
variant: "tertiary",
|
|
804
|
-
onClick: e[0] || (e[0] = (I) =>
|
|
804
|
+
onClick: e[0] || (e[0] = (I) => l.value = !1)
|
|
805
805
|
})
|
|
806
806
|
]),
|
|
807
807
|
b(y, {
|
|
808
808
|
modelValue: C.value,
|
|
809
809
|
"onUpdate:modelValue": e[1] || (e[1] = (I) => C.value = I),
|
|
810
|
-
label:
|
|
811
|
-
rules: [
|
|
810
|
+
label: s(u)("inventory.transfer.form.items.forecastStock.days"),
|
|
811
|
+
rules: [s(ze)(1)]
|
|
812
812
|
}, {
|
|
813
813
|
"helper-text": R(() => [
|
|
814
|
-
a("div",
|
|
815
|
-
b(
|
|
814
|
+
a("div", eo, [
|
|
815
|
+
b(c, {
|
|
816
816
|
name: "warning",
|
|
817
817
|
size: "sm",
|
|
818
818
|
class: "text-fm-color-system-warning-300"
|
|
819
819
|
}),
|
|
820
|
-
a("div",
|
|
820
|
+
a("div", to, q(s(u)("inventory.transfer.form.items.forecastStock.replace")), 1)
|
|
821
821
|
])
|
|
822
822
|
]),
|
|
823
823
|
_: 1
|
|
824
824
|
}, 8, ["modelValue", "label", "rules"]),
|
|
825
|
-
a("div",
|
|
825
|
+
a("div", so, [
|
|
826
826
|
e[4] || (e[4] = a("div", { class: "grow" }, null, -1)),
|
|
827
|
-
b(
|
|
828
|
-
label:
|
|
827
|
+
b(i, {
|
|
828
|
+
label: s(u)("common.cancel"),
|
|
829
829
|
variant: "tertiary",
|
|
830
|
-
onClick: e[2] || (e[2] = (I) =>
|
|
830
|
+
onClick: e[2] || (e[2] = (I) => l.value = !1)
|
|
831
831
|
}, null, 8, ["label"]),
|
|
832
|
-
b(
|
|
833
|
-
label:
|
|
834
|
-
onClick:
|
|
832
|
+
b(i, {
|
|
833
|
+
label: s(u)("inventory.transfer.form.items.forecastStock.generate"),
|
|
834
|
+
onClick: h
|
|
835
835
|
}, null, 8, ["label"])
|
|
836
836
|
])
|
|
837
837
|
])
|
|
@@ -841,61 +841,61 @@ const Lo = {
|
|
|
841
841
|
};
|
|
842
842
|
}
|
|
843
843
|
});
|
|
844
|
-
function
|
|
845
|
-
const
|
|
846
|
-
be(r, (
|
|
847
|
-
|
|
844
|
+
function oo() {
|
|
845
|
+
const f = De(), x = ot(), r = A(!1);
|
|
846
|
+
be(r, (m) => {
|
|
847
|
+
m && (C.value = !0, l().finally(() => {
|
|
848
848
|
C.value = !1;
|
|
849
849
|
}));
|
|
850
850
|
});
|
|
851
|
-
async function
|
|
851
|
+
async function l() {
|
|
852
852
|
try {
|
|
853
|
-
const { startDate:
|
|
853
|
+
const { startDate: m, endDate: d } = Yt(6), o = (await x.getPurchaseOrders({ start: m, end: d })).filter(
|
|
854
854
|
(e) => {
|
|
855
|
-
var
|
|
856
|
-
return e.status === Kt.enum.COMPLETE && ((
|
|
855
|
+
var i, c;
|
|
856
|
+
return e.status === Kt.enum.COMPLETE && ((i = e.supplier) == null ? void 0 : i.internal) !== "warehouse" && ((c = e.supplier) == null ? void 0 : c.internal) !== "restaurant";
|
|
857
857
|
}
|
|
858
|
-
).reduce((e,
|
|
859
|
-
const
|
|
860
|
-
for (const k of
|
|
858
|
+
).reduce((e, i) => {
|
|
859
|
+
const c = new Date(Xt(i._id)), y = i.supplier._id;
|
|
860
|
+
for (const k of i.items) {
|
|
861
861
|
if (!k.totalCost) continue;
|
|
862
|
-
const I = e[k.sku._id] ?? {},
|
|
863
|
-
|
|
864
|
-
date:
|
|
862
|
+
const I = e[k.sku._id] ?? {}, v = I[y] ?? [];
|
|
863
|
+
v.push({
|
|
864
|
+
date: c.toISOString(),
|
|
865
865
|
totalUnit: k.quantity,
|
|
866
866
|
totalCost: k.totalCost,
|
|
867
867
|
unit: k.sku.unit,
|
|
868
868
|
measurement: k.measurement,
|
|
869
|
-
seqNumber:
|
|
870
|
-
}), I[y] =
|
|
869
|
+
seqNumber: i.seqNumber
|
|
870
|
+
}), I[y] = v, e[k.sku._id] = I;
|
|
871
871
|
}
|
|
872
872
|
return e;
|
|
873
873
|
}, {});
|
|
874
|
-
t.value =
|
|
874
|
+
t.value = o;
|
|
875
875
|
} catch {
|
|
876
|
-
|
|
876
|
+
f.open({
|
|
877
877
|
title: "Something went wrong",
|
|
878
878
|
message: "Cannot retrieve supplier purchase history. Please try again."
|
|
879
879
|
}), r.value = !1;
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
|
-
const C =
|
|
882
|
+
const C = A(!1), t = A({});
|
|
883
883
|
return {
|
|
884
884
|
comparePricesToggle: r,
|
|
885
885
|
comparePriceFetching: C,
|
|
886
886
|
comparePriceBySku: t
|
|
887
887
|
};
|
|
888
888
|
}
|
|
889
|
-
const
|
|
889
|
+
const no = { class: "hover:bg-fm-color-opacity-sm" }, ao = { class: "flex items-center" }, lo = {
|
|
890
890
|
key: 0,
|
|
891
891
|
class: "flex h-full w-24"
|
|
892
|
-
},
|
|
892
|
+
}, ro = { class: "flex flex-col flex-1 line-clamp-1" }, io = { class: "text-fm-color-typo-primary fm-typo-en-body-md-400" }, uo = { class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400" }, mo = {
|
|
893
893
|
key: 2,
|
|
894
894
|
class: "flex-1"
|
|
895
|
-
},
|
|
895
|
+
}, co = {
|
|
896
896
|
key: 3,
|
|
897
897
|
class: "flex w-full justify-end"
|
|
898
|
-
},
|
|
898
|
+
}, po = /* @__PURE__ */ ae({
|
|
899
899
|
__name: "TransferSubItemTable",
|
|
900
900
|
props: {
|
|
901
901
|
templateSubItem: {},
|
|
@@ -905,75 +905,75 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
905
905
|
subItemIndex: {}
|
|
906
906
|
},
|
|
907
907
|
emits: ["delete:model-value"],
|
|
908
|
-
setup(
|
|
909
|
-
const r = tt(),
|
|
908
|
+
setup(f, { emit: x }) {
|
|
909
|
+
const r = tt(), l = x, C = A(me(r.quantity));
|
|
910
910
|
return be(C, (t) => {
|
|
911
911
|
if (!`${t}`) return;
|
|
912
|
-
const
|
|
913
|
-
Number.isNaN(
|
|
914
|
-
}), (t,
|
|
915
|
-
const
|
|
916
|
-
return
|
|
917
|
-
(
|
|
918
|
-
key:
|
|
919
|
-
class:
|
|
912
|
+
const m = +t;
|
|
913
|
+
Number.isNaN(m) || (r.quantity = xt(m));
|
|
914
|
+
}), (t, m) => {
|
|
915
|
+
const d = D("FmIcon"), u = D("FmTooltip"), h = D("FmButton");
|
|
916
|
+
return S(), F("tr", no, [
|
|
917
|
+
(S(!0), F(ne, null, ge(t.row.getVisibleCells(), (o, e) => (S(), F("td", {
|
|
918
|
+
key: o.id,
|
|
919
|
+
class: X([e === 0 ? "px-16" : o.column.id === s(K).Delete ? "" : "px-16"])
|
|
920
920
|
}, [
|
|
921
|
-
a("div",
|
|
922
|
-
e === 0 ? (
|
|
923
|
-
t.subItemIndex === 0 ? (
|
|
921
|
+
a("div", ao, [
|
|
922
|
+
e === 0 ? (S(), F("div", lo, [
|
|
923
|
+
t.subItemIndex === 0 ? (S(), Q(d, {
|
|
924
924
|
key: 0,
|
|
925
925
|
name: "subdirectory_arrow_right",
|
|
926
926
|
size: "sm"
|
|
927
927
|
})) : N("", !0)
|
|
928
928
|
])) : N("", !0),
|
|
929
|
-
|
|
929
|
+
o.column.id === s(K).TemplateName ? (S(), Q(u, {
|
|
930
930
|
key: 1,
|
|
931
931
|
"z-index": 50
|
|
932
932
|
}, {
|
|
933
933
|
content: R(() => [
|
|
934
|
-
Ie(q(
|
|
934
|
+
Ie(q(s(r).name), 1)
|
|
935
935
|
]),
|
|
936
936
|
default: R(() => [
|
|
937
|
-
a("div",
|
|
938
|
-
a("div",
|
|
939
|
-
a("div",
|
|
937
|
+
a("div", ro, [
|
|
938
|
+
a("div", io, q(s(r).name), 1),
|
|
939
|
+
a("div", uo, q(s(r).code), 1)
|
|
940
940
|
])
|
|
941
941
|
]),
|
|
942
942
|
_: 1
|
|
943
|
-
})) :
|
|
943
|
+
})) : o.column.id === s(K).Amount ? (S(), F("div", mo, [
|
|
944
944
|
b(Dt, {
|
|
945
945
|
"model-value": {
|
|
946
|
-
amount:
|
|
947
|
-
measurement:
|
|
946
|
+
amount: s(r).quantity,
|
|
947
|
+
measurement: s(r).measurement
|
|
948
948
|
},
|
|
949
|
-
"onUpdate:modelValue":
|
|
949
|
+
"onUpdate:modelValue": m[0] || (m[0] = (i) => s(r).quantity = i.amount),
|
|
950
950
|
unit: t.row.original.sku.unit,
|
|
951
951
|
rules: [
|
|
952
|
-
|
|
953
|
-
+
|
|
952
|
+
s(Tt)(
|
|
953
|
+
+s(me)(
|
|
954
954
|
t.templateSubItem.minimumQuantity ?? {
|
|
955
955
|
amount: 1,
|
|
956
|
-
precision:
|
|
956
|
+
precision: s(st)(t.row.original.sku.unit, s(r).measurement)
|
|
957
957
|
}
|
|
958
958
|
)
|
|
959
959
|
),
|
|
960
|
-
|
|
961
|
-
t.templateSubItem.maximumQuantity ? +
|
|
960
|
+
s(Vt)(
|
|
961
|
+
t.templateSubItem.maximumQuantity ? +s(me)(t.templateSubItem.maximumQuantity) : 1 / 0
|
|
962
962
|
),
|
|
963
|
-
|
|
963
|
+
s(Pt)(t.templateSubItem.quantityStep)
|
|
964
964
|
],
|
|
965
965
|
stepper: t.templateSubItem.quantityStep,
|
|
966
966
|
disabled: t.disabled,
|
|
967
967
|
"disable-unit": ""
|
|
968
968
|
}, null, 8, ["model-value", "unit", "rules", "stepper", "disabled"])
|
|
969
|
-
])) :
|
|
970
|
-
b(
|
|
969
|
+
])) : o.column.id === s(K).Delete ? (S(), F("div", co, [
|
|
970
|
+
b(h, {
|
|
971
971
|
key: "row.sku._id",
|
|
972
972
|
type: "button",
|
|
973
973
|
icon: "delete",
|
|
974
974
|
variant: "tertiary",
|
|
975
975
|
size: "md",
|
|
976
|
-
onClick:
|
|
976
|
+
onClick: m[1] || (m[1] = (i) => l("delete:model-value", t.modelValue)),
|
|
977
977
|
disabled: t.disabled
|
|
978
978
|
}, null, 8, ["disabled"])
|
|
979
979
|
])) : N("", !0)
|
|
@@ -982,7 +982,7 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
982
982
|
]);
|
|
983
983
|
};
|
|
984
984
|
}
|
|
985
|
-
}),
|
|
985
|
+
}), fo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, vo = { key: 1 }, yo = ["colspan"], bo = /* @__PURE__ */ ae({
|
|
986
986
|
__name: "TransferItemTable",
|
|
987
987
|
props: {
|
|
988
988
|
templateItem: {},
|
|
@@ -992,59 +992,59 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
992
992
|
disabled: { type: Boolean }
|
|
993
993
|
},
|
|
994
994
|
emits: ["update:item"],
|
|
995
|
-
setup(
|
|
996
|
-
const r =
|
|
995
|
+
setup(f, { emit: x }) {
|
|
996
|
+
const r = f, l = x;
|
|
997
997
|
function C(u) {
|
|
998
998
|
return u.column.columnDef.meta;
|
|
999
999
|
}
|
|
1000
1000
|
function t(u) {
|
|
1001
|
-
var
|
|
1002
|
-
return ((
|
|
1001
|
+
var h, o;
|
|
1002
|
+
return ((o = (h = r.templateItem) == null ? void 0 : h.subItems) == null ? void 0 : o.find((e) => e.id === u.id)) ?? {
|
|
1003
1003
|
id: u.id,
|
|
1004
1004
|
code: u.code,
|
|
1005
1005
|
name: u.name,
|
|
1006
1006
|
quantity: u.quantity,
|
|
1007
1007
|
quantityStep: {
|
|
1008
1008
|
amount: 1,
|
|
1009
|
-
precision:
|
|
1009
|
+
precision: st(r.row.original.sku.unit, u.measurement)
|
|
1010
1010
|
}
|
|
1011
1011
|
};
|
|
1012
1012
|
}
|
|
1013
|
-
function
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1013
|
+
function m(u) {
|
|
1014
|
+
const o = (r.row.original.subItems ?? []).map((e) => e.id !== u.id ? e : u);
|
|
1015
|
+
l("update:item", {
|
|
1016
1016
|
...r.row.original,
|
|
1017
|
-
subItems:
|
|
1017
|
+
subItems: o
|
|
1018
1018
|
});
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1020
|
+
function d(u) {
|
|
1021
|
+
const o = (r.row.original.subItems ?? []).filter((e) => e.id !== u.id);
|
|
1022
|
+
l("update:item", {
|
|
1023
1023
|
...r.row.original,
|
|
1024
|
-
subItems:
|
|
1024
|
+
subItems: o.length ? o : null
|
|
1025
1025
|
});
|
|
1026
1026
|
}
|
|
1027
|
-
return (u,
|
|
1028
|
-
var
|
|
1029
|
-
return
|
|
1027
|
+
return (u, h) => {
|
|
1028
|
+
var o, e, i, c, y;
|
|
1029
|
+
return S(), F(ne, null, [
|
|
1030
1030
|
a("tr", {
|
|
1031
|
-
class:
|
|
1031
|
+
class: X(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
|
|
1032
1032
|
"bg-fm-color-neutral-gray-100": u.row.getIsSelected()
|
|
1033
1033
|
}])
|
|
1034
1034
|
}, [
|
|
1035
|
-
(
|
|
1036
|
-
var I,
|
|
1037
|
-
return
|
|
1035
|
+
(S(!0), F(ne, null, ge(u.row.getVisibleCells(), (k) => {
|
|
1036
|
+
var I, v, p, V;
|
|
1037
|
+
return S(), F("td", {
|
|
1038
1038
|
key: k.id,
|
|
1039
|
-
class:
|
|
1039
|
+
class: X(["h-[56px] text-fm-color-typo-primary", ((I = C(k)) == null ? void 0 : I.cellClass) ?? "px-16"]),
|
|
1040
1040
|
style: kt({
|
|
1041
|
-
width: (
|
|
1042
|
-
maxWidth: (
|
|
1041
|
+
width: (v = C(k)) == null ? void 0 : v.width,
|
|
1042
|
+
maxWidth: (p = C(k)) == null ? void 0 : p.maxWidth,
|
|
1043
1043
|
textAlign: ((V = C(k)) == null ? void 0 : V.textAlign) ?? "left"
|
|
1044
1044
|
})
|
|
1045
1045
|
}, [
|
|
1046
|
-
a("span",
|
|
1047
|
-
b(
|
|
1046
|
+
a("span", fo, [
|
|
1047
|
+
b(s(pe), {
|
|
1048
1048
|
render: k.column.columnDef.cell,
|
|
1049
1049
|
props: k.getContext()
|
|
1050
1050
|
}, null, 8, ["render", "props"])
|
|
@@ -1052,35 +1052,35 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1052
1052
|
], 6);
|
|
1053
1053
|
}), 128))
|
|
1054
1054
|
], 2),
|
|
1055
|
-
(e = (
|
|
1055
|
+
(e = (o = u.row.original) == null ? void 0 : o.subItems) != null && e.length ? (S(!0), F(ne, { key: 0 }, ge((i = u.row.original) == null ? void 0 : i.subItems, (k, I) => (S(), Q(po, {
|
|
1056
1056
|
key: k.id,
|
|
1057
1057
|
row: u.row,
|
|
1058
1058
|
"model-value": k,
|
|
1059
|
-
"onUpdate:modelValue":
|
|
1060
|
-
"onDelete:modelValue":
|
|
1059
|
+
"onUpdate:modelValue": m,
|
|
1060
|
+
"onDelete:modelValue": d,
|
|
1061
1061
|
"template-sub-item": t(k),
|
|
1062
1062
|
"sub-item-index": I,
|
|
1063
1063
|
disabled: u.disabled
|
|
1064
1064
|
}, null, 8, ["row", "model-value", "template-sub-item", "sub-item-index", "disabled"]))), 128)) : N("", !0),
|
|
1065
|
-
u.showComparePrice && Object.keys(u.comparePriceBySku[(
|
|
1065
|
+
u.showComparePrice && Object.keys(u.comparePriceBySku[(c = u.row.original.sku) == null ? void 0 : c._id] ?? {}).length > 0 ? (S(), F("tr", vo, [
|
|
1066
1066
|
a("td", {
|
|
1067
1067
|
colspan: u.row.getVisibleCells().length
|
|
1068
1068
|
}, [
|
|
1069
1069
|
b(qt, {
|
|
1070
1070
|
prices: u.comparePriceBySku[(y = u.row.original.sku) == null ? void 0 : y._id]
|
|
1071
1071
|
}, null, 8, ["prices"])
|
|
1072
|
-
], 8,
|
|
1072
|
+
], 8, yo)
|
|
1073
1073
|
])) : N("", !0)
|
|
1074
1074
|
], 64);
|
|
1075
1075
|
};
|
|
1076
1076
|
}
|
|
1077
|
-
}),
|
|
1077
|
+
}), go = {
|
|
1078
1078
|
key: 0,
|
|
1079
1079
|
class: "flex flex-col gap-8"
|
|
1080
|
-
},
|
|
1080
|
+
}, _o = { class: "flex flex-col gap-4" }, ho = { class: "flex items-center gap-4" }, ko = {
|
|
1081
1081
|
key: 0,
|
|
1082
1082
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-error"
|
|
1083
|
-
},
|
|
1083
|
+
}, xo = /* @__PURE__ */ ae({
|
|
1084
1084
|
__name: "NetSuiteField",
|
|
1085
1085
|
props: {
|
|
1086
1086
|
required: { type: Boolean },
|
|
@@ -1091,74 +1091,74 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1091
1091
|
onChange: { type: Function }
|
|
1092
1092
|
},
|
|
1093
1093
|
emits: ["netsuite:ready"],
|
|
1094
|
-
setup(
|
|
1095
|
-
const r = He(),
|
|
1094
|
+
setup(f, { emit: x }) {
|
|
1095
|
+
const r = He(), l = f, C = x, { t } = hs(), m = A(!1), d = A();
|
|
1096
1096
|
Le(() => {
|
|
1097
|
-
var e,
|
|
1098
|
-
let
|
|
1097
|
+
var e, i, c, y;
|
|
1098
|
+
let o = {
|
|
1099
1099
|
id: "",
|
|
1100
1100
|
subsidiary: { id: "", name: "" },
|
|
1101
1101
|
errors: []
|
|
1102
1102
|
};
|
|
1103
|
-
if (!r.isEnabled || !
|
|
1104
|
-
C("netsuite:ready",
|
|
1103
|
+
if (!r.isEnabled || !l.required) {
|
|
1104
|
+
C("netsuite:ready", o);
|
|
1105
1105
|
return;
|
|
1106
1106
|
}
|
|
1107
1107
|
try {
|
|
1108
1108
|
const k = r.currentLocationSubsidiary();
|
|
1109
|
-
|
|
1110
|
-
...
|
|
1109
|
+
l.setting ? o = {
|
|
1110
|
+
...l.setting,
|
|
1111
1111
|
subsidiary: {
|
|
1112
1112
|
id: k.id || "",
|
|
1113
1113
|
name: k.name
|
|
1114
1114
|
}
|
|
1115
|
-
} :
|
|
1116
|
-
...
|
|
1115
|
+
} : o = {
|
|
1116
|
+
...o,
|
|
1117
1117
|
subsidiary: {
|
|
1118
1118
|
id: k.id || "",
|
|
1119
1119
|
name: k.name
|
|
1120
1120
|
}
|
|
1121
1121
|
};
|
|
1122
|
-
const I = r.getAvailableItems(k.id),
|
|
1123
|
-
if (
|
|
1122
|
+
const I = r.getAvailableItems(k.id), v = l.items.filter((p) => {
|
|
1123
|
+
if (p.measurement != null) {
|
|
1124
1124
|
const V = r.getAvailableMeasurements(
|
|
1125
|
-
|
|
1125
|
+
p.sku._id,
|
|
1126
1126
|
k.id
|
|
1127
1127
|
);
|
|
1128
|
-
return I.includes(
|
|
1128
|
+
return I.includes(p.sku._id) && V.includes(p.measurement.id);
|
|
1129
1129
|
}
|
|
1130
|
-
return I.includes(
|
|
1131
|
-
}).map((
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1130
|
+
return I.includes(p.sku._id);
|
|
1131
|
+
}).map((p) => p.sku._id);
|
|
1132
|
+
l.onChange(
|
|
1133
|
+
l.items.filter((p) => v.includes(p.sku._id)),
|
|
1134
|
+
o
|
|
1135
1135
|
);
|
|
1136
1136
|
} finally {
|
|
1137
|
-
|
|
1138
|
-
`${
|
|
1139
|
-
) :
|
|
1140
|
-
const k =
|
|
1141
|
-
!r.isEnabled || k && r.isEnabled && k == I ? C("netsuite:ready",
|
|
1137
|
+
l.supplier.internal ? d.value = r.getNetSuiteLocation(
|
|
1138
|
+
`${l.supplier.internal}_${l.supplier._id}`
|
|
1139
|
+
) : d.value = r.getNetSuiteVendor(l.supplier._id);
|
|
1140
|
+
const k = l.supplier.internal ? r.getLocationSubsidiary((e = d.value) == null ? void 0 : e.netSuiteId).id : (i = d.value) == null ? void 0 : i.subsidiaryId, I = l.supplier.internal ? (c = r.currentLocationSubsidiary()) == null ? void 0 : c.id : (y = r.currentVendorSubsidiary(l.supplier._id)) == null ? void 0 : y.id;
|
|
1141
|
+
!r.isEnabled || k && r.isEnabled && k == I ? C("netsuite:ready", o) : m.value = !0;
|
|
1142
1142
|
}
|
|
1143
1143
|
});
|
|
1144
1144
|
const u = O(
|
|
1145
|
-
() =>
|
|
1146
|
-
),
|
|
1147
|
-
var
|
|
1148
|
-
return
|
|
1149
|
-
location is ${(e = r.getLocationSubsidiary((
|
|
1145
|
+
() => l.supplier.internal ? r.currentLocationSubsidiary() : r.currentVendorSubsidiary(l.supplier._id)
|
|
1146
|
+
), h = O(() => {
|
|
1147
|
+
var o, e;
|
|
1148
|
+
return d.value == null ? `Cannot find the NetSuite location for "${l.supplier.name}"` : `The subsidiary of the request
|
|
1149
|
+
location is ${(e = r.getLocationSubsidiary((o = d.value) == null ? void 0 : o.netSuiteId)) == null ? void 0 : e.fullName}`;
|
|
1150
1150
|
});
|
|
1151
|
-
return (
|
|
1152
|
-
const
|
|
1153
|
-
return
|
|
1154
|
-
b(
|
|
1155
|
-
label: `NetSuite ${
|
|
1151
|
+
return (o, e) => {
|
|
1152
|
+
const i = D("FmLabel"), c = D("FmIcon"), y = D("FmField"), k = D("FmTooltip");
|
|
1153
|
+
return s(r).isEnabled && l.required ? (S(), F("div", go, [
|
|
1154
|
+
b(i, {
|
|
1155
|
+
label: `NetSuite ${s(t)("inventory.transfer.form.netsuite.subsidiary")}`
|
|
1156
1156
|
}, null, 8, ["label"]),
|
|
1157
|
-
a("div",
|
|
1157
|
+
a("div", _o, [
|
|
1158
1158
|
b(k, {
|
|
1159
1159
|
"z-index": 51,
|
|
1160
1160
|
placement: "left",
|
|
1161
|
-
disabled:
|
|
1161
|
+
disabled: o.disabled
|
|
1162
1162
|
}, {
|
|
1163
1163
|
content: R(() => e[0] || (e[0] = [
|
|
1164
1164
|
Ie("This field is locked and based on the location of the request.")
|
|
@@ -1168,14 +1168,14 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1168
1168
|
default: R(() => {
|
|
1169
1169
|
var I;
|
|
1170
1170
|
return [
|
|
1171
|
-
a("div",
|
|
1172
|
-
b(
|
|
1171
|
+
a("div", ho, [
|
|
1172
|
+
b(c, {
|
|
1173
1173
|
name: "lock_outline",
|
|
1174
1174
|
size: "sm",
|
|
1175
|
-
color:
|
|
1175
|
+
color: o.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
1176
1176
|
}, null, 8, ["color"]),
|
|
1177
1177
|
a("div", {
|
|
1178
|
-
class:
|
|
1178
|
+
class: X([o.disabled ? "text-fm-color-typo-disabled" : ""])
|
|
1179
1179
|
}, q((I = u.value) == null ? void 0 : I.fullName), 3)
|
|
1180
1180
|
])
|
|
1181
1181
|
];
|
|
@@ -1185,21 +1185,21 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1185
1185
|
]),
|
|
1186
1186
|
_: 1
|
|
1187
1187
|
}, 8, ["disabled"]),
|
|
1188
|
-
|
|
1188
|
+
m.value ? (S(), F("div", ko, q(h.value), 1)) : N("", !0)
|
|
1189
1189
|
])
|
|
1190
1190
|
])) : N("", !0);
|
|
1191
1191
|
};
|
|
1192
1192
|
}
|
|
1193
|
-
}),
|
|
1193
|
+
}), So = { class: "flex flex-col gap-4" }, Co = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, wo = { class: "flex flex-col gap-16" }, Io = { class: "flex flex-col gap-24" }, Fo = { class: "flex flex-col gap-8" }, $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center gap-4" }, To = { class: "flex flex-col gap-8" }, Vo = { class: "flex flex-col gap-4" }, Po = { class: "flex items-center gap-4" }, Ro = {
|
|
1194
1194
|
key: 3,
|
|
1195
1195
|
class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
|
|
1196
|
-
},
|
|
1196
|
+
}, qo = {
|
|
1197
1197
|
key: 0,
|
|
1198
1198
|
class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
|
|
1199
|
-
},
|
|
1199
|
+
}, Ao = { class: "flex-1" }, Eo = { class: "flex-1" }, Mo = {
|
|
1200
1200
|
key: 1,
|
|
1201
1201
|
class: "flex items-center gap-4"
|
|
1202
|
-
},
|
|
1202
|
+
}, Uo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Oo = { class: "flex flex-col gap-16" }, No = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Bo = { class: "flex gap-8" }, zo = { key: 0 }, Lo = /* @__PURE__ */ ae({
|
|
1203
1203
|
__name: "TransferForm2",
|
|
1204
1204
|
props: {
|
|
1205
1205
|
modelValue: {},
|
|
@@ -1209,35 +1209,35 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1209
1209
|
lastClosingDate: {}
|
|
1210
1210
|
},
|
|
1211
1211
|
emits: ["validation-success", "form:ready"],
|
|
1212
|
-
setup(
|
|
1213
|
-
const
|
|
1212
|
+
setup(f, { expose: x, emit: r }) {
|
|
1213
|
+
const l = f, C = r, t = tt(), { t: m } = fe(), d = je(), u = et(), h = He(), o = lt(), e = at(), i = $t(), { breakpoints: c } = nt(), y = O(() => c.value.xs || c.value.sm), k = ht({
|
|
1214
1214
|
value: !1
|
|
1215
|
-
}), I =
|
|
1215
|
+
}), I = A(!1), v = O(
|
|
1216
1216
|
() => {
|
|
1217
1217
|
var n;
|
|
1218
|
-
return ((n =
|
|
1218
|
+
return ((n = l.modelValue) == null ? void 0 : n.templateDoc) ?? i.templates.find((w) => w._id === t.template);
|
|
1219
1219
|
}
|
|
1220
|
-
),
|
|
1221
|
-
be(
|
|
1222
|
-
n &&
|
|
1220
|
+
), p = O(() => t.status === "DRAFT" || !t._rev);
|
|
1221
|
+
be(v, (n) => {
|
|
1222
|
+
n && p.value && (t.supplier = (n == null ? void 0 : n.purchaseOrder.supplier) ?? t.supplier);
|
|
1223
1223
|
}), Le(() => {
|
|
1224
1224
|
var n;
|
|
1225
1225
|
try {
|
|
1226
1226
|
if (!t.templateDoc) return;
|
|
1227
|
-
t.items.length || (t.items = ((n =
|
|
1227
|
+
t.items.length || (t.items = ((n = v.value) == null ? void 0 : n.purchaseOrder.items) ?? []);
|
|
1228
1228
|
} finally {
|
|
1229
1229
|
I.value = !0;
|
|
1230
1230
|
}
|
|
1231
|
-
}), be([I, k], ([n, w], [
|
|
1231
|
+
}), be([I, k], ([n, w], [Z, ie]) => {
|
|
1232
1232
|
w.value && ie.value && C("form:ready");
|
|
1233
1233
|
});
|
|
1234
1234
|
const V = O(
|
|
1235
|
-
() =>
|
|
1235
|
+
() => d.currentLocation.type === Zt.enum.restaurant
|
|
1236
1236
|
);
|
|
1237
|
-
|
|
1238
|
-
location && (t.supplier || (t.supplier =
|
|
1237
|
+
d.watchLocation(async () => {
|
|
1238
|
+
location && (t.supplier || (t.supplier = o.suppliers.find((n) => n) ?? t.supplier));
|
|
1239
1239
|
});
|
|
1240
|
-
const L = It(), $ =
|
|
1240
|
+
const L = It(), $ = vs(
|
|
1241
1241
|
() => t,
|
|
1242
1242
|
(n) => {
|
|
1243
1243
|
Object.assign(t, n);
|
|
@@ -1247,34 +1247,34 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1247
1247
|
), T = O({
|
|
1248
1248
|
get() {
|
|
1249
1249
|
var n;
|
|
1250
|
-
return typeof ((n = t == null ? void 0 : t.supplier) == null ? void 0 : n.internal) == "string" ?
|
|
1250
|
+
return typeof ((n = t == null ? void 0 : t.supplier) == null ? void 0 : n.internal) == "string" ? oe.TRANSFER : oe.PURCHASE;
|
|
1251
1251
|
},
|
|
1252
1252
|
set(n) {
|
|
1253
|
-
var
|
|
1254
|
-
const w = typeof ((
|
|
1255
|
-
n !== w && (t.supplier = n ===
|
|
1253
|
+
var Z;
|
|
1254
|
+
const w = typeof ((Z = t == null ? void 0 : t.supplier) == null ? void 0 : Z.internal) == "string" ? oe.TRANSFER : oe.PURCHASE;
|
|
1255
|
+
n !== w && (t.supplier = n === oe.PURCHASE ? $.locationOptionsTypePurchase.value[0] : $.locationOptionsTypeTransfer.value[0]);
|
|
1256
1256
|
}
|
|
1257
1257
|
});
|
|
1258
1258
|
be(
|
|
1259
1259
|
() => {
|
|
1260
1260
|
var n;
|
|
1261
|
-
return (n =
|
|
1261
|
+
return (n = l.modelValue) == null ? void 0 : n.template;
|
|
1262
1262
|
},
|
|
1263
1263
|
(n) => {
|
|
1264
1264
|
e.mustUsePoTemplate && !n && Mt(() => {
|
|
1265
|
-
var w,
|
|
1266
|
-
t.supplier = ((
|
|
1265
|
+
var w, Z;
|
|
1266
|
+
t.supplier = ((Z = (w = $.locationOptionsTypeTransfer.value) == null ? void 0 : w.filter(
|
|
1267
1267
|
(ie) => ie.internal === "restaurant"
|
|
1268
|
-
)) == null ? void 0 :
|
|
1268
|
+
)) == null ? void 0 : Z[0]) ?? t.supplier;
|
|
1269
1269
|
});
|
|
1270
1270
|
},
|
|
1271
1271
|
{ immediate: !0 }
|
|
1272
1272
|
);
|
|
1273
|
-
const
|
|
1273
|
+
const Y = O(() => {
|
|
1274
1274
|
let n = $.transferLocationOptions.value;
|
|
1275
1275
|
return e.mustUsePoTemplate && !t.templateDoc && (n = n.filter((w) => {
|
|
1276
|
-
var
|
|
1277
|
-
return (
|
|
1276
|
+
var Z;
|
|
1277
|
+
return (Z = w.sublabel) == null ? void 0 : Z.startsWith("restaurant");
|
|
1278
1278
|
})), n;
|
|
1279
1279
|
}), z = O({
|
|
1280
1280
|
get() {
|
|
@@ -1283,22 +1283,22 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1283
1283
|
set(n) {
|
|
1284
1284
|
$.transferLocationModel.value = n;
|
|
1285
1285
|
}
|
|
1286
|
-
}),
|
|
1286
|
+
}), E = O({
|
|
1287
1287
|
get() {
|
|
1288
1288
|
return t.remark ?? void 0;
|
|
1289
1289
|
},
|
|
1290
1290
|
set(n) {
|
|
1291
1291
|
t.remark = n;
|
|
1292
1292
|
}
|
|
1293
|
-
}), { backdatePo: j, backdateSwitch: B, backdateModel: G, backdateTimeModel:
|
|
1293
|
+
}), { backdatePo: j, backdateSwitch: B, backdateModel: G, backdateTimeModel: _ } = Bs({
|
|
1294
1294
|
getEffectiveAt() {
|
|
1295
1295
|
return t.effectiveAt;
|
|
1296
1296
|
},
|
|
1297
1297
|
setEffectiveAt(n) {
|
|
1298
1298
|
t.effectiveAt = n;
|
|
1299
1299
|
}
|
|
1300
|
-
}), { comparePricesToggle: g, comparePriceFetching: M, comparePriceBySku: J } =
|
|
1301
|
-
|
|
1300
|
+
}), { comparePricesToggle: g, comparePriceFetching: M, comparePriceBySku: J } = oo(), le = A();
|
|
1301
|
+
x({
|
|
1302
1302
|
validateInputs: () => {
|
|
1303
1303
|
var n, w;
|
|
1304
1304
|
(w = (n = le.value) == null ? void 0 : n.validateInputs) == null || w.call(n);
|
|
@@ -1319,7 +1319,7 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1319
1319
|
deleteItem: (n) => {
|
|
1320
1320
|
t.items = t.items.filter((w) => w.sku._id !== n.sku._id);
|
|
1321
1321
|
}
|
|
1322
|
-
})), $e =
|
|
1322
|
+
})), $e = Ss({
|
|
1323
1323
|
updateItem: (n) => Fe.value.updateItem(n),
|
|
1324
1324
|
deleteItem: (n) => Fe.value.deleteItem(n),
|
|
1325
1325
|
get supplier() {
|
|
@@ -1332,32 +1332,32 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1332
1332
|
return T.value;
|
|
1333
1333
|
},
|
|
1334
1334
|
get template() {
|
|
1335
|
-
return
|
|
1335
|
+
return v.value;
|
|
1336
1336
|
},
|
|
1337
1337
|
get disabled() {
|
|
1338
|
-
return
|
|
1338
|
+
return l.disabled;
|
|
1339
1339
|
}
|
|
1340
|
-
}),
|
|
1341
|
-
function
|
|
1340
|
+
}), Ae = O(() => $e.columnDefs.value);
|
|
1341
|
+
function Ee() {
|
|
1342
1342
|
var _e, Te, Ue, Oe, Ve;
|
|
1343
|
-
const n = (Ue = (Te = (_e =
|
|
1344
|
-
var
|
|
1345
|
-
const ee = (te = (
|
|
1343
|
+
const n = (Ue = (Te = (_e = v.value) == null ? void 0 : _e.purchaseOrder) == null ? void 0 : Te.items) == null ? void 0 : Ue.groupBy((H) => H.sku._id), w = h.isEnabled ? h.getAvailableItems((Ve = (Oe = t.netSuite) == null ? void 0 : Oe.subsidiary) == null ? void 0 : Ve.id) : [], Z = n != null && n.size ? u.skus.filter((H) => n.has(H._id)) : u.skus, ie = h.isEnabled ? Z.filter((H) => {
|
|
1344
|
+
var se, te, re, de;
|
|
1345
|
+
const ee = (te = (se = v.value) == null ? void 0 : se.purchaseOrder) == null ? void 0 : te.items.find(
|
|
1346
1346
|
(ve) => ve.sku._id === H._id
|
|
1347
1347
|
);
|
|
1348
1348
|
if (ee != null && ee.measurement != null) {
|
|
1349
|
-
const ve =
|
|
1349
|
+
const ve = h.getAvailableMeasurements(
|
|
1350
1350
|
ee.sku._id,
|
|
1351
1351
|
(de = (re = t.netSuite) == null ? void 0 : re.subsidiary) == null ? void 0 : de.id
|
|
1352
1352
|
);
|
|
1353
1353
|
return w.includes(ee.sku._id) && ve.includes(ee.measurement.id);
|
|
1354
1354
|
}
|
|
1355
1355
|
return w.includes(H._id);
|
|
1356
|
-
}).map((H) => H._id) :
|
|
1356
|
+
}).map((H) => H._id) : Z.map((H) => H._id), ue = Z.map(
|
|
1357
1357
|
(H) => {
|
|
1358
|
-
var ee,
|
|
1358
|
+
var ee, se, te, re;
|
|
1359
1359
|
return {
|
|
1360
|
-
label: ((
|
|
1360
|
+
label: ((se = (ee = n == null ? void 0 : n.get(H._id)) == null ? void 0 : ee[0]) == null ? void 0 : se.name) ?? H.name,
|
|
1361
1361
|
sublabel: ((re = (te = n == null ? void 0 : n.get(H._id)) == null ? void 0 : te[0]) == null ? void 0 : re.code) ?? H.code,
|
|
1362
1362
|
value: H,
|
|
1363
1363
|
disabled: !ie.includes(H._id)
|
|
@@ -1365,33 +1365,33 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1365
1365
|
}
|
|
1366
1366
|
), xe = ue.filter((H) => {
|
|
1367
1367
|
var ee;
|
|
1368
|
-
return (ee = t.items) == null ? void 0 : ee.find((
|
|
1368
|
+
return (ee = t.items) == null ? void 0 : ee.find((se) => se.sku._id === H.value._id);
|
|
1369
1369
|
}).map((H) => H.value);
|
|
1370
1370
|
L.open({
|
|
1371
|
-
title:
|
|
1371
|
+
title: m("inventory.transfer.form.items.selectItem"),
|
|
1372
1372
|
closeButton: !0,
|
|
1373
|
-
contentComponent:
|
|
1373
|
+
contentComponent: Ze,
|
|
1374
1374
|
contentComponentProps: {
|
|
1375
1375
|
modelValue: xe,
|
|
1376
1376
|
items: ue,
|
|
1377
1377
|
virtualScroll: !0
|
|
1378
1378
|
},
|
|
1379
1379
|
primaryActions: {
|
|
1380
|
-
text:
|
|
1380
|
+
text: m("common.confirm"),
|
|
1381
1381
|
close: !0
|
|
1382
1382
|
},
|
|
1383
1383
|
secondaryActions: {
|
|
1384
|
-
text:
|
|
1384
|
+
text: m("common.close"),
|
|
1385
1385
|
close: !0,
|
|
1386
1386
|
variant: "tertiary"
|
|
1387
1387
|
}
|
|
1388
1388
|
}).onPrimary((H) => {
|
|
1389
|
-
const ee = t.items ?? [],
|
|
1389
|
+
const ee = t.items ?? [], se = H.map((te) => {
|
|
1390
1390
|
var ve, Pe;
|
|
1391
1391
|
const re = ee.find((Se) => Se.sku._id === te._id);
|
|
1392
1392
|
if (re)
|
|
1393
1393
|
return re;
|
|
1394
|
-
const de = ((Pe = (ve =
|
|
1394
|
+
const de = ((Pe = (ve = v.value) == null ? void 0 : ve.purchaseOrder.items) == null ? void 0 : Pe.find(
|
|
1395
1395
|
(Se) => Se.sku._id === te._id
|
|
1396
1396
|
)) ?? {
|
|
1397
1397
|
sku: te,
|
|
@@ -1402,7 +1402,7 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1402
1402
|
precision: 0
|
|
1403
1403
|
}
|
|
1404
1404
|
};
|
|
1405
|
-
return T.value ==
|
|
1405
|
+
return T.value == oe.PURCHASE && (de.totalCost = ye(
|
|
1406
1406
|
de.sku,
|
|
1407
1407
|
de.quantity,
|
|
1408
1408
|
de.measurement,
|
|
@@ -1411,46 +1411,46 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1411
1411
|
}
|
|
1412
1412
|
)), de;
|
|
1413
1413
|
});
|
|
1414
|
-
|
|
1414
|
+
se.sort((te, re) => te.sku.code.localeCompare(re.sku.code)), t.items = se;
|
|
1415
1415
|
});
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1417
|
+
function Qe(n) {
|
|
1418
1418
|
return n;
|
|
1419
1419
|
}
|
|
1420
1420
|
const Me = O(() => {
|
|
1421
1421
|
const n = [];
|
|
1422
1422
|
return (!e.mustUsePoTemplate || e.mustUsePoTemplate && t.templateDoc) && n.push({
|
|
1423
|
-
label:
|
|
1424
|
-
value:
|
|
1423
|
+
label: m("inventory.transfer.form.type.purchase"),
|
|
1424
|
+
value: oe.PURCHASE
|
|
1425
1425
|
}), n.push({
|
|
1426
|
-
label:
|
|
1427
|
-
value:
|
|
1426
|
+
label: m("inventory.transfer.form.type.transfer"),
|
|
1427
|
+
value: oe.TRANSFER
|
|
1428
1428
|
}), n;
|
|
1429
1429
|
}), ke = O(() => {
|
|
1430
1430
|
var n;
|
|
1431
|
-
return (n =
|
|
1431
|
+
return (n = l.modelValue) == null ? void 0 : n.items.every((w) => w.quantity.amount <= 0);
|
|
1432
1432
|
});
|
|
1433
1433
|
return (n, w) => {
|
|
1434
1434
|
var ve, Pe;
|
|
1435
|
-
const
|
|
1436
|
-
return
|
|
1437
|
-
a("div",
|
|
1438
|
-
(ve =
|
|
1435
|
+
const Z = D("FmChip"), ie = D("FmLabel"), ue = D("FmIcon"), xe = D("FmField"), _e = D("FmTooltip"), Te = D("FmSelect"), Ue = D("FmTextField"), Oe = D("FmTextarea"), Ve = D("FmSwitch"), H = D("FmDatePicker"), ee = D("FmTimePicker"), se = D("FmFormGroup"), te = D("FmButton"), re = D("FmTable"), de = D("FmForm");
|
|
1436
|
+
return S(), F("div", So, [
|
|
1437
|
+
a("div", Co, [
|
|
1438
|
+
(ve = l.modelValue) != null && ve.template ? (S(), Q(Z, {
|
|
1439
1439
|
key: 0,
|
|
1440
1440
|
variant: n.disabled ? "warning" : void 0,
|
|
1441
|
-
label: `${
|
|
1441
|
+
label: `${s(m)("inventory.transfer.template.title")}: ${((Pe = v.value) == null ? void 0 : Pe.name) ?? s(m)("inventory.transfer.form.loading")}`,
|
|
1442
1442
|
icon: "summarize",
|
|
1443
1443
|
compact: ""
|
|
1444
1444
|
}, null, 8, ["variant", "label"])) : N("", !0),
|
|
1445
|
-
n.returnFrom ? N("", !0) : (
|
|
1445
|
+
n.returnFrom ? N("", !0) : (S(), Q(Z, {
|
|
1446
1446
|
key: 1,
|
|
1447
|
-
label:
|
|
1447
|
+
label: s(d).currentLocation.name,
|
|
1448
1448
|
icon: "storefront",
|
|
1449
1449
|
compact: ""
|
|
1450
1450
|
}, null, 8, ["label"])),
|
|
1451
|
-
n.lastClosingDate ? (
|
|
1451
|
+
n.lastClosingDate ? (S(), Q(Z, {
|
|
1452
1452
|
key: 2,
|
|
1453
|
-
label: `${
|
|
1453
|
+
label: `${s(m)("inventory.transfer.form.lastClosing")}: ${s(We)(n.lastClosingDate)} ${s(Gt)(n.lastClosingDate)}`,
|
|
1454
1454
|
icon: "calendar_month",
|
|
1455
1455
|
compact: ""
|
|
1456
1456
|
}, null, 8, ["label"])) : N("", !0)
|
|
@@ -1466,14 +1466,14 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1466
1466
|
default: R(() => {
|
|
1467
1467
|
var Se, rt, it, ut, mt, dt, ct, pt;
|
|
1468
1468
|
return [
|
|
1469
|
-
a("div",
|
|
1470
|
-
a("div",
|
|
1471
|
-
(Se =
|
|
1472
|
-
a("div",
|
|
1469
|
+
a("div", wo, [
|
|
1470
|
+
a("div", Io, [
|
|
1471
|
+
(Se = l.modelValue) != null && Se.template ? (S(), F(ne, { key: 0 }, [
|
|
1472
|
+
a("div", Fo, [
|
|
1473
1473
|
b(ie, {
|
|
1474
|
-
label:
|
|
1474
|
+
label: s(m)("inventory.transfer.form.type.title")
|
|
1475
1475
|
}, null, 8, ["label"]),
|
|
1476
|
-
a("div", $
|
|
1476
|
+
a("div", $o, [
|
|
1477
1477
|
b(_e, {
|
|
1478
1478
|
"z-index": 51,
|
|
1479
1479
|
placement: "left",
|
|
@@ -1485,15 +1485,15 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1485
1485
|
default: R(() => [
|
|
1486
1486
|
b(xe, null, {
|
|
1487
1487
|
default: R(() => [
|
|
1488
|
-
a("div",
|
|
1488
|
+
a("div", Do, [
|
|
1489
1489
|
b(ue, {
|
|
1490
1490
|
name: "lock_outline",
|
|
1491
1491
|
size: "sm",
|
|
1492
1492
|
color: n.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
1493
1493
|
}, null, 8, ["color"]),
|
|
1494
1494
|
a("div", {
|
|
1495
|
-
class:
|
|
1496
|
-
}, q(
|
|
1495
|
+
class: X({ "text-fm-color-typo-disabled": n.disabled })
|
|
1496
|
+
}, q(s(m)(`inventory.transfer.form.type.${T.value.toLocaleLowerCase("en-us")}`)), 3)
|
|
1497
1497
|
])
|
|
1498
1498
|
]),
|
|
1499
1499
|
_: 1
|
|
@@ -1502,18 +1502,18 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1502
1502
|
_: 1
|
|
1503
1503
|
}, 8, ["disabled"]),
|
|
1504
1504
|
a("div", {
|
|
1505
|
-
class:
|
|
1505
|
+
class: X([
|
|
1506
1506
|
"fm-typo-en-body-sm-400",
|
|
1507
1507
|
n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
1508
1508
|
])
|
|
1509
1509
|
}, null, 2)
|
|
1510
1510
|
])
|
|
1511
1511
|
]),
|
|
1512
|
-
a("div",
|
|
1512
|
+
a("div", To, [
|
|
1513
1513
|
b(ie, {
|
|
1514
|
-
label: n.returnFrom ? "Return to" : T.value ===
|
|
1514
|
+
label: n.returnFrom ? "Return to" : T.value === s(oe).PURCHASE ? s(m)("inventory.transfer.form.purchaseFrom") : s(m)("inventory.transfer.form.transferFrom")
|
|
1515
1515
|
}, null, 8, ["label"]),
|
|
1516
|
-
a("div",
|
|
1516
|
+
a("div", Vo, [
|
|
1517
1517
|
b(_e, {
|
|
1518
1518
|
"z-index": 51,
|
|
1519
1519
|
placement: "left",
|
|
@@ -1527,15 +1527,15 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1527
1527
|
default: R(() => {
|
|
1528
1528
|
var P, W, he;
|
|
1529
1529
|
return [
|
|
1530
|
-
a("div",
|
|
1530
|
+
a("div", Po, [
|
|
1531
1531
|
b(ue, {
|
|
1532
1532
|
name: "lock_outline",
|
|
1533
1533
|
size: "sm",
|
|
1534
1534
|
color: n.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
1535
1535
|
}, null, 8, ["color"]),
|
|
1536
1536
|
a("div", {
|
|
1537
|
-
class:
|
|
1538
|
-
}, q(((W = (P = n.returnFrom) == null ? void 0 : P.supplier) == null ? void 0 : W.name) ?? ((he =
|
|
1537
|
+
class: X({ "text-fm-color-typo-disabled": n.disabled })
|
|
1538
|
+
}, q(((W = (P = n.returnFrom) == null ? void 0 : P.supplier) == null ? void 0 : W.name) ?? ((he = Y.value.find((Ne) => Ne.value === z.value)) == null ? void 0 : he.label)), 3)
|
|
1539
1539
|
])
|
|
1540
1540
|
];
|
|
1541
1541
|
}),
|
|
@@ -1546,37 +1546,37 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1546
1546
|
}, 8, ["disabled"])
|
|
1547
1547
|
])
|
|
1548
1548
|
])
|
|
1549
|
-
], 64)) : (
|
|
1549
|
+
], 64)) : (S(), F(ne, { key: 1 }, [
|
|
1550
1550
|
b(Te, {
|
|
1551
|
-
label:
|
|
1551
|
+
label: s(m)("inventory.transfer.form.type.title"),
|
|
1552
1552
|
"label-mark": "required",
|
|
1553
1553
|
modelValue: T.value,
|
|
1554
1554
|
"onUpdate:modelValue": w[0] || (w[0] = (P) => T.value = P),
|
|
1555
1555
|
items: Me.value,
|
|
1556
|
-
rules: [
|
|
1556
|
+
rules: [s(ze)(1)(Y.value)]
|
|
1557
1557
|
}, {
|
|
1558
1558
|
default: R(() => [
|
|
1559
1559
|
a("span", {
|
|
1560
|
-
class:
|
|
1560
|
+
class: X([
|
|
1561
1561
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
1562
1562
|
n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
1563
1563
|
])
|
|
1564
|
-
}, q(
|
|
1564
|
+
}, q(s(Jt)(T.value)), 3)
|
|
1565
1565
|
]),
|
|
1566
1566
|
_: 1
|
|
1567
1567
|
}, 8, ["label", "modelValue", "items", "rules"]),
|
|
1568
1568
|
b(Te, {
|
|
1569
|
-
label: T.value ===
|
|
1569
|
+
label: T.value === s(oe).PURCHASE ? s(m)("inventory.transfer.form.purchaseFrom") : s(m)("inventory.transfer.form.transferFrom"),
|
|
1570
1570
|
"label-mark": "required",
|
|
1571
1571
|
modelValue: z.value,
|
|
1572
1572
|
"onUpdate:modelValue": w[1] || (w[1] = (P) => z.value = P),
|
|
1573
|
-
items:
|
|
1573
|
+
items: Y.value
|
|
1574
1574
|
}, {
|
|
1575
1575
|
"menu-wrapper": R((P) => {
|
|
1576
1576
|
var W, he;
|
|
1577
1577
|
return [
|
|
1578
|
-
b(
|
|
1579
|
-
items:
|
|
1578
|
+
b(ys, Xe(P, {
|
|
1579
|
+
items: Y.value,
|
|
1580
1580
|
"model-value": (he = (W = n.modelValue) == null ? void 0 : W.supplier) == null ? void 0 : he._id
|
|
1581
1581
|
}), null, 16, ["items", "model-value"])
|
|
1582
1582
|
];
|
|
@@ -1585,47 +1585,47 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1585
1585
|
var P;
|
|
1586
1586
|
return [
|
|
1587
1587
|
a("span", {
|
|
1588
|
-
class:
|
|
1588
|
+
class: X([
|
|
1589
1589
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
1590
1590
|
n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
1591
1591
|
])
|
|
1592
|
-
}, q((P =
|
|
1592
|
+
}, q((P = Y.value.find((W) => W.value === z.value)) == null ? void 0 : P.label), 3)
|
|
1593
1593
|
];
|
|
1594
1594
|
}),
|
|
1595
1595
|
_: 1
|
|
1596
1596
|
}, 8, ["label", "modelValue", "items"])
|
|
1597
1597
|
], 64)),
|
|
1598
1598
|
b(Ue, {
|
|
1599
|
-
label:
|
|
1599
|
+
label: s(m)("inventory.transfer.form.reference"),
|
|
1600
1600
|
"label-mark": "optional",
|
|
1601
|
-
modelValue:
|
|
1602
|
-
"onUpdate:modelValue": w[2] || (w[2] = (P) =>
|
|
1601
|
+
modelValue: s(t).ref,
|
|
1602
|
+
"onUpdate:modelValue": w[2] || (w[2] = (P) => s(t).ref = P)
|
|
1603
1603
|
}, null, 8, ["label", "modelValue"]),
|
|
1604
1604
|
b(Oe, {
|
|
1605
|
-
label:
|
|
1605
|
+
label: s(m)("inventory.transfer.form.remark"),
|
|
1606
1606
|
"label-mark": "optional",
|
|
1607
1607
|
"max-length": 240,
|
|
1608
|
-
modelValue:
|
|
1609
|
-
"onUpdate:modelValue": w[3] || (w[3] = (P) =>
|
|
1610
|
-
class:
|
|
1608
|
+
modelValue: E.value,
|
|
1609
|
+
"onUpdate:modelValue": w[3] || (w[3] = (P) => E.value = P),
|
|
1610
|
+
class: X([n.disabled ? "text-fm-color-typo-disabled " : ""])
|
|
1611
1611
|
}, null, 8, ["label", "modelValue", "class"]),
|
|
1612
|
-
I.value ? (
|
|
1612
|
+
I.value ? (S(), Q(xo, {
|
|
1613
1613
|
key: 2,
|
|
1614
|
-
required:
|
|
1614
|
+
required: s(t).templateDoc != null,
|
|
1615
1615
|
disabled: n.disabled,
|
|
1616
|
-
supplier:
|
|
1617
|
-
setting:
|
|
1618
|
-
items:
|
|
1616
|
+
supplier: s(t).supplier,
|
|
1617
|
+
setting: s(t).netSuite,
|
|
1618
|
+
items: s(t).items,
|
|
1619
1619
|
onChange: (P, W) => {
|
|
1620
|
-
|
|
1620
|
+
s(t).items = P, s(t).netSuite = W;
|
|
1621
1621
|
},
|
|
1622
1622
|
"onNetsuite:ready": w[4] || (w[4] = (P) => {
|
|
1623
1623
|
k.value = !0;
|
|
1624
1624
|
})
|
|
1625
1625
|
}, null, 8, ["required", "disabled", "supplier", "setting", "items", "onChange"])) : N("", !0),
|
|
1626
|
-
|
|
1626
|
+
s(e).enableBackdatePo ? (S(), F("div", Ro, [
|
|
1627
1627
|
a("div", {
|
|
1628
|
-
class:
|
|
1628
|
+
class: X([
|
|
1629
1629
|
"flex",
|
|
1630
1630
|
{
|
|
1631
1631
|
"flex-col": y.value
|
|
@@ -1633,55 +1633,55 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1633
1633
|
])
|
|
1634
1634
|
}, [
|
|
1635
1635
|
b(Ve, {
|
|
1636
|
-
modelValue:
|
|
1636
|
+
modelValue: s(B),
|
|
1637
1637
|
"onUpdate:modelValue": w[5] || (w[5] = (P) => Ce(B) ? B.value = P : null),
|
|
1638
|
-
label:
|
|
1639
|
-
sublabel:
|
|
1638
|
+
label: s(m)("inventory.transfer.form.backdate.title"),
|
|
1639
|
+
sublabel: s(m)("inventory.transfer.form.backdate.subtitle"),
|
|
1640
1640
|
"label-placement": "right",
|
|
1641
1641
|
disabled: V.value && !n.lastClosingDate || n.disabled
|
|
1642
1642
|
}, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
|
|
1643
1643
|
a("div", {
|
|
1644
|
-
class:
|
|
1644
|
+
class: X({ hidden: y.value, "w-16": !y.value })
|
|
1645
1645
|
}, null, 2),
|
|
1646
|
-
|
|
1647
|
-
a("div",
|
|
1646
|
+
s(B) ? (S(), F("div", qo, [
|
|
1647
|
+
a("div", Ao, [
|
|
1648
1648
|
b(H, {
|
|
1649
|
-
modelValue:
|
|
1649
|
+
modelValue: s(G),
|
|
1650
1650
|
"onUpdate:modelValue": w[6] || (w[6] = (P) => Ce(G) ? G.value = P : null)
|
|
1651
1651
|
}, null, 8, ["modelValue"])
|
|
1652
1652
|
]),
|
|
1653
|
-
a("div",
|
|
1653
|
+
a("div", Eo, [
|
|
1654
1654
|
b(ee, {
|
|
1655
|
-
modelValue:
|
|
1656
|
-
"onUpdate:modelValue": w[7] || (w[7] = (P) => Ce(
|
|
1655
|
+
modelValue: s(_),
|
|
1656
|
+
"onUpdate:modelValue": w[7] || (w[7] = (P) => Ce(_) ? _.value = P : null)
|
|
1657
1657
|
}, null, 8, ["modelValue"])
|
|
1658
1658
|
])
|
|
1659
1659
|
])) : N("", !0)
|
|
1660
1660
|
], 2),
|
|
1661
|
-
|
|
1661
|
+
s(j) ? (S(), Q(se, {
|
|
1662
1662
|
key: 0,
|
|
1663
|
-
modelValue:
|
|
1663
|
+
modelValue: s(j),
|
|
1664
1664
|
"onUpdate:modelValue": w[8] || (w[8] = (P) => Ce(j) ? j.value = P : null),
|
|
1665
|
-
rules: [
|
|
1665
|
+
rules: [s(Wt)(new Date(n.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
1666
1666
|
}, null, 8, ["modelValue", "rules"])) : N("", !0),
|
|
1667
|
-
V.value && !n.lastClosingDate ? (
|
|
1667
|
+
V.value && !n.lastClosingDate ? (S(), F("div", Mo, [
|
|
1668
1668
|
b(ue, {
|
|
1669
1669
|
name: "error",
|
|
1670
1670
|
size: "sm",
|
|
1671
1671
|
class: "text-fm-color-typo-warning"
|
|
1672
1672
|
}),
|
|
1673
|
-
a("span",
|
|
1673
|
+
a("span", Uo, q(s(m)("inventory.transfer.form.backdate.error")), 1)
|
|
1674
1674
|
])) : N("", !0)
|
|
1675
1675
|
])) : N("", !0)
|
|
1676
1676
|
])
|
|
1677
1677
|
]),
|
|
1678
|
-
a("div",
|
|
1679
|
-
b(
|
|
1680
|
-
"model-value":
|
|
1681
|
-
rules: [
|
|
1678
|
+
a("div", Oo, [
|
|
1679
|
+
b(se, {
|
|
1680
|
+
"model-value": s(t).items,
|
|
1681
|
+
rules: [s(ze)(1)]
|
|
1682
1682
|
}, null, 8, ["model-value", "rules"]),
|
|
1683
1683
|
a("div", {
|
|
1684
|
-
class:
|
|
1684
|
+
class: X([
|
|
1685
1685
|
"flex gap-16",
|
|
1686
1686
|
{
|
|
1687
1687
|
"flex-col items-start": y.value,
|
|
@@ -1689,90 +1689,90 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1689
1689
|
}
|
|
1690
1690
|
])
|
|
1691
1691
|
}, [
|
|
1692
|
-
a("div",
|
|
1693
|
-
a("div",
|
|
1692
|
+
a("div", No, q(s(m)("inventory.transfer.form.items.title")), 1),
|
|
1693
|
+
a("div", Bo, [
|
|
1694
1694
|
b(te, {
|
|
1695
1695
|
disabled: n.disabled,
|
|
1696
|
-
label:
|
|
1696
|
+
label: s(m)("inventory.transfer.form.items.addItem"),
|
|
1697
1697
|
"prepend-icon": "add",
|
|
1698
1698
|
variant: "secondary",
|
|
1699
1699
|
"text-color": "primary",
|
|
1700
1700
|
"bg-color": "transparent",
|
|
1701
1701
|
"border-color": "primary",
|
|
1702
|
-
onClick: w[9] || (w[9] = (P) =>
|
|
1702
|
+
onClick: w[9] || (w[9] = (P) => Ee()),
|
|
1703
1703
|
size: "md"
|
|
1704
1704
|
}, null, 8, ["disabled", "label"]),
|
|
1705
|
-
|
|
1705
|
+
s(t).templateDoc ? (S(), Q(_e, {
|
|
1706
1706
|
key: 0,
|
|
1707
1707
|
"z-index": 50
|
|
1708
1708
|
}, {
|
|
1709
1709
|
content: R(() => [
|
|
1710
|
-
a("div", null, q(
|
|
1710
|
+
a("div", null, q(s(m)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
|
|
1711
1711
|
]),
|
|
1712
1712
|
default: R(() => [
|
|
1713
1713
|
b(bt, {
|
|
1714
|
-
"onUpdate:poItems": w[10] || (w[10] = (P) =>
|
|
1714
|
+
"onUpdate:poItems": w[10] || (w[10] = (P) => s(t).items = P),
|
|
1715
1715
|
disabled: ""
|
|
1716
1716
|
})
|
|
1717
1717
|
]),
|
|
1718
1718
|
_: 1
|
|
1719
|
-
})) : (
|
|
1719
|
+
})) : (S(), Q(bt, {
|
|
1720
1720
|
key: 1,
|
|
1721
|
-
"onUpdate:poItems": w[11] || (w[11] = (P) =>
|
|
1722
|
-
disabled: n.disabled || !!
|
|
1721
|
+
"onUpdate:poItems": w[11] || (w[11] = (P) => s(t).items = P),
|
|
1722
|
+
disabled: n.disabled || !!s(t).templateDoc
|
|
1723
1723
|
}, null, 8, ["disabled"]))
|
|
1724
1724
|
])
|
|
1725
1725
|
], 2),
|
|
1726
|
-
T.value ===
|
|
1726
|
+
T.value === s(oe).PURCHASE && p.value && s(e).enableTotalCost && ((rt = n.modelValue) != null && rt.items.length) ? (S(), F("div", zo, [
|
|
1727
1727
|
b(Ve, {
|
|
1728
|
-
label:
|
|
1728
|
+
label: s(M) ? s(m)("inventory.transfer.form.items.fetchingData") : s(m)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1729
1729
|
"prepend-icon": "compare_arrows",
|
|
1730
1730
|
"label-placement": "right",
|
|
1731
|
-
"model-value":
|
|
1731
|
+
"model-value": s(g),
|
|
1732
1732
|
"onUpdate:modelValue": w[12] || (w[12] = (P) => Ce(g) ? g.value = P : null),
|
|
1733
|
-
disabled:
|
|
1733
|
+
disabled: s(M) || n.disabled
|
|
1734
1734
|
}, null, 8, ["label", "model-value", "disabled"])
|
|
1735
1735
|
])) : N("", !0),
|
|
1736
|
-
b(
|
|
1736
|
+
b(se, {
|
|
1737
1737
|
"model-value": ke.value,
|
|
1738
1738
|
rules: [() => ke.value ? "Must have at least one non-zero item" : !0]
|
|
1739
1739
|
}, null, 8, ["model-value", "rules"]),
|
|
1740
|
-
(
|
|
1741
|
-
"column-defs":
|
|
1740
|
+
(S(), Q(re, {
|
|
1741
|
+
"column-defs": Ae.value,
|
|
1742
1742
|
"column-visibility": {
|
|
1743
|
-
[
|
|
1744
|
-
[
|
|
1745
|
-
[
|
|
1743
|
+
[s(K).Code]: !(((it = n.modelValue) == null ? void 0 : it.template) ?? ((ut = n.modelValue) == null ? void 0 : ut.templateDoc)),
|
|
1744
|
+
[s(K).Name]: !(((mt = n.modelValue) == null ? void 0 : mt.template) ?? ((dt = n.modelValue) == null ? void 0 : dt.templateDoc)),
|
|
1745
|
+
[s(K).TemplateName]: !!(((ct = n.modelValue) == null ? void 0 : ct.template) ?? ((pt = n.modelValue) == null ? void 0 : pt.templateDoc))
|
|
1746
1746
|
},
|
|
1747
|
-
"row-data":
|
|
1748
|
-
key:
|
|
1747
|
+
"row-data": s(t).items,
|
|
1748
|
+
key: s(t).items.map((P) => P.sku._id).join("."),
|
|
1749
1749
|
"hide-footer": "",
|
|
1750
|
-
"page-size":
|
|
1750
|
+
"page-size": s(t).items.length
|
|
1751
1751
|
}, {
|
|
1752
1752
|
"table-row": R((P) => {
|
|
1753
1753
|
var W, he, Ne, ft;
|
|
1754
1754
|
return [
|
|
1755
|
-
b(
|
|
1756
|
-
"compare-price-by-sku":
|
|
1757
|
-
"show-compare-price": T.value ===
|
|
1755
|
+
b(bo, {
|
|
1756
|
+
"compare-price-by-sku": s(J),
|
|
1757
|
+
"show-compare-price": T.value === s(oe).PURCHASE && s(g),
|
|
1758
1758
|
row: P,
|
|
1759
1759
|
"template-item": (ft = (Ne = (he = (W = n.modelValue) == null ? void 0 : W.templateDoc) == null ? void 0 : he.purchaseOrder) == null ? void 0 : Ne.items) == null ? void 0 : ft.find(
|
|
1760
|
-
(
|
|
1760
|
+
(Ye) => Ye.sku._id === P.original.sku._id
|
|
1761
1761
|
),
|
|
1762
|
-
"onUpdate:item": w[13] || (w[13] = (
|
|
1762
|
+
"onUpdate:item": w[13] || (w[13] = (Ye) => Fe.value.updateItem(Ye)),
|
|
1763
1763
|
disabled: n.disabled
|
|
1764
1764
|
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "template-item", "disabled"])
|
|
1765
1765
|
];
|
|
1766
1766
|
}),
|
|
1767
1767
|
"list-row": R((P) => [
|
|
1768
|
-
(
|
|
1768
|
+
(S(), Q(Ct, {
|
|
1769
1769
|
row: P,
|
|
1770
|
-
key:
|
|
1770
|
+
key: s(t).items.map((W) => W.sku._id).join(".")
|
|
1771
1771
|
}, {
|
|
1772
1772
|
default: R((W) => [
|
|
1773
|
-
b(
|
|
1774
|
-
"compare-price-by-sku":
|
|
1775
|
-
"show-compare-price": T.value ===
|
|
1773
|
+
b(Ns, {
|
|
1774
|
+
"compare-price-by-sku": s(J),
|
|
1775
|
+
"show-compare-price": T.value === s(oe).PURCHASE && s(g),
|
|
1776
1776
|
row: P,
|
|
1777
1777
|
"cell-by-col-id": W
|
|
1778
1778
|
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
|
|
@@ -1791,45 +1791,45 @@ const as = { class: "hover:bg-fm-color-opacity-sm" }, ls = { class: "flex items-
|
|
|
1791
1791
|
};
|
|
1792
1792
|
}
|
|
1793
1793
|
});
|
|
1794
|
-
function
|
|
1795
|
-
|
|
1796
|
-
const
|
|
1797
|
-
for (const
|
|
1798
|
-
const u =
|
|
1794
|
+
function Ho(f, x) {
|
|
1795
|
+
x ?? (x = `Return to ${f.supplier.name}`);
|
|
1796
|
+
const l = je().currentLocation, C = bs(l), t = {};
|
|
1797
|
+
for (const d of f.items) {
|
|
1798
|
+
const u = d.sku._id;
|
|
1799
1799
|
t[u] = we.reset();
|
|
1800
1800
|
}
|
|
1801
|
-
const
|
|
1802
|
-
for (const
|
|
1803
|
-
const u =
|
|
1801
|
+
const m = f.deliveryOrder.flatMap((d) => d.received);
|
|
1802
|
+
for (const d of m) {
|
|
1803
|
+
const u = d.sku._id;
|
|
1804
1804
|
if (!t[u]) continue;
|
|
1805
|
-
const
|
|
1806
|
-
t[u] = we.add([t[u],
|
|
1805
|
+
const h = d.measurement ? we.multiply([d.measurement.conversion, d.amount]) : d.amount;
|
|
1806
|
+
t[u] = we.add([t[u], h]);
|
|
1807
1807
|
}
|
|
1808
1808
|
return {
|
|
1809
|
-
_id:
|
|
1810
|
-
name:
|
|
1809
|
+
_id: f._id,
|
|
1810
|
+
name: x,
|
|
1811
1811
|
purchaseOrder: {
|
|
1812
1812
|
supplier: C,
|
|
1813
|
-
ref:
|
|
1814
|
-
remark:
|
|
1815
|
-
items:
|
|
1816
|
-
const u =
|
|
1813
|
+
ref: f.ref,
|
|
1814
|
+
remark: f.remark,
|
|
1815
|
+
items: f.items.map((d) => {
|
|
1816
|
+
const u = d.measurement ? we.divide([t[d.sku._id], d.measurement.conversion]) : t[d.sku._id];
|
|
1817
1817
|
return {
|
|
1818
|
-
sku:
|
|
1819
|
-
code:
|
|
1820
|
-
name:
|
|
1818
|
+
sku: d.sku,
|
|
1819
|
+
code: d.code,
|
|
1820
|
+
name: d.name,
|
|
1821
1821
|
quantityStep: {
|
|
1822
1822
|
amount: 1,
|
|
1823
|
-
precision:
|
|
1823
|
+
precision: st(d.sku.unit, d.measurement)
|
|
1824
1824
|
},
|
|
1825
1825
|
quantity: u,
|
|
1826
1826
|
maximumQuantity: u
|
|
1827
1827
|
};
|
|
1828
|
-
}).filter((
|
|
1828
|
+
}).filter((d) => d.maximumQuantity.amount > 0)
|
|
1829
1829
|
}
|
|
1830
1830
|
};
|
|
1831
1831
|
}
|
|
1832
|
-
const
|
|
1832
|
+
const jo = { class: "flex items-center" }, Qo = { class: "fm-typo-en-title-md-800" }, Yo = { class: "flex gap-4" }, Ko = /* @__PURE__ */ ae({
|
|
1833
1833
|
__name: "TransferDialog",
|
|
1834
1834
|
props: {
|
|
1835
1835
|
mode: {},
|
|
@@ -1841,26 +1841,26 @@ const js = { class: "flex items-center" }, Ys = { class: "fm-typo-en-title-md-80
|
|
|
1841
1841
|
lastClosingDate: {}
|
|
1842
1842
|
},
|
|
1843
1843
|
emits: ["update:show", "submitted"],
|
|
1844
|
-
setup(
|
|
1844
|
+
setup(f, { expose: x, emit: r }) {
|
|
1845
1845
|
var G;
|
|
1846
|
-
const
|
|
1847
|
-
async function k(
|
|
1848
|
-
if (
|
|
1849
|
-
|
|
1846
|
+
const l = f, C = r, t = ot(), m = $t(), d = De(), u = lt(), h = je(), { t: o } = fe(), e = A(!1), i = A(!1), c = A(!1), y = Rt();
|
|
1847
|
+
async function k(_) {
|
|
1848
|
+
if (_) {
|
|
1849
|
+
i.value = !1;
|
|
1850
1850
|
try {
|
|
1851
|
-
await u.readSuppliers(),
|
|
1851
|
+
await u.readSuppliers(), i.value = !0;
|
|
1852
1852
|
} catch {
|
|
1853
|
-
|
|
1854
|
-
title:
|
|
1855
|
-
message:
|
|
1853
|
+
d.open({
|
|
1854
|
+
title: o("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
|
|
1855
|
+
message: o("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
|
|
1856
1856
|
type: "error"
|
|
1857
1857
|
});
|
|
1858
1858
|
}
|
|
1859
1859
|
}
|
|
1860
1860
|
}
|
|
1861
|
-
|
|
1861
|
+
h.watchLocation(k);
|
|
1862
1862
|
function I() {
|
|
1863
|
-
const
|
|
1863
|
+
const _ = {
|
|
1864
1864
|
remark: void 0,
|
|
1865
1865
|
ref: void 0,
|
|
1866
1866
|
stockSnapshotId: void 0,
|
|
@@ -1889,63 +1889,63 @@ const js = { class: "flex items-center" }, Ys = { class: "fm-typo-en-title-md-80
|
|
|
1889
1889
|
_id: "",
|
|
1890
1890
|
seqNumber: 0,
|
|
1891
1891
|
deliveryOrder: [],
|
|
1892
|
-
template:
|
|
1893
|
-
templateDoc:
|
|
1892
|
+
template: l.templateId,
|
|
1893
|
+
templateDoc: m.templates.find((g) => g._id === l.templateId)
|
|
1894
1894
|
};
|
|
1895
|
-
if (
|
|
1896
|
-
const g =
|
|
1897
|
-
|
|
1895
|
+
if (l.returnFrom) {
|
|
1896
|
+
const g = Ho(l.returnFrom);
|
|
1897
|
+
_.templateDoc = g, _.template = g._id, _.supplier = g.purchaseOrder.supplier ?? _.supplier, _.items = g.purchaseOrder.items ?? [], _.isReturnPo = !0;
|
|
1898
1898
|
}
|
|
1899
|
-
return
|
|
1899
|
+
return _;
|
|
1900
1900
|
}
|
|
1901
|
-
const
|
|
1901
|
+
const v = Ft(l, "show"), p = A(l.modelValue ?? I()), V = A(((G = l.modelValue) == null ? void 0 : G._id) ?? `${Math.random()}`);
|
|
1902
1902
|
be(
|
|
1903
|
-
() =>
|
|
1904
|
-
(
|
|
1903
|
+
() => l.show,
|
|
1904
|
+
(_) => {
|
|
1905
1905
|
var g;
|
|
1906
|
-
|
|
1906
|
+
_ && (c.value = !1, p.value = l.modelValue ?? I(), V.value = ((g = l.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
|
|
1907
1907
|
}
|
|
1908
1908
|
);
|
|
1909
|
-
const L = O(() => !
|
|
1910
|
-
if (
|
|
1909
|
+
const L = O(() => !i.value || !c.value), $ = O(() => {
|
|
1910
|
+
if (l.returnFrom)
|
|
1911
1911
|
return "Return transfer";
|
|
1912
|
-
switch (
|
|
1912
|
+
switch (l.mode) {
|
|
1913
1913
|
case Re.READ:
|
|
1914
1914
|
return "View transfer";
|
|
1915
1915
|
case Re.CREATE:
|
|
1916
|
-
return
|
|
1916
|
+
return o("inventory.transfer.receiveRequest.create.title");
|
|
1917
1917
|
case Re.UPDATE:
|
|
1918
|
-
return
|
|
1918
|
+
return o("inventory.transfer.receiveRequest.update.title");
|
|
1919
1919
|
}
|
|
1920
1920
|
return "";
|
|
1921
|
-
}), T =
|
|
1922
|
-
|
|
1921
|
+
}), T = A();
|
|
1922
|
+
x({
|
|
1923
1923
|
validateInputs: () => {
|
|
1924
|
-
var
|
|
1925
|
-
(g = (
|
|
1924
|
+
var _, g;
|
|
1925
|
+
(g = (_ = T.value) == null ? void 0 : _.validateInputs) == null || g.call(_);
|
|
1926
1926
|
},
|
|
1927
1927
|
resetInputsValidation: () => {
|
|
1928
|
-
var
|
|
1929
|
-
(g = (
|
|
1928
|
+
var _, g;
|
|
1929
|
+
(g = (_ = T.value) == null ? void 0 : _.resetInputsValidation) == null || g.call(_);
|
|
1930
1930
|
},
|
|
1931
1931
|
resetInputs: () => {
|
|
1932
|
-
var
|
|
1933
|
-
(g = (
|
|
1932
|
+
var _, g;
|
|
1933
|
+
(g = (_ = T.value) == null ? void 0 : _.resetInputs) == null || g.call(_);
|
|
1934
1934
|
}
|
|
1935
1935
|
});
|
|
1936
|
-
async function
|
|
1936
|
+
async function Y() {
|
|
1937
1937
|
var g;
|
|
1938
1938
|
if (!(!await y.confirmation(
|
|
1939
1939
|
"Submit return stock request?",
|
|
1940
1940
|
"Stock will be deducted upon confirmation."
|
|
1941
|
-
) || !
|
|
1941
|
+
) || !p.value || !l.returnFrom)) {
|
|
1942
1942
|
e.value = !0;
|
|
1943
1943
|
try {
|
|
1944
|
-
await ((g =
|
|
1944
|
+
await ((g = l["onSubmit:returnStock"]) == null ? void 0 : g.call(l, p.value, l.returnFrom));
|
|
1945
1945
|
} catch (M) {
|
|
1946
|
-
|
|
1947
|
-
title:
|
|
1948
|
-
message:
|
|
1946
|
+
d.open({
|
|
1947
|
+
title: o("inventory.transfer.receiveRequest.create.error.title"),
|
|
1948
|
+
message: o("inventory.transfer.receiveRequest.create.error.message"),
|
|
1949
1949
|
type: "error"
|
|
1950
1950
|
}), console.error("Error in creating purchase order", M);
|
|
1951
1951
|
} finally {
|
|
@@ -1954,11 +1954,11 @@ const js = { class: "flex items-center" }, Ys = { class: "fm-typo-en-title-md-80
|
|
|
1954
1954
|
}
|
|
1955
1955
|
}
|
|
1956
1956
|
async function z() {
|
|
1957
|
-
const
|
|
1958
|
-
if (e.value = !0,
|
|
1957
|
+
const _ = p.value;
|
|
1958
|
+
if (e.value = !0, _.items.some((g) => {
|
|
1959
1959
|
var M;
|
|
1960
1960
|
return (M = g.subItems) == null ? void 0 : M.length;
|
|
1961
|
-
}) && (
|
|
1961
|
+
}) && (_.items = _.items.map((g) => {
|
|
1962
1962
|
var J;
|
|
1963
1963
|
if (!((J = g.subItems) != null && J.length)) return g;
|
|
1964
1964
|
const M = Ge(g.subItems);
|
|
@@ -1969,37 +1969,37 @@ const js = { class: "flex items-center" }, Ys = { class: "fm-typo-en-title-md-80
|
|
|
1969
1969
|
measurement: null,
|
|
1970
1970
|
totalCost: ye(g.sku, M)
|
|
1971
1971
|
};
|
|
1972
|
-
})),
|
|
1973
|
-
|
|
1972
|
+
})), _.items = _.items.filter((g) => g.quantity.amount > 0), !_.items.length) {
|
|
1973
|
+
d.open({
|
|
1974
1974
|
title: "Cannot create order",
|
|
1975
1975
|
message: "There are no items with non-zero amount in your request.",
|
|
1976
1976
|
type: "error"
|
|
1977
1977
|
});
|
|
1978
1978
|
return;
|
|
1979
1979
|
}
|
|
1980
|
-
(
|
|
1980
|
+
(_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: g, ...M }) => M));
|
|
1981
1981
|
try {
|
|
1982
|
-
await t.createPurchaseOrder(
|
|
1983
|
-
title:
|
|
1984
|
-
message:
|
|
1982
|
+
await t.createPurchaseOrder(_), await new Promise((g) => setTimeout(g, 1e3)), d.open({
|
|
1983
|
+
title: o("inventory.transfer.receiveRequest.create.success"),
|
|
1984
|
+
message: o("inventory.transfer.receiveRequest.create.successMessage"),
|
|
1985
1985
|
type: "success"
|
|
1986
1986
|
}), C("update:show", !1), C("submitted");
|
|
1987
1987
|
} catch (g) {
|
|
1988
|
-
|
|
1989
|
-
title:
|
|
1990
|
-
message:
|
|
1988
|
+
d.open({
|
|
1989
|
+
title: o("inventory.transfer.receiveRequest.create.error.title"),
|
|
1990
|
+
message: o("inventory.transfer.receiveRequest.create.error.message"),
|
|
1991
1991
|
type: "error"
|
|
1992
1992
|
}), console.error("Error in creating purchase order", g);
|
|
1993
1993
|
} finally {
|
|
1994
1994
|
e.value = !1;
|
|
1995
1995
|
}
|
|
1996
1996
|
}
|
|
1997
|
-
async function
|
|
1998
|
-
const
|
|
1999
|
-
if (e.value = !0,
|
|
1997
|
+
async function E() {
|
|
1998
|
+
const _ = p.value;
|
|
1999
|
+
if (e.value = !0, _.items.some((g) => {
|
|
2000
2000
|
var M;
|
|
2001
2001
|
return (M = g.subItems) == null ? void 0 : M.length;
|
|
2002
|
-
}) && (
|
|
2002
|
+
}) && (_.items = _.items.map((g) => {
|
|
2003
2003
|
var J;
|
|
2004
2004
|
if (!((J = g.subItems) != null && J.length)) return g;
|
|
2005
2005
|
const M = Ge(g.subItems);
|
|
@@ -2010,25 +2010,25 @@ const js = { class: "flex items-center" }, Ys = { class: "fm-typo-en-title-md-80
|
|
|
2010
2010
|
measurement: null,
|
|
2011
2011
|
totalCost: ye(g.sku, M)
|
|
2012
2012
|
};
|
|
2013
|
-
})),
|
|
2014
|
-
|
|
2013
|
+
})), _.items = _.items.filter((g) => g.quantity.amount > 0), !_.items.length) {
|
|
2014
|
+
d.open({
|
|
2015
2015
|
title: "Cannot create order",
|
|
2016
2016
|
message: "There are no items with non-zero amount in your request.",
|
|
2017
2017
|
type: "error"
|
|
2018
2018
|
});
|
|
2019
2019
|
return;
|
|
2020
2020
|
}
|
|
2021
|
-
(
|
|
2021
|
+
(_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: g, ...M }) => M));
|
|
2022
2022
|
try {
|
|
2023
|
-
await t.updatePurchaseOrder(
|
|
2024
|
-
title:
|
|
2025
|
-
message:
|
|
2023
|
+
await t.updatePurchaseOrder(_), await new Promise((g) => setTimeout(g, 1e3)), d.open({
|
|
2024
|
+
title: o("inventory.transfer.receiveRequest.update.success"),
|
|
2025
|
+
message: o("inventory.transfer.receiveRequest.update.successMessage"),
|
|
2026
2026
|
type: "success"
|
|
2027
2027
|
}), C("update:show", !1), C("submitted");
|
|
2028
2028
|
} catch (g) {
|
|
2029
|
-
|
|
2030
|
-
title:
|
|
2031
|
-
message:
|
|
2029
|
+
d.open({
|
|
2030
|
+
title: o("inventory.transfer.receiveRequest.update.error.title"),
|
|
2031
|
+
message: o("inventory.transfer.receiveRequest.update.error.message"),
|
|
2032
2032
|
type: "error"
|
|
2033
2033
|
}), console.error("Error in updating purchase order", g);
|
|
2034
2034
|
} finally {
|
|
@@ -2036,58 +2036,58 @@ const js = { class: "flex items-center" }, Ys = { class: "fm-typo-en-title-md-80
|
|
|
2036
2036
|
}
|
|
2037
2037
|
}
|
|
2038
2038
|
function j() {
|
|
2039
|
-
switch (
|
|
2039
|
+
switch (l.mode) {
|
|
2040
2040
|
case Re.CREATE:
|
|
2041
|
-
return
|
|
2041
|
+
return l.returnFrom ? Y() : z();
|
|
2042
2042
|
case Re.UPDATE:
|
|
2043
|
-
return
|
|
2043
|
+
return E();
|
|
2044
2044
|
}
|
|
2045
2045
|
}
|
|
2046
2046
|
function B() {
|
|
2047
|
-
var
|
|
2048
|
-
(g = (
|
|
2047
|
+
var _, g;
|
|
2048
|
+
(g = (_ = T.value) == null ? void 0 : _.validateInputs) == null || g.call(_);
|
|
2049
2049
|
}
|
|
2050
|
-
return (
|
|
2050
|
+
return (_, g) => {
|
|
2051
2051
|
const M = D("FmButton"), J = D("FmSideSheet");
|
|
2052
|
-
return
|
|
2053
|
-
modelValue:
|
|
2054
|
-
"onUpdate:modelValue": g[3] || (g[3] = (le) => Ce(
|
|
2052
|
+
return S(), Q(J, {
|
|
2053
|
+
modelValue: s(v),
|
|
2054
|
+
"onUpdate:modelValue": g[3] || (g[3] = (le) => Ce(v) ? v.value = le : null),
|
|
2055
2055
|
"dismiss-away": "",
|
|
2056
2056
|
"close-button": "",
|
|
2057
2057
|
"max-width": 900
|
|
2058
2058
|
}, {
|
|
2059
2059
|
"side-sheet-header": R(() => [
|
|
2060
|
-
a("div",
|
|
2061
|
-
a("div",
|
|
2060
|
+
a("div", jo, [
|
|
2061
|
+
a("div", Qo, q($.value), 1)
|
|
2062
2062
|
])
|
|
2063
2063
|
]),
|
|
2064
2064
|
default: R(() => [
|
|
2065
|
-
(
|
|
2065
|
+
(S(), Q(Lo, {
|
|
2066
2066
|
class: "w-full",
|
|
2067
2067
|
ref_key: "formRef",
|
|
2068
2068
|
ref: T,
|
|
2069
|
-
"onForm:ready": g[0] || (g[0] = () =>
|
|
2069
|
+
"onForm:ready": g[0] || (g[0] = () => c.value = !0),
|
|
2070
2070
|
onValidationSuccess: j,
|
|
2071
|
-
modelValue:
|
|
2072
|
-
"onUpdate:modelValue": g[1] || (g[1] = (le) =>
|
|
2071
|
+
modelValue: p.value,
|
|
2072
|
+
"onUpdate:modelValue": g[1] || (g[1] = (le) => p.value = le),
|
|
2073
2073
|
disabled: e.value || L.value,
|
|
2074
|
-
"return-from":
|
|
2074
|
+
"return-from": _.returnFrom,
|
|
2075
2075
|
key: V.value,
|
|
2076
|
-
"last-closing-date":
|
|
2076
|
+
"last-closing-date": _.lastClosingDate
|
|
2077
2077
|
}, null, 8, ["modelValue", "disabled", "return-from", "last-closing-date"]))
|
|
2078
2078
|
]),
|
|
2079
2079
|
"side-sheet-footer": R(() => [
|
|
2080
|
-
a("div",
|
|
2080
|
+
a("div", Yo, [
|
|
2081
2081
|
b(M, {
|
|
2082
2082
|
loading: e.value,
|
|
2083
2083
|
disabled: L.value,
|
|
2084
|
-
label: o
|
|
2084
|
+
label: s(o)("common.save"),
|
|
2085
2085
|
onClick: B
|
|
2086
2086
|
}, null, 8, ["loading", "disabled", "label"]),
|
|
2087
2087
|
b(M, {
|
|
2088
2088
|
disabled: L.value,
|
|
2089
2089
|
variant: "tertiary",
|
|
2090
|
-
label: o
|
|
2090
|
+
label: s(o)("common.close"),
|
|
2091
2091
|
onClick: g[2] || (g[2] = (le) => C("update:show", !1))
|
|
2092
2092
|
}, null, 8, ["disabled", "label"])
|
|
2093
2093
|
])
|
|
@@ -2097,62 +2097,52 @@ const js = { class: "flex items-center" }, Ys = { class: "fm-typo-en-title-md-80
|
|
|
2097
2097
|
};
|
|
2098
2098
|
}
|
|
2099
2099
|
});
|
|
2100
|
-
function
|
|
2101
|
-
const [
|
|
2102
|
-
if (
|
|
2100
|
+
function Xo(f) {
|
|
2101
|
+
const [x, ...r] = es(f), l = x.map((d) => d.toLowerCase().trim().replace(/ /g, "_")), t = ["item_code", "quantity"].filter((d) => !l.includes(d));
|
|
2102
|
+
if (t.length)
|
|
2103
2103
|
throw new Error(
|
|
2104
|
-
`Missing headers (${
|
|
2104
|
+
`Missing headers (${t.join()}). Excel file does not come from the template.`
|
|
2105
2105
|
);
|
|
2106
|
-
return
|
|
2107
|
-
const
|
|
2108
|
-
for (const
|
|
2109
|
-
const
|
|
2110
|
-
Object.assign(
|
|
2106
|
+
return r.map((d, u) => {
|
|
2107
|
+
const h = {};
|
|
2108
|
+
for (const o in l) {
|
|
2109
|
+
const e = l[o];
|
|
2110
|
+
Object.assign(h, { [e]: d[o] });
|
|
2111
2111
|
}
|
|
2112
2112
|
return {
|
|
2113
|
-
index:
|
|
2114
|
-
data:
|
|
2113
|
+
index: u,
|
|
2114
|
+
data: h
|
|
2115
2115
|
};
|
|
2116
2116
|
});
|
|
2117
2117
|
}
|
|
2118
|
-
function
|
|
2119
|
-
const
|
|
2118
|
+
function Zo(f) {
|
|
2119
|
+
const x = f.SheetNames;
|
|
2120
2120
|
try {
|
|
2121
|
-
return
|
|
2122
|
-
(
|
|
2123
|
-
const t = new Array(),
|
|
2124
|
-
for (const { index: e, data:
|
|
2125
|
-
|
|
2126
|
-
const
|
|
2127
|
-
if (!
|
|
2121
|
+
return x.reduce(
|
|
2122
|
+
(l, C) => {
|
|
2123
|
+
const t = new Array(), m = f.Sheets[C], d = et(), u = Xo(m), h = [];
|
|
2124
|
+
for (const { index: e, data: i } of u) {
|
|
2125
|
+
i.item_code === "" && t.push(`Row ${e + 1}: Item code is empty`), i.quantity === "" && t.push(`Row ${e + 1}: Quantity is empty`);
|
|
2126
|
+
const c = d.skus.find((k) => k.code === i.item_code);
|
|
2127
|
+
if (!c) {
|
|
2128
2128
|
t.push(`Row ${e + 1}: SKU not found`);
|
|
2129
2129
|
continue;
|
|
2130
2130
|
}
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
continue;
|
|
2138
|
-
}
|
|
2139
|
-
k = I;
|
|
2140
|
-
}
|
|
2141
|
-
_.push({
|
|
2142
|
-
sku: m,
|
|
2143
|
-
code: l.scanned_code,
|
|
2144
|
-
name: l.item_name,
|
|
2145
|
-
quantity: we.fromNumber(Number(l["transfer_quantity(uom)"])),
|
|
2146
|
-
measurement: k
|
|
2131
|
+
h.push({
|
|
2132
|
+
sku: c,
|
|
2133
|
+
code: i.item_code,
|
|
2134
|
+
name: c.name,
|
|
2135
|
+
quantity: we.fromNumber(Number(i.quantity)),
|
|
2136
|
+
measurement: null
|
|
2147
2137
|
});
|
|
2148
2138
|
}
|
|
2149
|
-
const
|
|
2139
|
+
const o = {
|
|
2150
2140
|
type: "create",
|
|
2151
|
-
poItems:
|
|
2141
|
+
poItems: h,
|
|
2152
2142
|
excelSheetName: C,
|
|
2153
2143
|
errors: t
|
|
2154
2144
|
};
|
|
2155
|
-
return
|
|
2145
|
+
return l.importCreateResult.push(o), l;
|
|
2156
2146
|
},
|
|
2157
2147
|
{
|
|
2158
2148
|
invalidExcel: !1,
|
|
@@ -2167,11 +2157,11 @@ function Xs(p) {
|
|
|
2167
2157
|
};
|
|
2168
2158
|
}
|
|
2169
2159
|
}
|
|
2170
|
-
const
|
|
2160
|
+
const Go = exports.FfCalculator, Jo = { class: "flex flex-col flex-1" }, Wo = { class: "flex flex-col" }, en = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, tn = {
|
|
2171
2161
|
key: 0,
|
|
2172
2162
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
2173
|
-
},
|
|
2174
|
-
class: /* @__PURE__ */
|
|
2163
|
+
}, sn = { key: 0 }, on = {
|
|
2164
|
+
class: /* @__PURE__ */ X(["fm-typo-en-body-lg-600"])
|
|
2175
2165
|
}, nn = { class: "flex-1" }, an = { class: "flex-auto line-clamp-2 text-ellipsis break-all fm-typo-en-body-sm-400" }, ln = { class: "flex-auto line-clamp-2 text-ellipsis break-all" }, rn = { class: "text-fm-color-typo-primary" }, un = { class: "ml-auto" }, mn = { key: 0 }, dn = /* @__PURE__ */ ae({
|
|
2176
2166
|
__name: "XilnexResult",
|
|
2177
2167
|
props: {
|
|
@@ -2180,93 +2170,93 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2180
2170
|
items: {},
|
|
2181
2171
|
errors: {}
|
|
2182
2172
|
},
|
|
2183
|
-
setup(
|
|
2184
|
-
const
|
|
2185
|
-
|
|
2173
|
+
setup(f) {
|
|
2174
|
+
const x = f, { t: r } = fe(), l = A(!1), C = () => {
|
|
2175
|
+
x.errors.length && (l.value = !l.value);
|
|
2186
2176
|
};
|
|
2187
|
-
return (t,
|
|
2188
|
-
var
|
|
2189
|
-
const
|
|
2190
|
-
return
|
|
2177
|
+
return (t, m) => {
|
|
2178
|
+
var h;
|
|
2179
|
+
const d = D("FmIcon"), u = D("FmTooltip");
|
|
2180
|
+
return S(), F("div", Jo, [
|
|
2191
2181
|
a("div", {
|
|
2192
2182
|
onClick: C,
|
|
2193
|
-
class:
|
|
2183
|
+
class: X({
|
|
2194
2184
|
"cursor-pointer": t.errors.length
|
|
2195
2185
|
})
|
|
2196
2186
|
}, [
|
|
2197
|
-
a("div",
|
|
2187
|
+
a("div", Wo, [
|
|
2198
2188
|
a("div", en, [
|
|
2199
2189
|
a("div", {
|
|
2200
|
-
class:
|
|
2190
|
+
class: X({
|
|
2201
2191
|
"text-fm-color-system-error-300": t.errors.length
|
|
2202
2192
|
})
|
|
2203
2193
|
}, [
|
|
2204
2194
|
Ie(q(t.name) + " ", 1),
|
|
2205
|
-
t.type === "create" ? (
|
|
2195
|
+
t.type === "create" ? (S(), F("span", tn, "(" + q(s(r)("inventory.closing.template.import.new")) + ")", 1)) : N("", !0)
|
|
2206
2196
|
], 2),
|
|
2207
|
-
t.errors.length ? (
|
|
2208
|
-
b(
|
|
2197
|
+
t.errors.length ? (S(), F("div", sn, [
|
|
2198
|
+
b(d, {
|
|
2209
2199
|
name: "error",
|
|
2210
2200
|
size: "sm",
|
|
2211
2201
|
color: "system-error-300"
|
|
2212
2202
|
})
|
|
2213
2203
|
])) : N("", !0)
|
|
2214
2204
|
]),
|
|
2215
|
-
|
|
2216
|
-
a("div",
|
|
2217
|
-
(
|
|
2205
|
+
m[0] || (m[0] = a("hr", { class: "my-2" }, null, -1)),
|
|
2206
|
+
a("div", on, [
|
|
2207
|
+
(h = t.items) != null && h.length ? (S(!0), F(ne, { key: 0 }, ge(t.items, (o, e) => (S(), F("div", {
|
|
2218
2208
|
key: e,
|
|
2219
2209
|
class: "flex gap-4 mt-2 items-center"
|
|
2220
2210
|
}, [
|
|
2221
2211
|
a("div", nn, [
|
|
2222
2212
|
b(u, {
|
|
2223
|
-
content:
|
|
2213
|
+
content: o.code,
|
|
2224
2214
|
placement: "top",
|
|
2225
2215
|
"z-index": 51
|
|
2226
2216
|
}, {
|
|
2227
2217
|
default: R(() => [
|
|
2228
|
-
a("span", an, q(
|
|
2218
|
+
a("span", an, q(o.code), 1)
|
|
2229
2219
|
]),
|
|
2230
2220
|
_: 2
|
|
2231
2221
|
}, 1032, ["content"]),
|
|
2232
2222
|
b(u, {
|
|
2233
|
-
content:
|
|
2223
|
+
content: o.name,
|
|
2234
2224
|
placement: "top",
|
|
2235
2225
|
"z-index": 51
|
|
2236
2226
|
}, {
|
|
2237
2227
|
default: R(() => [
|
|
2238
|
-
a("span", ln, q(
|
|
2228
|
+
a("span", ln, q(o.name), 1)
|
|
2239
2229
|
]),
|
|
2240
2230
|
_: 2
|
|
2241
2231
|
}, 1032, ["content"])
|
|
2242
2232
|
]),
|
|
2243
2233
|
a("div", null, [
|
|
2244
|
-
a("span", rn, q(
|
|
2245
|
-
value:
|
|
2234
|
+
a("span", rn, q(s(Go).toFormatString({
|
|
2235
|
+
value: o.quantity
|
|
2246
2236
|
})), 1),
|
|
2247
|
-
Ie(" " + q(
|
|
2237
|
+
Ie(" " + q(o.measurement ? o.measurement.abbrev : o.sku.unit.abbrev), 1)
|
|
2248
2238
|
])
|
|
2249
2239
|
]))), 128)) : N("", !0)
|
|
2250
2240
|
])
|
|
2251
2241
|
]),
|
|
2252
2242
|
a("div", un, [
|
|
2253
|
-
t.errors.length ? (
|
|
2243
|
+
t.errors.length ? (S(), Q(d, {
|
|
2254
2244
|
key: 0,
|
|
2255
|
-
name:
|
|
2245
|
+
name: l.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
2256
2246
|
size: "md"
|
|
2257
2247
|
}, null, 8, ["name"])) : N("", !0)
|
|
2258
2248
|
])
|
|
2259
2249
|
], 2),
|
|
2260
|
-
|
|
2250
|
+
l.value ? (S(), F("div", {
|
|
2261
2251
|
key: 0,
|
|
2262
|
-
class:
|
|
2252
|
+
class: X(["flex flex-col gap-4 pl-8 fm-typo-en-body-sm-400", {
|
|
2263
2253
|
"text-fm-color-typo-secondary": !t.errors.length,
|
|
2264
2254
|
"text-fm-color-system-error-300": t.errors.length
|
|
2265
2255
|
}])
|
|
2266
2256
|
}, [
|
|
2267
|
-
t.errors.length ? (
|
|
2257
|
+
t.errors.length ? (S(), F("div", mn, [
|
|
2268
2258
|
a("ol", null, [
|
|
2269
|
-
(
|
|
2259
|
+
(S(!0), F(ne, null, ge(t.errors, (o, e) => (S(), F("li", { key: e }, q(o), 1))), 128))
|
|
2270
2260
|
])
|
|
2271
2261
|
])) : N("", !0)
|
|
2272
2262
|
], 2)) : N("", !0)
|
|
@@ -2287,10 +2277,10 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2287
2277
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
2288
2278
|
}, kn = { class: "fm-typo-en-body-lg-600" }, gt = "Transfer note", xn = /* @__PURE__ */ ae({
|
|
2289
2279
|
__name: "XilnexImportForm",
|
|
2290
|
-
setup(
|
|
2291
|
-
const r =
|
|
2292
|
-
|
|
2293
|
-
const
|
|
2280
|
+
setup(f, { expose: x }) {
|
|
2281
|
+
const r = A(null), l = De(), C = A(!1), t = A(!1), m = tt();
|
|
2282
|
+
A(!1), He();
|
|
2283
|
+
const d = A([
|
|
2294
2284
|
{
|
|
2295
2285
|
label: "LMSL389 MSU Medical Centre",
|
|
2296
2286
|
value: {
|
|
@@ -2304,17 +2294,24 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2304
2294
|
netsuiteId: "1463",
|
|
2305
2295
|
name: "LMSL540 Central I-City"
|
|
2306
2296
|
}
|
|
2297
|
+
},
|
|
2298
|
+
{
|
|
2299
|
+
label: "LMSL572 Giant Shah Alam Stadium",
|
|
2300
|
+
value: {
|
|
2301
|
+
netsuiteId: "1521",
|
|
2302
|
+
name: "LMSL572 Giant Shah Alam Stadium"
|
|
2303
|
+
}
|
|
2307
2304
|
}
|
|
2308
2305
|
]), u = O({
|
|
2309
2306
|
get() {
|
|
2310
|
-
var
|
|
2311
|
-
return ((
|
|
2307
|
+
var v;
|
|
2308
|
+
return ((v = m.supplier) == null ? void 0 : v.name) ?? "";
|
|
2312
2309
|
},
|
|
2313
|
-
set(
|
|
2314
|
-
|
|
2315
|
-
name:
|
|
2310
|
+
set(v) {
|
|
2311
|
+
v && (m.supplier = {
|
|
2312
|
+
name: v.name,
|
|
2316
2313
|
registrationNumber: "",
|
|
2317
|
-
_id:
|
|
2314
|
+
_id: v.netsuiteId,
|
|
2318
2315
|
internal: "restaurant",
|
|
2319
2316
|
address: {
|
|
2320
2317
|
line1: "",
|
|
@@ -2326,82 +2323,82 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2326
2323
|
}
|
|
2327
2324
|
});
|
|
2328
2325
|
}
|
|
2329
|
-
}),
|
|
2326
|
+
}), h = O({
|
|
2330
2327
|
get() {
|
|
2331
2328
|
return "";
|
|
2332
2329
|
},
|
|
2333
|
-
set(
|
|
2334
|
-
if (
|
|
2335
|
-
const
|
|
2336
|
-
|
|
2330
|
+
set(v) {
|
|
2331
|
+
if (v) {
|
|
2332
|
+
const p = m.effectiveAt ? new Date(m.effectiveAt) : /* @__PURE__ */ new Date(), [V, L, $] = v.split("-");
|
|
2333
|
+
p.setFullYear(parseInt(V)), p.setMonth(parseInt(L) - 1), p.setDate(parseInt($)), m.effectiveAt = p.toISOString();
|
|
2337
2334
|
}
|
|
2338
2335
|
}
|
|
2339
|
-
}),
|
|
2336
|
+
}), o = O({
|
|
2340
2337
|
get() {
|
|
2341
2338
|
return null;
|
|
2342
2339
|
},
|
|
2343
|
-
set(
|
|
2344
|
-
if (
|
|
2345
|
-
const
|
|
2346
|
-
|
|
2340
|
+
set(v) {
|
|
2341
|
+
if (v) {
|
|
2342
|
+
const p = m.effectiveAt ? new Date(m.effectiveAt) : /* @__PURE__ */ new Date(), [V, L] = v.split(":");
|
|
2343
|
+
p.setHours(parseInt(V)), p.setMinutes(parseInt(L)), p.setSeconds(0), p.setMilliseconds(0), m.effectiveAt = p.toISOString();
|
|
2347
2344
|
}
|
|
2348
2345
|
}
|
|
2349
|
-
}), e =
|
|
2350
|
-
() => !!e.value.length ||
|
|
2351
|
-
), y =
|
|
2352
|
-
|
|
2346
|
+
}), e = A(new Array()), i = A([]), c = O(
|
|
2347
|
+
() => !!e.value.length || i.value.some((v) => v.errors.length)
|
|
2348
|
+
), y = A();
|
|
2349
|
+
x({
|
|
2353
2350
|
validateInputs: () => {
|
|
2354
|
-
var
|
|
2355
|
-
(
|
|
2351
|
+
var v, p;
|
|
2352
|
+
(p = (v = y.value) == null ? void 0 : v.validateInputs) == null || p.call(v);
|
|
2356
2353
|
},
|
|
2357
2354
|
resetInputsValidation: () => {
|
|
2358
|
-
var
|
|
2359
|
-
(
|
|
2355
|
+
var v, p;
|
|
2356
|
+
(p = (v = y.value) == null ? void 0 : v.resetInputsValidation) == null || p.call(v);
|
|
2360
2357
|
},
|
|
2361
2358
|
resetInputs: () => {
|
|
2362
|
-
var
|
|
2363
|
-
(
|
|
2359
|
+
var v, p;
|
|
2360
|
+
(p = (v = y.value) == null ? void 0 : v.resetInputs) == null || p.call(v);
|
|
2364
2361
|
}
|
|
2365
2362
|
});
|
|
2366
2363
|
const { t: k } = fe();
|
|
2367
|
-
async function I(
|
|
2368
|
-
e.value = [],
|
|
2364
|
+
async function I(v) {
|
|
2365
|
+
e.value = [], i.value = [];
|
|
2369
2366
|
try {
|
|
2370
2367
|
C.value = !0;
|
|
2371
|
-
const [
|
|
2372
|
-
|
|
2368
|
+
const [p] = await Promise.all([
|
|
2369
|
+
ss(v),
|
|
2373
2370
|
// fake buffer
|
|
2374
2371
|
new Promise((L) => setTimeout(L, 1e3))
|
|
2375
|
-
]), V =
|
|
2372
|
+
]), V = Zo(p);
|
|
2376
2373
|
if (V.invalidExcel) {
|
|
2377
2374
|
e.value.push(
|
|
2378
2375
|
V.invalidExcelMessage ?? k("inventory.ingredient.import.fileError.invalidExcel")
|
|
2379
2376
|
);
|
|
2380
2377
|
return;
|
|
2381
2378
|
}
|
|
2382
|
-
if (
|
|
2379
|
+
if (i.value = V.importCreateResult, !i.value.length) {
|
|
2383
2380
|
e.value.push(k("inventory.ingredient.import.fileError.noData"));
|
|
2384
2381
|
return;
|
|
2385
2382
|
}
|
|
2386
|
-
|
|
2387
|
-
} catch (
|
|
2388
|
-
|
|
2383
|
+
m.items = i.value.map((L) => L.poItems).flat();
|
|
2384
|
+
} catch (p) {
|
|
2385
|
+
l.open({
|
|
2389
2386
|
title: k("inventory.ingredient.import.fileError.unableToRead"),
|
|
2390
|
-
message:
|
|
2387
|
+
message: p == null ? void 0 : p.message,
|
|
2391
2388
|
type: "error"
|
|
2392
|
-
}), console.error("Error in reading file",
|
|
2389
|
+
}), console.error("Error in reading file", p);
|
|
2393
2390
|
} finally {
|
|
2394
|
-
e.value.length &&
|
|
2391
|
+
e.value.length && l.open({
|
|
2395
2392
|
title: k("inventory.ingredient.import.fileError.invalidExcel"),
|
|
2396
2393
|
type: "error"
|
|
2397
2394
|
}), C.value = !1;
|
|
2398
2395
|
}
|
|
2399
2396
|
}
|
|
2400
|
-
return be(r, (
|
|
2401
|
-
|
|
2402
|
-
}), (
|
|
2403
|
-
const V = D("FmSelect"), L = D("FmDatePicker"), $ = D("FmTimePicker"), T = D("FmCircularProgress"),
|
|
2404
|
-
return
|
|
2397
|
+
return be(r, (v) => {
|
|
2398
|
+
v && I(v);
|
|
2399
|
+
}), (v, p) => {
|
|
2400
|
+
const V = D("FmSelect"), L = D("FmDatePicker"), $ = D("FmTimePicker"), T = D("FmCircularProgress"), Y = D("FmLabel"), z = D("FmIcon"), E = D("FmButton"), j = D("FmForm");
|
|
2401
|
+
return S(), Q(j, {
|
|
2405
2402
|
ref_key: "formRef",
|
|
2406
2403
|
ref: y
|
|
2407
2404
|
}, {
|
|
@@ -2409,49 +2406,49 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2409
2406
|
a("div", cn, [
|
|
2410
2407
|
b(V, {
|
|
2411
2408
|
modelValue: u.value,
|
|
2412
|
-
"onUpdate:modelValue":
|
|
2409
|
+
"onUpdate:modelValue": p[0] || (p[0] = (B) => u.value = B),
|
|
2413
2410
|
label: "Transfer from",
|
|
2414
2411
|
searchable: "",
|
|
2415
2412
|
searchTarget: "label",
|
|
2416
|
-
items:
|
|
2417
|
-
rules: [
|
|
2413
|
+
items: d.value,
|
|
2414
|
+
rules: [s(qe)()]
|
|
2418
2415
|
}, null, 8, ["modelValue", "items", "rules"]),
|
|
2419
2416
|
b(L, {
|
|
2420
|
-
modelValue:
|
|
2421
|
-
"onUpdate:modelValue":
|
|
2417
|
+
modelValue: h.value,
|
|
2418
|
+
"onUpdate:modelValue": p[1] || (p[1] = (B) => h.value = B),
|
|
2422
2419
|
label: "Transfer date",
|
|
2423
|
-
rules: [
|
|
2420
|
+
rules: [s(qe)()]
|
|
2424
2421
|
}, null, 8, ["modelValue", "rules"]),
|
|
2425
2422
|
b($, {
|
|
2426
|
-
modelValue:
|
|
2427
|
-
"onUpdate:modelValue":
|
|
2423
|
+
modelValue: o.value,
|
|
2424
|
+
"onUpdate:modelValue": p[2] || (p[2] = (B) => o.value = B),
|
|
2428
2425
|
label: "Transfer time",
|
|
2429
|
-
rules: [
|
|
2426
|
+
rules: [s(qe)()]
|
|
2430
2427
|
}, null, 8, ["modelValue", "rules"]),
|
|
2431
|
-
t.value ? (
|
|
2428
|
+
t.value ? (S(), F("div", pn, [
|
|
2432
2429
|
a("div", null, [
|
|
2433
2430
|
b(T, {
|
|
2434
2431
|
size: "md",
|
|
2435
2432
|
color: "neutral-gray-200"
|
|
2436
2433
|
})
|
|
2437
2434
|
]),
|
|
2438
|
-
a("div", fn, q(
|
|
2439
|
-
])) : (
|
|
2440
|
-
b(
|
|
2435
|
+
a("div", fn, q(s(k)("inventory.formField.loading")), 1)
|
|
2436
|
+
])) : (S(), F(ne, { key: 1 }, [
|
|
2437
|
+
b(ts, {
|
|
2441
2438
|
"max-file-size": 5,
|
|
2442
|
-
class:
|
|
2439
|
+
class: X({
|
|
2443
2440
|
"w-full": !0,
|
|
2444
2441
|
"h-[200px]": !r.value
|
|
2445
2442
|
}),
|
|
2446
|
-
accept: ".xlsx,.xls",
|
|
2443
|
+
accept: ".xlsx,.xls,.csv",
|
|
2447
2444
|
label: gt,
|
|
2448
|
-
onFileUpload:
|
|
2449
|
-
"button-label":
|
|
2445
|
+
onFileUpload: p[3] || (p[3] = (B) => r.value = B),
|
|
2446
|
+
"button-label": s(k)("inventory.ingredient.import.selectFile")
|
|
2450
2447
|
}, Ut({ _: 2 }, [
|
|
2451
2448
|
r.value ? {
|
|
2452
2449
|
name: "default",
|
|
2453
2450
|
fn: R(({ openFileDialog: B }) => [
|
|
2454
|
-
b(
|
|
2451
|
+
b(Y, null, {
|
|
2455
2452
|
default: R(() => [
|
|
2456
2453
|
Ie(q(gt))
|
|
2457
2454
|
]),
|
|
@@ -2459,27 +2456,27 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2459
2456
|
}),
|
|
2460
2457
|
a("div", vn, [
|
|
2461
2458
|
a("div", {
|
|
2462
|
-
class:
|
|
2459
|
+
class: X([
|
|
2463
2460
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
2464
2461
|
{
|
|
2465
2462
|
"border border-fm-color-neutral-gray-100": C.value,
|
|
2466
|
-
"border border-fm-color-neutral-gray-200": !C.value && !
|
|
2467
|
-
"border border-fm-color-system-error-200":
|
|
2463
|
+
"border border-fm-color-neutral-gray-200": !C.value && !c.value,
|
|
2464
|
+
"border border-fm-color-system-error-200": c.value
|
|
2468
2465
|
}
|
|
2469
2466
|
])
|
|
2470
2467
|
}, [
|
|
2471
|
-
C.value ? (
|
|
2468
|
+
C.value ? (S(), Q(T, {
|
|
2472
2469
|
key: 0,
|
|
2473
2470
|
size: "md",
|
|
2474
2471
|
color: "neutral-gray-200"
|
|
2475
|
-
})) : (
|
|
2472
|
+
})) : (S(), Q(z, {
|
|
2476
2473
|
key: 1,
|
|
2477
|
-
name:
|
|
2474
|
+
name: c.value ? "error" : "attach_file",
|
|
2478
2475
|
outline: "",
|
|
2479
|
-
color:
|
|
2476
|
+
color: c.value ? "system-error-300" : void 0
|
|
2480
2477
|
}, null, 8, ["name", "color"])),
|
|
2481
2478
|
a("div", {
|
|
2482
|
-
class:
|
|
2479
|
+
class: X([
|
|
2483
2480
|
"fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
|
|
2484
2481
|
{
|
|
2485
2482
|
"text-fm-color-typo-disabled": C.value,
|
|
@@ -2489,18 +2486,18 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2489
2486
|
}, [
|
|
2490
2487
|
a("div", yn, q(r.value.name), 1)
|
|
2491
2488
|
], 2),
|
|
2492
|
-
C.value ? N("", !0) : (
|
|
2493
|
-
b(
|
|
2494
|
-
label:
|
|
2495
|
-
variant:
|
|
2496
|
-
"prepend-icon":
|
|
2489
|
+
C.value ? N("", !0) : (S(), F("div", bn, [
|
|
2490
|
+
b(E, {
|
|
2491
|
+
label: s(k)("inventory.ingredient.import.replaceFile"),
|
|
2492
|
+
variant: c.value ? "destructive" : "secondary",
|
|
2493
|
+
"prepend-icon": c.value ? void 0 : "autorenew",
|
|
2497
2494
|
onClick: B
|
|
2498
2495
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
2499
2496
|
]))
|
|
2500
2497
|
], 2),
|
|
2501
|
-
e.value.length ? (
|
|
2502
|
-
(
|
|
2503
|
-
key:
|
|
2498
|
+
e.value.length ? (S(), F("div", gn, [
|
|
2499
|
+
(S(!0), F(ne, null, ge(e.value, (G, _) => (S(), F("div", {
|
|
2500
|
+
key: _,
|
|
2504
2501
|
class: "flex gap-8 items-center"
|
|
2505
2502
|
}, [
|
|
2506
2503
|
b(z, {
|
|
@@ -2516,9 +2513,9 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2516
2513
|
key: "0"
|
|
2517
2514
|
} : void 0
|
|
2518
2515
|
]), 1032, ["class", "button-label"]),
|
|
2519
|
-
r.value ? (
|
|
2520
|
-
a("div", kn, q(
|
|
2521
|
-
(
|
|
2516
|
+
r.value ? (S(), F("div", hn, [
|
|
2517
|
+
a("div", kn, q(s(k)("inventory.ingredient.import.summary")), 1),
|
|
2518
|
+
(S(!0), F(ne, null, ge(i.value, (B, G) => (S(), Q(dn, {
|
|
2522
2519
|
key: G,
|
|
2523
2520
|
name: `Transfer Note ${G + 1}`,
|
|
2524
2521
|
items: B.poItems,
|
|
@@ -2539,55 +2536,55 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2539
2536
|
show: { type: Boolean }
|
|
2540
2537
|
},
|
|
2541
2538
|
emits: ["update:show", "submitted"],
|
|
2542
|
-
setup(
|
|
2543
|
-
const
|
|
2544
|
-
|
|
2539
|
+
setup(f, { expose: x, emit: r }) {
|
|
2540
|
+
const l = r, t = Ft(f, "show"), m = De(), d = ot(), u = A(!1), h = A(), o = A();
|
|
2541
|
+
x({
|
|
2545
2542
|
validateInputs: () => {
|
|
2546
|
-
var
|
|
2547
|
-
(y = (
|
|
2543
|
+
var c, y;
|
|
2544
|
+
(y = (c = h.value) == null ? void 0 : c.validateInputs) == null || y.call(c);
|
|
2548
2545
|
},
|
|
2549
2546
|
resetInputsValidation: () => {
|
|
2550
|
-
var
|
|
2551
|
-
(y = (
|
|
2547
|
+
var c, y;
|
|
2548
|
+
(y = (c = h.value) == null ? void 0 : c.resetInputsValidation) == null || y.call(c);
|
|
2552
2549
|
},
|
|
2553
2550
|
resetInputs: () => {
|
|
2554
|
-
var
|
|
2555
|
-
(y = (
|
|
2551
|
+
var c, y;
|
|
2552
|
+
(y = (c = h.value) == null ? void 0 : c.resetInputs) == null || y.call(c);
|
|
2556
2553
|
}
|
|
2557
2554
|
});
|
|
2558
2555
|
function e() {
|
|
2559
|
-
var
|
|
2560
|
-
(y = (
|
|
2556
|
+
var c, y;
|
|
2557
|
+
(y = (c = h.value) == null ? void 0 : c.validateInputs) == null || y.call(c);
|
|
2561
2558
|
}
|
|
2562
|
-
async function
|
|
2563
|
-
var y, k, I,
|
|
2564
|
-
if (!((k = (y =
|
|
2565
|
-
|
|
2559
|
+
async function i() {
|
|
2560
|
+
var y, k, I, v, p;
|
|
2561
|
+
if (!((k = (y = o.value) == null ? void 0 : y.supplier) != null && k.name)) {
|
|
2562
|
+
m.open({
|
|
2566
2563
|
title: "Upload failed",
|
|
2567
2564
|
message: "Location is required",
|
|
2568
2565
|
type: "error"
|
|
2569
2566
|
});
|
|
2570
2567
|
return;
|
|
2571
2568
|
}
|
|
2572
|
-
if (!((I =
|
|
2573
|
-
|
|
2569
|
+
if (!((I = o.value) != null && I.items) || ((p = (v = o.value) == null ? void 0 : v.items) == null ? void 0 : p.length) === 0) {
|
|
2570
|
+
m.open({
|
|
2574
2571
|
title: "Upload failed",
|
|
2575
2572
|
message: "No data to upload",
|
|
2576
2573
|
type: "error"
|
|
2577
2574
|
});
|
|
2578
2575
|
return;
|
|
2579
2576
|
}
|
|
2580
|
-
const
|
|
2581
|
-
if (!
|
|
2582
|
-
|
|
2577
|
+
const c = o.value.effectiveAt ? new Date(o.value.effectiveAt) : null;
|
|
2578
|
+
if (!c) {
|
|
2579
|
+
m.open({
|
|
2583
2580
|
title: "Invalid date",
|
|
2584
2581
|
message: "Transfer date is required",
|
|
2585
2582
|
type: "error"
|
|
2586
2583
|
});
|
|
2587
2584
|
return;
|
|
2588
2585
|
}
|
|
2589
|
-
if (
|
|
2590
|
-
|
|
2586
|
+
if (c.getTime() > (/* @__PURE__ */ new Date()).getTime()) {
|
|
2587
|
+
m.open({
|
|
2591
2588
|
title: "Invalid date",
|
|
2592
2589
|
message: "Transfer date cannot be in the future",
|
|
2593
2590
|
type: "error"
|
|
@@ -2596,9 +2593,9 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2596
2593
|
}
|
|
2597
2594
|
u.value = !0;
|
|
2598
2595
|
try {
|
|
2599
|
-
await
|
|
2596
|
+
await d.importFromXilnex(o.value), l("update:show", !1);
|
|
2600
2597
|
} catch (V) {
|
|
2601
|
-
await new Promise((L) => setTimeout(L, 1e3)),
|
|
2598
|
+
await new Promise((L) => setTimeout(L, 1e3)), m.open({
|
|
2602
2599
|
title: "Upload failed",
|
|
2603
2600
|
message: V == null ? void 0 : V.message,
|
|
2604
2601
|
type: "error"
|
|
@@ -2607,11 +2604,11 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2607
2604
|
u.value = !1;
|
|
2608
2605
|
}
|
|
2609
2606
|
}
|
|
2610
|
-
return (
|
|
2611
|
-
const k = D("FmSpacer"), I = D("FmButton"),
|
|
2612
|
-
return
|
|
2613
|
-
modelValue:
|
|
2614
|
-
"onUpdate:modelValue": y[2] || (y[2] = (
|
|
2607
|
+
return (c, y) => {
|
|
2608
|
+
const k = D("FmSpacer"), I = D("FmButton"), v = D("FmDialog");
|
|
2609
|
+
return S(), Q(v, {
|
|
2610
|
+
modelValue: s(t),
|
|
2611
|
+
"onUpdate:modelValue": y[2] || (y[2] = (p) => Ce(t) ? t.value = p : null),
|
|
2615
2612
|
overlay: !0,
|
|
2616
2613
|
"close-button": !1
|
|
2617
2614
|
}, {
|
|
@@ -2626,7 +2623,7 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2626
2623
|
label: "Cancel",
|
|
2627
2624
|
size: "md",
|
|
2628
2625
|
variant: "tertiary",
|
|
2629
|
-
onClick: y[1] || (y[1] = (
|
|
2626
|
+
onClick: y[1] || (y[1] = (p) => l("update:show", !1))
|
|
2630
2627
|
}, null, 8, ["disabled"]),
|
|
2631
2628
|
b(I, {
|
|
2632
2629
|
disabled: u.value,
|
|
@@ -2642,10 +2639,10 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2642
2639
|
a("div", Sn, [
|
|
2643
2640
|
b(xn, {
|
|
2644
2641
|
ref_key: "formRef",
|
|
2645
|
-
ref:
|
|
2646
|
-
onValidationSuccess:
|
|
2647
|
-
modelValue:
|
|
2648
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
2642
|
+
ref: h,
|
|
2643
|
+
onValidationSuccess: i,
|
|
2644
|
+
modelValue: o.value,
|
|
2645
|
+
"onUpdate:modelValue": y[0] || (y[0] = (p) => o.value = p)
|
|
2649
2646
|
}, null, 8, ["modelValue"])
|
|
2650
2647
|
])
|
|
2651
2648
|
]),
|
|
@@ -2656,19 +2653,19 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2656
2653
|
}), wn = { class: "flex flex-col py-8" }, In = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, $n = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Dn = {
|
|
2657
2654
|
key: 0,
|
|
2658
2655
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
|
|
2659
|
-
}, Tn = { class: "pt-8" }, _t = "ReceiveRequestViewSearchCriteria",
|
|
2656
|
+
}, Tn = { class: "pt-8" }, _t = "ReceiveRequestViewSearchCriteria", Yn = /* @__PURE__ */ ae({
|
|
2660
2657
|
__name: "ReceiveRequestView",
|
|
2661
|
-
setup(
|
|
2662
|
-
const { t:
|
|
2658
|
+
setup(f) {
|
|
2659
|
+
const { t: x } = fe(), r = De();
|
|
2663
2660
|
Be.object({
|
|
2664
2661
|
name: Be.string().optional().nullable(),
|
|
2665
2662
|
startDate: Be.string().optional().nullable(),
|
|
2666
2663
|
endDate: Be.string().optional().nullable()
|
|
2667
2664
|
});
|
|
2668
|
-
const
|
|
2669
|
-
() => !e._currentLocation ||
|
|
2670
|
-
), C =
|
|
2671
|
-
function
|
|
2665
|
+
const l = O(
|
|
2666
|
+
() => !e._currentLocation || h.loading.value
|
|
2667
|
+
), C = ps(), t = at();
|
|
2668
|
+
function m() {
|
|
2672
2669
|
const $ = {
|
|
2673
2670
|
name: "",
|
|
2674
2671
|
...vt()
|
|
@@ -2681,37 +2678,37 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2681
2678
|
return $;
|
|
2682
2679
|
}
|
|
2683
2680
|
}
|
|
2684
|
-
function
|
|
2681
|
+
function d() {
|
|
2685
2682
|
C.setItem(_t, JSON.stringify(u.value));
|
|
2686
2683
|
}
|
|
2687
|
-
const u =
|
|
2684
|
+
const u = A(m()), h = ls(
|
|
2688
2685
|
Ke.RECEIVE_REQUEST,
|
|
2689
2686
|
u.value
|
|
2690
|
-
), { columnDefs:
|
|
2687
|
+
), { columnDefs: o } = rs(
|
|
2691
2688
|
Ke.RECEIVE_REQUEST,
|
|
2692
|
-
|
|
2689
|
+
h
|
|
2693
2690
|
), e = je();
|
|
2694
|
-
async function
|
|
2695
|
-
const $ = `inventory-record_${yt(u.value.startDate).format("DD-MM-YYYY_HH-mm")}-${yt(u.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, T =
|
|
2696
|
-
(z) => z.items.map((
|
|
2697
|
-
const j = new Date(
|
|
2698
|
-
|
|
2699
|
-
),
|
|
2691
|
+
async function i() {
|
|
2692
|
+
const $ = `inventory-record_${yt(u.value.startDate).format("DD-MM-YYYY_HH-mm")}-${yt(u.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, T = h.purchaseOrders.value.flatMap(
|
|
2693
|
+
(z) => z.items.map((E) => {
|
|
2694
|
+
const j = new Date(ds(z._id) ?? ""), B = z.effectiveAt ? new Date(z.effectiveAt) : void 0, G = me(
|
|
2695
|
+
us(E.sku, z.deliveryOrder || [])
|
|
2696
|
+
), _ = me(E.quantity);
|
|
2700
2697
|
return {
|
|
2701
|
-
"SKU code":
|
|
2702
|
-
"SKU name":
|
|
2698
|
+
"SKU code": E.code,
|
|
2699
|
+
"SKU name": E.name,
|
|
2703
2700
|
"PO #": z.seqNumber,
|
|
2704
2701
|
"Effective at": B,
|
|
2705
2702
|
Date: j,
|
|
2706
2703
|
Status: z.status,
|
|
2707
2704
|
Reference: z.ref ?? "",
|
|
2708
2705
|
"Received quantity": G,
|
|
2709
|
-
"Ordered quantity":
|
|
2710
|
-
Unit:
|
|
2711
|
-
"Total cost":
|
|
2706
|
+
"Ordered quantity": _,
|
|
2707
|
+
Unit: E.sku.unit.abbrev,
|
|
2708
|
+
"Total cost": E.totalCost ? Je(E.totalCost) : null
|
|
2712
2709
|
};
|
|
2713
2710
|
})
|
|
2714
|
-
),
|
|
2711
|
+
), Y = [
|
|
2715
2712
|
"SKU code",
|
|
2716
2713
|
"SKU name",
|
|
2717
2714
|
"PO #",
|
|
@@ -2722,33 +2719,33 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2722
2719
|
"Ordered quantity",
|
|
2723
2720
|
"Unit"
|
|
2724
2721
|
];
|
|
2725
|
-
t.enableBackdatePo &&
|
|
2722
|
+
t.enableBackdatePo && Y.insert("Effective at", 4), t.enableTotalCost && Y.push("Total cost"), await cs(
|
|
2726
2723
|
[
|
|
2727
2724
|
{
|
|
2728
2725
|
name: "purchases",
|
|
2729
2726
|
data: T,
|
|
2730
|
-
columns:
|
|
2727
|
+
columns: Y
|
|
2731
2728
|
}
|
|
2732
2729
|
],
|
|
2733
2730
|
$
|
|
2734
2731
|
), r.open({
|
|
2735
|
-
title:
|
|
2736
|
-
message:
|
|
2732
|
+
title: x("inventory.transfer.receiveRequest.export.success"),
|
|
2733
|
+
message: x("inventory.transfer.receiveRequest.export.message", [$]),
|
|
2737
2734
|
type: "success"
|
|
2738
2735
|
});
|
|
2739
2736
|
}
|
|
2740
|
-
const
|
|
2741
|
-
be([() =>
|
|
2742
|
-
!$.startDate || !$.endDate || (u.value.startDate = $.startDate, u.value.endDate = $.endDate,
|
|
2737
|
+
const c = A(vt()), y = A("");
|
|
2738
|
+
be([() => c.value], ([$]) => {
|
|
2739
|
+
!$.startDate || !$.endDate || (u.value.startDate = $.startDate, u.value.endDate = $.endDate, h.updateDateRange(
|
|
2743
2740
|
u.value.startDate,
|
|
2744
2741
|
u.value.endDate
|
|
2745
|
-
),
|
|
2742
|
+
), d());
|
|
2746
2743
|
}), be([() => y.value], () => {
|
|
2747
|
-
|
|
2744
|
+
d();
|
|
2748
2745
|
});
|
|
2749
2746
|
function k($) {
|
|
2750
2747
|
if ($ === "create") {
|
|
2751
|
-
if (
|
|
2748
|
+
if (l.value) {
|
|
2752
2749
|
r.open({
|
|
2753
2750
|
title: "Loading data...",
|
|
2754
2751
|
message: "Please wait.",
|
|
@@ -2756,39 +2753,41 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2756
2753
|
});
|
|
2757
2754
|
return;
|
|
2758
2755
|
}
|
|
2759
|
-
return
|
|
2756
|
+
return h.promptCreateTransferDialog();
|
|
2760
2757
|
}
|
|
2761
|
-
if ($ === "upload")
|
|
2762
|
-
return
|
|
2758
|
+
if ($ === "upload" && t.enableXilnexTransferNote)
|
|
2759
|
+
return h.promptUploadTransferDialog();
|
|
2763
2760
|
if ($ === "refresh")
|
|
2764
|
-
return
|
|
2761
|
+
return h.fetchData();
|
|
2765
2762
|
if ($ === "export")
|
|
2766
|
-
return
|
|
2763
|
+
return i();
|
|
2767
2764
|
}
|
|
2768
|
-
const { breakpoints: I } = nt(),
|
|
2765
|
+
const { breakpoints: I } = nt(), v = O(() => I.value.xs || I.value.sm), p = O(() => v.value ? 10 : 20), V = os(), L = O(() => [
|
|
2769
2766
|
{
|
|
2770
|
-
label:
|
|
2767
|
+
label: x("inventory.transfer.receiveRequest.actions.create"),
|
|
2771
2768
|
value: "create",
|
|
2772
2769
|
isPrimary: !0,
|
|
2773
2770
|
prependIcon: "add"
|
|
2774
2771
|
},
|
|
2772
|
+
...t.enableXilnexTransferNote ? [
|
|
2773
|
+
{
|
|
2774
|
+
label: "Upload",
|
|
2775
|
+
value: "upload"
|
|
2776
|
+
}
|
|
2777
|
+
] : [],
|
|
2775
2778
|
{
|
|
2776
|
-
label: "
|
|
2777
|
-
value: "upload"
|
|
2778
|
-
},
|
|
2779
|
-
{
|
|
2780
|
-
label: S("common.refresh"),
|
|
2779
|
+
label: x("common.refresh"),
|
|
2781
2780
|
value: "refresh"
|
|
2782
2781
|
},
|
|
2783
2782
|
{
|
|
2784
|
-
label:
|
|
2783
|
+
label: x("common.export"),
|
|
2785
2784
|
value: "export"
|
|
2786
2785
|
}
|
|
2787
2786
|
]);
|
|
2788
2787
|
return ($, T) => {
|
|
2789
|
-
const
|
|
2790
|
-
return
|
|
2791
|
-
title:
|
|
2788
|
+
const Y = D("FmTable");
|
|
2789
|
+
return S(), Q(ns, {
|
|
2790
|
+
title: s(x)("inventory.transfer.receiveRequest.title2"),
|
|
2792
2791
|
actions: L.value,
|
|
2793
2792
|
"onClick:action": k
|
|
2794
2793
|
}, {
|
|
@@ -2796,64 +2795,64 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2796
2795
|
var z;
|
|
2797
2796
|
return [
|
|
2798
2797
|
a("div", {
|
|
2799
|
-
class:
|
|
2798
|
+
class: X([
|
|
2800
2799
|
"flex flex-col gap-8 max-h-full",
|
|
2801
2800
|
{
|
|
2802
|
-
"p-0":
|
|
2803
|
-
"px-24 ": !
|
|
2801
|
+
"p-0": v.value,
|
|
2802
|
+
"px-24 ": !v.value
|
|
2804
2803
|
}
|
|
2805
2804
|
])
|
|
2806
2805
|
}, [
|
|
2807
|
-
b(
|
|
2806
|
+
b(as, {
|
|
2808
2807
|
"date-range-query": "",
|
|
2809
|
-
"date-range":
|
|
2810
|
-
"onUpdate:dateRange": T[0] || (T[0] = (
|
|
2808
|
+
"date-range": c.value,
|
|
2809
|
+
"onUpdate:dateRange": T[0] || (T[0] = (E) => c.value = E),
|
|
2811
2810
|
searchable: "",
|
|
2812
2811
|
"change-location": "",
|
|
2813
2812
|
search: y.value,
|
|
2814
|
-
"onUpdate:search": T[1] || (T[1] = (
|
|
2813
|
+
"onUpdate:search": T[1] || (T[1] = (E) => y.value = E)
|
|
2815
2814
|
}, null, 8, ["date-range", "search"]),
|
|
2816
|
-
(
|
|
2817
|
-
style: kt(
|
|
2818
|
-
"column-defs": o
|
|
2819
|
-
"row-data":
|
|
2815
|
+
(S(), Q(Y, {
|
|
2816
|
+
style: kt(s(V).tableHeight),
|
|
2817
|
+
"column-defs": s(o),
|
|
2818
|
+
"row-data": s(h).purchaseOrders.value,
|
|
2820
2819
|
"search-value": y.value,
|
|
2821
|
-
loading:
|
|
2822
|
-
onRowClick: T[2] || (T[2] = (
|
|
2823
|
-
key: (z =
|
|
2824
|
-
"page-size":
|
|
2820
|
+
loading: l.value,
|
|
2821
|
+
onRowClick: T[2] || (T[2] = (E) => s(h).promptShowTransferDetails(E.original)),
|
|
2822
|
+
key: (z = s(e)._currentLocation) == null ? void 0 : z.dbName,
|
|
2823
|
+
"page-size": p.value
|
|
2825
2824
|
}, {
|
|
2826
|
-
"list-row": R((
|
|
2825
|
+
"list-row": R((E) => [
|
|
2827
2826
|
b(Ct, {
|
|
2828
|
-
row:
|
|
2829
|
-
onRowClick:
|
|
2827
|
+
row: E,
|
|
2828
|
+
onRowClick: s(h).promptShowTransferDetails
|
|
2830
2829
|
}, {
|
|
2831
2830
|
default: R((j) => {
|
|
2832
|
-
var B, G,
|
|
2831
|
+
var B, G, _, g, M, J, le, Fe, $e, Ae, Ee, Qe, Me, ke, n, w, Z, ie, ue, xe;
|
|
2833
2832
|
return [
|
|
2834
2833
|
a("div", wn, [
|
|
2835
2834
|
a("div", In, [
|
|
2836
|
-
b(
|
|
2837
|
-
render: (
|
|
2835
|
+
b(s(pe), {
|
|
2836
|
+
render: (_ = (G = (B = j._id) == null ? void 0 : B.column) == null ? void 0 : G.columnDef) == null ? void 0 : _.cell,
|
|
2838
2837
|
props: (M = (g = j._id) == null ? void 0 : g.getContext) == null ? void 0 : M.call(g)
|
|
2839
2838
|
}, null, 8, ["render", "props"])
|
|
2840
2839
|
]),
|
|
2841
2840
|
a("div", Fn, [
|
|
2842
|
-
b(
|
|
2841
|
+
b(s(pe), {
|
|
2843
2842
|
render: (Fe = (le = (J = j.supplier_name) == null ? void 0 : J.column) == null ? void 0 : le.columnDef) == null ? void 0 : Fe.cell,
|
|
2844
|
-
props: (
|
|
2843
|
+
props: (Ae = ($e = j.supplier_name) == null ? void 0 : $e.getContext) == null ? void 0 : Ae.call($e)
|
|
2845
2844
|
}, null, 8, ["render", "props"])
|
|
2846
2845
|
]),
|
|
2847
|
-
a("div", $n, q(
|
|
2848
|
-
|
|
2849
|
-
b(
|
|
2850
|
-
render: (Me = (
|
|
2846
|
+
a("div", $n, q(E.original.items.map((_e) => `${_e.name}`).join(", ")), 1),
|
|
2847
|
+
E.original.ref ? (S(), F("div", Dn, [
|
|
2848
|
+
b(s(pe), {
|
|
2849
|
+
render: (Me = (Qe = (Ee = j.ref) == null ? void 0 : Ee.column) == null ? void 0 : Qe.columnDef) == null ? void 0 : Me.cell,
|
|
2851
2850
|
props: (n = (ke = j.ref) == null ? void 0 : ke.getContext) == null ? void 0 : n.call(ke)
|
|
2852
2851
|
}, null, 8, ["render", "props"])
|
|
2853
2852
|
])) : N("", !0),
|
|
2854
2853
|
a("div", Tn, [
|
|
2855
|
-
b(
|
|
2856
|
-
render: (ie = (
|
|
2854
|
+
b(s(pe), {
|
|
2855
|
+
render: (ie = (Z = (w = j.status) == null ? void 0 : w.column) == null ? void 0 : Z.columnDef) == null ? void 0 : ie.cell,
|
|
2857
2856
|
props: (xe = (ue = j.status) == null ? void 0 : ue.getContext) == null ? void 0 : xe.call(ue)
|
|
2858
2857
|
}, null, 8, ["render", "props"])
|
|
2859
2858
|
])
|
|
@@ -2866,23 +2865,23 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2866
2865
|
_: 1
|
|
2867
2866
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
2868
2867
|
], 2),
|
|
2869
|
-
(
|
|
2870
|
-
b(
|
|
2871
|
-
onSubmitted:
|
|
2872
|
-
"on-submit:return-stock": (
|
|
2873
|
-
|
|
2868
|
+
(S(), Q(Ot, { to: "body" }, [
|
|
2869
|
+
b(Ko, Xe(s(h).transferDialogProps.value, {
|
|
2870
|
+
onSubmitted: s(h).fetchData,
|
|
2871
|
+
"on-submit:return-stock": (E, j) => s(h).submitAction(
|
|
2872
|
+
E,
|
|
2874
2873
|
"returnStock",
|
|
2875
2874
|
void 0,
|
|
2876
2875
|
j
|
|
2877
2876
|
)
|
|
2878
2877
|
}), null, 16, ["onSubmitted", "on-submit:return-stock"]),
|
|
2879
|
-
b(
|
|
2880
|
-
scope:
|
|
2881
|
-
},
|
|
2882
|
-
onSubmitted:
|
|
2883
|
-
onReturnStock:
|
|
2878
|
+
b(is, Xe({
|
|
2879
|
+
scope: s(Ke).RECEIVE_REQUEST
|
|
2880
|
+
}, s(h).transferDetailsProps.value, {
|
|
2881
|
+
onSubmitted: s(h).fetchData,
|
|
2882
|
+
onReturnStock: s(h).promptReturnTransferDialog
|
|
2884
2883
|
}), null, 16, ["scope", "onSubmitted", "onReturnStock"]),
|
|
2885
|
-
b(Cn, Nt(Bt(
|
|
2884
|
+
b(Cn, Nt(Bt(s(h).xilnexImportDialogProps.value)), null, 16)
|
|
2886
2885
|
]))
|
|
2887
2886
|
];
|
|
2888
2887
|
}),
|
|
@@ -2892,5 +2891,5 @@ const Gs = exports.FfCalculator, Js = { class: "flex flex-col flex-1" }, Ws = {
|
|
|
2892
2891
|
}
|
|
2893
2892
|
});
|
|
2894
2893
|
export {
|
|
2895
|
-
|
|
2894
|
+
Yn as default
|
|
2896
2895
|
};
|