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