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