@feedmepos/mf-inventory-portal 1.0.21 → 1.0.22
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-Dm1dub7v.js → App-Cm-J0Og-.js} +2 -2
- package/dist/{ApprovalView-DZK5guKS.js → ApprovalView-BhO_g8Nv.js} +2 -2
- package/dist/{BindingsDialog-BL2jOxN4.js → BindingsDialog--6Lpb9jF.js} +2 -2
- package/dist/{BindingsPicker-G1SdBXsq.js → BindingsPicker-zVDraAOz.js} +1 -1
- package/dist/{BindingsTable-Coy6_ryj.js → BindingsTable-BDX10BNR.js} +1 -1
- package/dist/{ClosingDraftView-RTjmn1uK.js → ClosingDraftView-DGIJ7LG-.js} +2 -2
- package/dist/{ClosingTemplateView-DkX8edyP.js → ClosingTemplateView-DtRHcW9E.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-j-DgrDiv.js → DeliveryOrderPrintPreview-D6IWwxjF.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BL8MG9yR.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DEHSBeuj.js} +3 -3
- package/dist/{FmMultiselectDialog-C2FfQXZp.js → FmMultiselectDialog-D-o5vkyE.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-D4dnq4rA.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CKCxgh1z.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DXbFhLpK.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-5BVrMAHJ.js} +1 -1
- package/dist/{IngredientGroupView-DHbQCRy_.js → IngredientGroupView-nm89Mhcl.js} +2 -2
- package/dist/{IngredientsView-CF-wb-6-.js → IngredientsView-BbdQPgSj.js} +5 -5
- package/dist/{IntegrationView-X5yvur-x.js → IntegrationView-BhWzXIwC.js} +5 -5
- package/dist/{InventoryBindingForm-CeJZHDY0.js → InventoryBindingForm-DUXi267X.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-9hirHThb.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-OEbKZaki.js} +3 -3
- package/dist/{InventoryBindingSummary-CBg7KhPi.js → InventoryBindingSummary-n8MXgi9j.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BSVs7T4a.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Dh9yMlwd.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-ChZwsyJM.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DJZQPLJd.js} +1 -1
- package/dist/{PublishView-BjvKb7f-.js → PublishView-CStCO6jq.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-CbAMXMPU.js → PurchaseOrderPrintPreview-DsemRJqd.js} +1 -1
- package/dist/{ReceiveRequestView-ihHtocTf.js → ReceiveRequestView-hSmZkcXF.js} +461 -457
- package/dist/{RecipeView-BoR36rGq.js → RecipeView-CASjzWjN.js} +4 -4
- package/dist/{StockView-DcHopPZO.js → StockView-DAE47Gar.js} +7 -7
- package/dist/{SupplierView-V67QXaLX.js → SupplierView-DJ5sjFCK.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-eeL8-QuF.js → TransferDetails.vue_vue_type_script_setup_true_lang-B0V3redE.js} +6 -6
- package/dist/{TransferTemplateView-DKDeo49Q.js → TransferTemplateView-CzwyWTVH.js} +7 -7
- package/dist/{UnitView-BRVRLheN.js → UnitView-BOlT6vPf.js} +3 -3
- package/dist/{WarehouseView-tRg5Hn4L.js → WarehouseView-BZgFhrzl.js} +1 -1
- package/dist/{app-82JEull2.js → app-BLpmMivS.js} +10 -10
- package/dist/app.js +1 -1
- package/dist/{decimal-D-zH_vXe.js → decimal-BWudFkD2.js} +1 -1
- package/dist/{feature-UG6T1t8f.js → feature-w74Z2HB1.js} +2 -2
- package/dist/{format-unit-display-CIPAWL-6.js → format-unit-display-OsvRSLdg.js} +2 -2
- package/dist/{index-B7w4ky-g.js → index-6YcqoCF8.js} +2 -2
- package/dist/{index-BDC93VCL.js → index-CWbNqLx3.js} +1 -1
- package/dist/{stock-Bq9xHemt.js → stock-Dm374eGL.js} +1 -1
- package/dist/{supplier-BrZdgPMN.js → supplier-BXTp-bVu.js} +2 -2
- package/dist/{use-ingredient-select-dialog-Dzy7PO1j.js → use-ingredient-select-dialog-B6T6j_P1.js} +1 -1
- package/dist/{use-inventory-binding-dialog-DT4t22Eb.js → use-inventory-binding-dialog-Diszlqrb.js} +1 -1
- package/dist/{vue-i18n-D5ETg5F3.js → vue-i18n-CpE-ShBy.js} +295 -295
- package/package.json +3 -3
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { reactive as vt, onMounted as Be, watch as be, computed as
|
|
2
|
-
import { b as
|
|
3
|
-
import { u as Je, a as Jt, P as Ye, b as Wt, _ as Gt, g as es } from "./TransferDetails.vue_vue_type_script_setup_true_lang-
|
|
4
|
-
import { _ as kt, u as ts, i as ss, e as as } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { reactive as vt, onMounted as Be, watch as be, computed as U, h as j, defineComponent as re, openBlock as k, createElementBlock as T, Fragment as ne, renderList as Ie, createElementVNode as l, toDisplayString as R, unref as s, resolveComponent as D, createVNode as c, withCtx as P, createCommentVNode as B, ref as q, createBlock as Q, normalizeClass as Y, normalizeStyle as yt, createTextVNode as Te, nextTick as wt, mergeProps as Qe, isRef as Fe, createSlots as Ft, Teleport as $t, normalizeProps as It, guardReactiveProps as Dt } from "vue";
|
|
2
|
+
import { b as qe, P as bt, l as Oe, i as $e, a6 as Ke, Q as Tt, at as Vt, A as Ue, M as Pt, m as gt, ad as Xe, E as de, ak as Rt, a as Le, au as Et, av as At, aw as Ot, J as _t, u as Ze, ax as Ut, ay as qt, a5 as Mt, $ as Nt, az as zt, C as ht, a1 as Bt, d as Ae, w as Lt, x as Ht, y as jt, aA as ze, a7 as dt, z as Yt, N as Qt, H as Kt, _ as Xt, B as Zt, V as ct } from "./app-BLpmMivS.js";
|
|
3
|
+
import { u as Je, a as Jt, P as Ye, b as Wt, _ as Gt, g as es } from "./TransferDetails.vue_vue_type_script_setup_true_lang-B0V3redE.js";
|
|
4
|
+
import { _ as kt, u as ts, i as ss, e as as } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DJZQPLJd.js";
|
|
5
5
|
import { u as os } from "./useTabStorage-BkIVScW_.js";
|
|
6
6
|
import { useBreakpoints as We, components as ye, FmButtonVariant as ls, useSnackbar as Ve, useDialog as ns, useProxiedModel as xt } from "@feedmepos/ui-library";
|
|
7
|
-
import { P as
|
|
8
|
-
import { _ as rs, F as is, a as us, b as ds } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import { u as Ge } from "./feature-
|
|
10
|
-
import { c as
|
|
7
|
+
import { P as ae, u as Ct } from "./format-unit-display-OsvRSLdg.js";
|
|
8
|
+
import { _ as rs, F as is, a as us, b as ds } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CKCxgh1z.js";
|
|
9
|
+
import { u as Ge } from "./feature-w74Z2HB1.js";
|
|
10
|
+
import { c as De, u as cs, _ as ms } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DEHSBeuj.js";
|
|
11
11
|
import { useI18n as ge } from "@feedmepos/mf-common";
|
|
12
|
-
import "./FmMultiselectDialog-
|
|
13
|
-
import { u as et } from "./supplier-
|
|
12
|
+
import "./FmMultiselectDialog-D-o5vkyE.js";
|
|
13
|
+
import { u as et } from "./supplier-BXTp-bVu.js";
|
|
14
14
|
import { _ as ps } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
15
|
-
import { u as fs } from "./vue-i18n-
|
|
15
|
+
import { u as fs } from "./vue-i18n-CpE-ShBy.js";
|
|
16
16
|
import "./array-Ca8T3f_G.js";
|
|
17
17
|
var X = /* @__PURE__ */ ((g) => (g.Code = "Code", g.Name = "Name", g.TemplateName = "TemplateName", g.Amount = "Amount", g.Cost = "Cost", g.TotalCost = "TotalCost", g.Delete = "Delete", g))(X || {});
|
|
18
18
|
const vs = () => (ge(), j(
|
|
@@ -24,29 +24,29 @@ const vs = () => (ge(), j(
|
|
|
24
24
|
`Total (${gt()})`
|
|
25
25
|
));
|
|
26
26
|
function ys(g) {
|
|
27
|
-
const { t: x } = ge(), n = vt({}), { breakpoints: i } = We(), _ = Ge(), t =
|
|
27
|
+
const { t: x } = ge(), n = vt({}), { breakpoints: i } = We(), _ = Ge(), t = qe();
|
|
28
28
|
Be(() => {
|
|
29
|
-
for (const
|
|
30
|
-
if (!
|
|
29
|
+
for (const p of g.items) {
|
|
30
|
+
if (!p.totalCost)
|
|
31
31
|
continue;
|
|
32
|
-
const e =
|
|
32
|
+
const e = De(p.sku, p.quantity, p.measurement, {
|
|
33
33
|
supplier: g.supplier
|
|
34
|
-
}), o =
|
|
35
|
-
e ? n[
|
|
34
|
+
}), o = p.totalCost ?? bt.reset();
|
|
35
|
+
e ? n[p.sku._id] = e.amount !== o.amount || e.precision !== o.precision : n[p.sku._id] = !0;
|
|
36
36
|
}
|
|
37
|
-
}), be([() => g.supplier], ([
|
|
37
|
+
}), be([() => g.supplier], ([p]) => {
|
|
38
38
|
for (const e of g.items) {
|
|
39
39
|
if (!e.totalCost || n[e.sku._id] || !d(e.sku))
|
|
40
40
|
continue;
|
|
41
|
-
const o =
|
|
42
|
-
supplier:
|
|
41
|
+
const o = De(e.sku, e.quantity, e.measurement, {
|
|
42
|
+
supplier: p
|
|
43
43
|
});
|
|
44
44
|
g.updateItem({ ...e, totalCost: o });
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
function d(
|
|
48
|
-
var o,
|
|
49
|
-
return !!(((
|
|
47
|
+
function d(p) {
|
|
48
|
+
var o, v, m, y, S, h, F;
|
|
49
|
+
return !!(((v = (o = p.defaultCost) == null ? void 0 : o.costPerUnit) == null ? void 0 : v.amount) ?? ((F = (h = (S = (y = (m = g.supplier) == null ? void 0 : m.supplyItems) == null ? void 0 : y.find((b) => b.skuId === p._id)) == null ? void 0 : S.defaultCost) == null ? void 0 : h.costPerUnit) == null ? void 0 : F.amount));
|
|
50
50
|
}
|
|
51
51
|
const C = [
|
|
52
52
|
{
|
|
@@ -54,8 +54,8 @@ function ys(g) {
|
|
|
54
54
|
header: () => x("inventory.transfer.form.items.table.Code"),
|
|
55
55
|
accessorKey: "code",
|
|
56
56
|
size: 200,
|
|
57
|
-
cell(
|
|
58
|
-
const e =
|
|
57
|
+
cell(p) {
|
|
58
|
+
const e = p.row.original;
|
|
59
59
|
return t.isEnabled ? j(
|
|
60
60
|
ye.FmTooltip,
|
|
61
61
|
{
|
|
@@ -90,8 +90,8 @@ function ys(g) {
|
|
|
90
90
|
id: "Name",
|
|
91
91
|
header: () => x("inventory.transfer.form.items.table.Name"),
|
|
92
92
|
minSize: 300,
|
|
93
|
-
cell(
|
|
94
|
-
const e =
|
|
93
|
+
cell(p) {
|
|
94
|
+
const e = p.row.original;
|
|
95
95
|
return t.isEnabled ? j(
|
|
96
96
|
ye.FmTooltip,
|
|
97
97
|
{
|
|
@@ -127,8 +127,8 @@ function ys(g) {
|
|
|
127
127
|
header: () => x("inventory.transfer.form.items.table.Name"),
|
|
128
128
|
minSize: 300,
|
|
129
129
|
enableSorting: !1,
|
|
130
|
-
cell(
|
|
131
|
-
const e =
|
|
130
|
+
cell(p) {
|
|
131
|
+
const e = p.row.original, o = e.code, v = e.name;
|
|
132
132
|
return j(
|
|
133
133
|
ye.FmTooltip,
|
|
134
134
|
{ zIndex: 50 },
|
|
@@ -138,7 +138,7 @@ function ys(g) {
|
|
|
138
138
|
j(
|
|
139
139
|
"div",
|
|
140
140
|
{ class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
|
|
141
|
-
|
|
141
|
+
v
|
|
142
142
|
),
|
|
143
143
|
j(
|
|
144
144
|
"div",
|
|
@@ -150,7 +150,7 @@ function ys(g) {
|
|
|
150
150
|
]);
|
|
151
151
|
},
|
|
152
152
|
content() {
|
|
153
|
-
return
|
|
153
|
+
return v;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
);
|
|
@@ -160,9 +160,9 @@ function ys(g) {
|
|
|
160
160
|
id: "Amount",
|
|
161
161
|
header: () => x("inventory.transfer.form.items.table.Amount"),
|
|
162
162
|
minSize: 200,
|
|
163
|
-
cell(
|
|
164
|
-
var
|
|
165
|
-
const e =
|
|
163
|
+
cell(p) {
|
|
164
|
+
var v, m, y, S;
|
|
165
|
+
const e = p.row.original, o = (y = (m = (v = g.template) == null ? void 0 : v.purchaseOrder) == null ? void 0 : m.items) == null ? void 0 : y.find(
|
|
166
166
|
(h) => h.sku._id === e.sku._id
|
|
167
167
|
);
|
|
168
168
|
return j(rs, {
|
|
@@ -182,7 +182,7 @@ function ys(g) {
|
|
|
182
182
|
quantity: h.amount,
|
|
183
183
|
measurement: h.measurement
|
|
184
184
|
};
|
|
185
|
-
_.enableTotalCost && (F.totalCost =
|
|
185
|
+
_.enableTotalCost && (F.totalCost = De(
|
|
186
186
|
F.sku,
|
|
187
187
|
F.quantity,
|
|
188
188
|
F.measurement,
|
|
@@ -199,12 +199,12 @@ function ys(g) {
|
|
|
199
199
|
disabled: g.disabled,
|
|
200
200
|
rules: [
|
|
201
201
|
is(
|
|
202
|
-
|
|
202
|
+
+$e(
|
|
203
203
|
((S = e.quantity) == null ? void 0 : S.amount) === 0 ? { amount: 0, precision: 0 } : (o == null ? void 0 : o.minimumQuantity) ?? { amount: 0, precision: 0 }
|
|
204
204
|
)
|
|
205
205
|
),
|
|
206
206
|
us(
|
|
207
|
-
o != null && o.maximumQuantity ?
|
|
207
|
+
o != null && o.maximumQuantity ? +$e(o == null ? void 0 : o.maximumQuantity) : 1 / 0
|
|
208
208
|
),
|
|
209
209
|
...o != null && o.quantityStep ? [ds(o.quantityStep)] : []
|
|
210
210
|
],
|
|
@@ -217,81 +217,77 @@ function ys(g) {
|
|
|
217
217
|
id: "Cost",
|
|
218
218
|
header: vs,
|
|
219
219
|
size: 180,
|
|
220
|
-
cell(
|
|
221
|
-
const e =
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
220
|
+
cell(p) {
|
|
221
|
+
const e = p.row.original, o = d(e.sku), v = i.value.xs || i.value.sm;
|
|
222
|
+
if (!n[e.sku._id] && o) {
|
|
223
|
+
const m = De(e.sku, e.quantity, e.measurement, {
|
|
224
|
+
supplier: g.supplier
|
|
225
|
+
});
|
|
226
|
+
return j(
|
|
227
|
+
"div",
|
|
228
|
+
{
|
|
229
|
+
class: [
|
|
230
|
+
"flex gap-4 fm-typo-en-body-md-400 items-center",
|
|
231
|
+
g.disabled ? "text-fm-color-typo-disabled" : ""
|
|
232
|
+
],
|
|
233
|
+
key: e.sku._id
|
|
234
|
+
},
|
|
235
|
+
[
|
|
236
|
+
j(ye.FmButton, {
|
|
237
|
+
prependIcon: "edit",
|
|
238
|
+
variant: ls.Tertiary,
|
|
239
|
+
disabled: g.disabled,
|
|
240
|
+
onClick() {
|
|
241
|
+
g.updateItem({
|
|
242
|
+
...e,
|
|
243
|
+
totalCost: m
|
|
244
|
+
}), n[e.sku._id] = !0;
|
|
245
|
+
}
|
|
246
|
+
}),
|
|
247
|
+
j(
|
|
248
|
+
"div",
|
|
249
|
+
{
|
|
250
|
+
class: "flex flex-col"
|
|
251
|
+
},
|
|
252
|
+
[
|
|
253
|
+
j(
|
|
254
|
+
"span",
|
|
255
|
+
v ? Ke(m) : $e(m)
|
|
256
|
+
),
|
|
257
|
+
j(
|
|
258
|
+
"span",
|
|
259
|
+
{
|
|
260
|
+
class: [
|
|
261
|
+
"fm-typo-en-body-sm-400",
|
|
262
|
+
g.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
|
|
263
|
+
]
|
|
264
|
+
},
|
|
265
|
+
x("inventory.transfer.form.items.autoCalculated")
|
|
261
266
|
)
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
g.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
|
|
269
|
-
]
|
|
270
|
-
},
|
|
271
|
-
x("inventory.transfer.form.items.autoCalculated")
|
|
272
|
-
)
|
|
273
|
-
]
|
|
274
|
-
)
|
|
275
|
-
]
|
|
276
|
-
) : j(
|
|
267
|
+
]
|
|
268
|
+
)
|
|
269
|
+
]
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
return j(
|
|
277
273
|
ye.FmTextField,
|
|
278
274
|
{
|
|
279
|
-
modelValue:
|
|
275
|
+
modelValue: $e(e.totalCost ?? { amount: 0, precision: 0 }),
|
|
280
276
|
key: e.sku._id,
|
|
281
|
-
"onUpdate:modelValue": (
|
|
277
|
+
"onUpdate:modelValue": (m) => {
|
|
282
278
|
g.updateItem({
|
|
283
279
|
...e,
|
|
284
280
|
totalCost: {
|
|
285
|
-
...Tt(+
|
|
281
|
+
...Tt(+m),
|
|
286
282
|
currency: Vt()
|
|
287
283
|
}
|
|
288
284
|
});
|
|
289
285
|
},
|
|
290
|
-
rules: [
|
|
286
|
+
rules: [Ue(0), Pt(2)]
|
|
291
287
|
},
|
|
292
288
|
{
|
|
293
289
|
prepend() {
|
|
294
|
-
return
|
|
290
|
+
return v ? j(
|
|
295
291
|
"div",
|
|
296
292
|
{
|
|
297
293
|
class: [
|
|
@@ -312,7 +308,7 @@ function ys(g) {
|
|
|
312
308
|
...e,
|
|
313
309
|
// NOTE: different from PO template, if a default cost is reenabled,
|
|
314
310
|
// the total cost will automatically assigned
|
|
315
|
-
totalCost:
|
|
311
|
+
totalCost: De(e.sku, e.quantity, e.measurement, {
|
|
316
312
|
supplier: g.supplier
|
|
317
313
|
})
|
|
318
314
|
}), n[e.sku._id] = !1;
|
|
@@ -327,8 +323,8 @@ function ys(g) {
|
|
|
327
323
|
{
|
|
328
324
|
id: "Delete",
|
|
329
325
|
header: "",
|
|
330
|
-
cell(
|
|
331
|
-
const e =
|
|
326
|
+
cell(p) {
|
|
327
|
+
const e = p.row.original;
|
|
332
328
|
return j("div", { class: "flex justify-end" }, [
|
|
333
329
|
j(ye.FmButton, {
|
|
334
330
|
key: e.sku._id,
|
|
@@ -353,8 +349,8 @@ function ys(g) {
|
|
|
353
349
|
}
|
|
354
350
|
];
|
|
355
351
|
return {
|
|
356
|
-
columnDefs:
|
|
357
|
-
(
|
|
352
|
+
columnDefs: U(() => _.enableTotalCost && g.transferType === ae.PURCHASE ? C : C.filter(
|
|
353
|
+
(p) => p.id !== "Cost"
|
|
358
354
|
/* Cost */
|
|
359
355
|
))
|
|
360
356
|
};
|
|
@@ -370,7 +366,7 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
370
366
|
return x.suppliers.find((_) => _._id === i);
|
|
371
367
|
}
|
|
372
368
|
return (i, _) => (k(), T("div", bs, [
|
|
373
|
-
(k(!0), T(ne, null,
|
|
369
|
+
(k(!0), T(ne, null, Ie(Object.keys(i.prices), (t) => {
|
|
374
370
|
var d;
|
|
375
371
|
return k(), T("div", {
|
|
376
372
|
key: t,
|
|
@@ -378,7 +374,7 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
378
374
|
}, [
|
|
379
375
|
l("div", gs, R((d = n(t)) == null ? void 0 : d.name), 1),
|
|
380
376
|
l("div", _s, [
|
|
381
|
-
(k(!0), T(ne, null,
|
|
377
|
+
(k(!0), T(ne, null, Ie(i.prices[t].slice(0, 3), (C) => {
|
|
382
378
|
var $;
|
|
383
379
|
return k(), T("div", {
|
|
384
380
|
key: C.date,
|
|
@@ -387,7 +383,7 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
387
383
|
l("div", hs, [
|
|
388
384
|
l("span", null, R(C.totalCost ? s(Ke)(C.totalCost) : "No data"), 1),
|
|
389
385
|
_[0] || (_[0] = l("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
|
|
390
|
-
l("span", null, R(s(
|
|
386
|
+
l("span", null, R(s($e)(C.totalUnit, !1)), 1),
|
|
391
387
|
l("span", null, R((($ = C.measurement) == null ? void 0 : $.abbrev) ?? C.unit.abbrev), 1)
|
|
392
388
|
]),
|
|
393
389
|
l("div", ks, [
|
|
@@ -416,7 +412,7 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
416
412
|
setup(g) {
|
|
417
413
|
const { t: x } = ge();
|
|
418
414
|
return (n, i) => {
|
|
419
|
-
var d, C, $,
|
|
415
|
+
var d, C, $, p, e, o, v, m, y, S, h, F, b, w, L, H, N, K, J, A, E, V, r, u, O, oe, W;
|
|
420
416
|
const _ = D("FmLabel"), t = D("FmSpacer");
|
|
421
417
|
return k(), T("div", xs, [
|
|
422
418
|
l("div", Cs, [
|
|
@@ -427,7 +423,7 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
427
423
|
l("div", null, [
|
|
428
424
|
c(s(de), {
|
|
429
425
|
render: ($ = (C = (d = n.cellByColId.Delete) == null ? void 0 : d.column) == null ? void 0 : C.columnDef) == null ? void 0 : $.cell,
|
|
430
|
-
props: (e = (
|
|
426
|
+
props: (e = (p = n.cellByColId.Delete) == null ? void 0 : p.getContext) == null ? void 0 : e.call(p)
|
|
431
427
|
}, null, 8, ["render", "props"])
|
|
432
428
|
])
|
|
433
429
|
]),
|
|
@@ -437,8 +433,8 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
437
433
|
label: s(x)(`inventory.transfer.form.items.table.${s(X).Code}`)
|
|
438
434
|
}, null, 8, ["label"]),
|
|
439
435
|
c(s(de), {
|
|
440
|
-
render: (
|
|
441
|
-
props: (S = (
|
|
436
|
+
render: (m = (v = (o = n.cellByColId[s(X).Code]) == null ? void 0 : o.column) == null ? void 0 : v.columnDef) == null ? void 0 : m.cell,
|
|
437
|
+
props: (S = (y = n.cellByColId[s(X).Code]) == null ? void 0 : y.getContext) == null ? void 0 : S.call(y)
|
|
442
438
|
}, null, 8, ["render", "props"]),
|
|
443
439
|
i[0] || (i[0] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
444
440
|
]),
|
|
@@ -447,7 +443,7 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
447
443
|
label: s(x)(`inventory.transfer.form.items.table.${s(X).Name}`)
|
|
448
444
|
}, null, 8, ["label"]),
|
|
449
445
|
c(s(de), {
|
|
450
|
-
render: (
|
|
446
|
+
render: (b = (F = (h = n.cellByColId[s(X).Name]) == null ? void 0 : h.column) == null ? void 0 : F.columnDef) == null ? void 0 : b.cell,
|
|
451
447
|
props: (L = (w = n.cellByColId[s(X).Name]) == null ? void 0 : w.getContext) == null ? void 0 : L.call(w)
|
|
452
448
|
}, null, 8, ["render", "props"]),
|
|
453
449
|
i[1] || (i[1] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
@@ -460,7 +456,7 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
460
456
|
}, null, 8, ["label"]),
|
|
461
457
|
c(s(de), {
|
|
462
458
|
render: (K = (N = (H = n.cellByColId[s(X).Amount]) == null ? void 0 : H.column) == null ? void 0 : N.columnDef) == null ? void 0 : K.cell,
|
|
463
|
-
props: (A = (
|
|
459
|
+
props: (A = (J = n.cellByColId[s(X).Amount]) == null ? void 0 : J.getContext) == null ? void 0 : A.call(J)
|
|
464
460
|
}, null, 8, ["render", "props"]),
|
|
465
461
|
i[2] || (i[2] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
466
462
|
]),
|
|
@@ -483,7 +479,7 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
483
479
|
n.showComparePrice && Object.keys(n.comparePriceBySku[(oe = n.row.original.sku) == null ? void 0 : oe._id] ?? {}).length > 0 ? (k(), T(ne, { key: 0 }, [
|
|
484
480
|
c(t, { class: "h-8" }),
|
|
485
481
|
c(St, {
|
|
486
|
-
prices: n.comparePriceBySku[(
|
|
482
|
+
prices: n.comparePriceBySku[(W = n.row.original.sku) == null ? void 0 : W._id]
|
|
487
483
|
}, null, 8, ["prices"])
|
|
488
484
|
], 64)) : B("", !0)
|
|
489
485
|
]);
|
|
@@ -491,7 +487,7 @@ const bs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
491
487
|
}
|
|
492
488
|
});
|
|
493
489
|
function Es(g) {
|
|
494
|
-
const x =
|
|
490
|
+
const x = U({
|
|
495
491
|
get() {
|
|
496
492
|
const t = g.getEffectiveAt();
|
|
497
493
|
return t ? new Date(t) : null;
|
|
@@ -499,21 +495,21 @@ function Es(g) {
|
|
|
499
495
|
set(t) {
|
|
500
496
|
g.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
|
|
501
497
|
}
|
|
502
|
-
}), n =
|
|
498
|
+
}), n = U({
|
|
503
499
|
get() {
|
|
504
500
|
return !!x.value;
|
|
505
501
|
},
|
|
506
502
|
set(t) {
|
|
507
503
|
t ? x.value = /* @__PURE__ */ new Date() : x.value = null;
|
|
508
504
|
}
|
|
509
|
-
}), i =
|
|
505
|
+
}), i = U({
|
|
510
506
|
get() {
|
|
511
507
|
return x.value === null ? "" : Xe(x.value);
|
|
512
508
|
},
|
|
513
509
|
set(t) {
|
|
514
510
|
t ? x.value = /* @__PURE__ */ new Date(`${t} ${_.value}`) : x.value = null;
|
|
515
511
|
}
|
|
516
|
-
}), _ =
|
|
512
|
+
}), _ = U({
|
|
517
513
|
get() {
|
|
518
514
|
return x.value === null ? "" : Rt(x.value);
|
|
519
515
|
},
|
|
@@ -534,7 +530,7 @@ const As = {
|
|
|
534
530
|
viewBox: "0 0 24 24",
|
|
535
531
|
fill: "none",
|
|
536
532
|
xmlns: "http://www.w3.org/2000/svg"
|
|
537
|
-
}, Os = ["fill"],
|
|
533
|
+
}, Os = ["fill"], Us = ["fill"], qs = ["stroke"], Ms = ["stroke"], Ns = /* @__PURE__ */ re({
|
|
538
534
|
__name: "SparkIcon",
|
|
539
535
|
props: {
|
|
540
536
|
size: {
|
|
@@ -555,14 +551,14 @@ const As = {
|
|
|
555
551
|
l("path", {
|
|
556
552
|
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",
|
|
557
553
|
fill: g.color
|
|
558
|
-
}, null, 8,
|
|
554
|
+
}, null, 8, Us),
|
|
559
555
|
l("path", {
|
|
560
556
|
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",
|
|
561
557
|
stroke: g.color,
|
|
562
558
|
"stroke-width": "1.5",
|
|
563
559
|
"stroke-linecap": "round",
|
|
564
560
|
"stroke-linejoin": "round"
|
|
565
|
-
}, null, 8,
|
|
561
|
+
}, null, 8, qs),
|
|
566
562
|
l("path", {
|
|
567
563
|
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",
|
|
568
564
|
stroke: g.color,
|
|
@@ -579,8 +575,8 @@ const As = {
|
|
|
579
575
|
},
|
|
580
576
|
emits: ["update:poItems"],
|
|
581
577
|
setup(g, { emit: x }) {
|
|
582
|
-
const n = x, i =
|
|
583
|
-
async function
|
|
578
|
+
const n = x, i = q(!1), _ = q(7), t = ts(), d = Ve(), C = Le(), { t: $ } = ge();
|
|
579
|
+
async function p() {
|
|
584
580
|
if (_.value < 1)
|
|
585
581
|
return;
|
|
586
582
|
i.value = !1, await t.readPurchaseOrder(_.value);
|
|
@@ -592,25 +588,25 @@ const As = {
|
|
|
592
588
|
});
|
|
593
589
|
return;
|
|
594
590
|
}
|
|
595
|
-
const o = t.purchaseOrderForecast.skus.reduce((
|
|
596
|
-
const
|
|
597
|
-
if (
|
|
598
|
-
return
|
|
591
|
+
const o = t.purchaseOrderForecast.skus.reduce((v, m) => {
|
|
592
|
+
const y = C.skus.find((F) => F._id === m.id);
|
|
593
|
+
if (v.find((F) => F.sku._id === m.id) || !y)
|
|
594
|
+
return v;
|
|
599
595
|
const h = {
|
|
600
|
-
sku:
|
|
601
|
-
code:
|
|
602
|
-
name:
|
|
596
|
+
sku: y,
|
|
597
|
+
code: y.code,
|
|
598
|
+
name: y.name,
|
|
603
599
|
quantity: {
|
|
604
|
-
amount:
|
|
600
|
+
amount: m.amount,
|
|
605
601
|
precision: 0
|
|
606
602
|
}
|
|
607
603
|
};
|
|
608
|
-
return
|
|
604
|
+
return v.push(h), v;
|
|
609
605
|
}, e);
|
|
610
606
|
n("update:poItems", o);
|
|
611
607
|
}
|
|
612
608
|
return (e, o) => {
|
|
613
|
-
const
|
|
609
|
+
const v = D("FmButton"), m = D("FmIcon"), y = D("FmStepperField"), S = D("FmPopover");
|
|
614
610
|
return k(), Q(S, {
|
|
615
611
|
disabled: e.disabled,
|
|
616
612
|
class: "flex",
|
|
@@ -618,7 +614,7 @@ const As = {
|
|
|
618
614
|
onPopoverChanged: o[3] || (o[3] = (h) => i.value = h)
|
|
619
615
|
}, {
|
|
620
616
|
"popover-button": P(() => [
|
|
621
|
-
c(
|
|
617
|
+
c(v, {
|
|
622
618
|
label: "unused",
|
|
623
619
|
variant: "secondary",
|
|
624
620
|
"text-color": e.disabled ? "disabled" : "primary",
|
|
@@ -649,22 +645,22 @@ const As = {
|
|
|
649
645
|
_: 1
|
|
650
646
|
})
|
|
651
647
|
]),
|
|
652
|
-
c(
|
|
648
|
+
c(v, {
|
|
653
649
|
icon: "close",
|
|
654
650
|
size: "md",
|
|
655
651
|
variant: "tertiary",
|
|
656
652
|
onClick: o[0] || (o[0] = (h) => i.value = !1)
|
|
657
653
|
})
|
|
658
654
|
]),
|
|
659
|
-
c(
|
|
655
|
+
c(y, {
|
|
660
656
|
modelValue: _.value,
|
|
661
657
|
"onUpdate:modelValue": o[1] || (o[1] = (h) => _.value = h),
|
|
662
658
|
label: s($)("inventory.transfer.form.items.forecastStock.days"),
|
|
663
|
-
rules: [s(
|
|
659
|
+
rules: [s(Ue)(1)]
|
|
664
660
|
}, {
|
|
665
661
|
"helper-text": P(() => [
|
|
666
662
|
l("div", Qs, [
|
|
667
|
-
c(
|
|
663
|
+
c(m, {
|
|
668
664
|
name: "warning",
|
|
669
665
|
size: "sm",
|
|
670
666
|
class: "text-fm-color-system-warning-300"
|
|
@@ -676,14 +672,14 @@ const As = {
|
|
|
676
672
|
}, 8, ["modelValue", "label", "rules"]),
|
|
677
673
|
l("div", Xs, [
|
|
678
674
|
o[4] || (o[4] = l("div", { class: "grow" }, null, -1)),
|
|
679
|
-
c(
|
|
675
|
+
c(v, {
|
|
680
676
|
label: s($)("common.cancel"),
|
|
681
677
|
variant: "tertiary",
|
|
682
678
|
onClick: o[2] || (o[2] = (h) => i.value = !1)
|
|
683
679
|
}, null, 8, ["label"]),
|
|
684
|
-
c(
|
|
680
|
+
c(v, {
|
|
685
681
|
label: s($)("inventory.transfer.form.items.forecastStock.generate"),
|
|
686
|
-
onClick:
|
|
682
|
+
onClick: p
|
|
687
683
|
}, null, 8, ["label"])
|
|
688
684
|
])
|
|
689
685
|
])
|
|
@@ -694,7 +690,7 @@ const As = {
|
|
|
694
690
|
}
|
|
695
691
|
});
|
|
696
692
|
function Zs() {
|
|
697
|
-
const g = Ve(), x = Je(), n =
|
|
693
|
+
const g = Ve(), x = Je(), n = q(!1);
|
|
698
694
|
be(n, (d) => {
|
|
699
695
|
d && (_.value = !0, i().finally(() => {
|
|
700
696
|
_.value = !1;
|
|
@@ -704,22 +700,22 @@ function Zs() {
|
|
|
704
700
|
try {
|
|
705
701
|
const { startDate: d, endDate: C } = Et(6), e = (await x.getPurchaseOrders({ start: d, end: C })).filter(
|
|
706
702
|
(o) => {
|
|
707
|
-
var
|
|
708
|
-
return o.status === At.enum.COMPLETE && ((
|
|
703
|
+
var v, m;
|
|
704
|
+
return o.status === At.enum.COMPLETE && ((v = o.supplier) == null ? void 0 : v.internal) !== "warehouse" && ((m = o.supplier) == null ? void 0 : m.internal) !== "restaurant";
|
|
709
705
|
}
|
|
710
|
-
).reduce((o,
|
|
711
|
-
const
|
|
712
|
-
for (const S of
|
|
706
|
+
).reduce((o, v) => {
|
|
707
|
+
const m = new Date(Ot(v._id)), y = v.supplier._id;
|
|
708
|
+
for (const S of v.items) {
|
|
713
709
|
if (!S.totalCost) continue;
|
|
714
|
-
const h = o[S.sku._id] ?? {}, F = h[
|
|
710
|
+
const h = o[S.sku._id] ?? {}, F = h[y] ?? [];
|
|
715
711
|
F.push({
|
|
716
|
-
date:
|
|
712
|
+
date: m.toISOString(),
|
|
717
713
|
totalUnit: S.quantity,
|
|
718
714
|
totalCost: S.totalCost,
|
|
719
715
|
unit: S.sku.unit,
|
|
720
716
|
measurement: S.measurement,
|
|
721
|
-
seqNumber:
|
|
722
|
-
}), h[
|
|
717
|
+
seqNumber: v.seqNumber
|
|
718
|
+
}), h[y] = F, o[S.sku._id] = h;
|
|
723
719
|
}
|
|
724
720
|
return o;
|
|
725
721
|
}, {});
|
|
@@ -731,7 +727,7 @@ function Zs() {
|
|
|
731
727
|
}), n.value = !1;
|
|
732
728
|
}
|
|
733
729
|
}
|
|
734
|
-
const _ =
|
|
730
|
+
const _ = q(!1), t = q({});
|
|
735
731
|
return {
|
|
736
732
|
comparePricesToggle: n,
|
|
737
733
|
comparePriceFetching: _,
|
|
@@ -760,14 +756,14 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
760
756
|
"bg-fm-color-neutral-gray-100": n.row.getIsSelected()
|
|
761
757
|
}])
|
|
762
758
|
}, [
|
|
763
|
-
(k(!0), T(ne, null,
|
|
764
|
-
var C, $,
|
|
759
|
+
(k(!0), T(ne, null, Ie(n.row.getVisibleCells(), (d) => {
|
|
760
|
+
var C, $, p, e;
|
|
765
761
|
return k(), T("td", {
|
|
766
762
|
key: d.id,
|
|
767
763
|
class: Y(["h-[56px] text-fm-color-typo-primary", ((C = x(d)) == null ? void 0 : C.cellClass) ?? "px-16"]),
|
|
768
764
|
style: yt({
|
|
769
765
|
width: ($ = x(d)) == null ? void 0 : $.width,
|
|
770
|
-
maxWidth: (
|
|
766
|
+
maxWidth: (p = x(d)) == null ? void 0 : p.maxWidth,
|
|
771
767
|
textAlign: ((e = x(d)) == null ? void 0 : e.textAlign) ?? "left"
|
|
772
768
|
})
|
|
773
769
|
}, [
|
|
@@ -810,9 +806,9 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
810
806
|
},
|
|
811
807
|
emits: ["netsuite:ready"],
|
|
812
808
|
setup(g, { emit: x }) {
|
|
813
|
-
const n =
|
|
809
|
+
const n = qe(), i = g, _ = x, { t } = fs(), d = q(!1), C = q();
|
|
814
810
|
Be(() => {
|
|
815
|
-
var o,
|
|
811
|
+
var o, v, m, y;
|
|
816
812
|
let e = {
|
|
817
813
|
id: "",
|
|
818
814
|
subsidiary: { id: "", name: "" },
|
|
@@ -837,39 +833,39 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
837
833
|
name: S.name
|
|
838
834
|
}
|
|
839
835
|
};
|
|
840
|
-
const h = n.getAvailableItems(S.id), F = i.items.filter((
|
|
841
|
-
if (
|
|
836
|
+
const h = n.getAvailableItems(S.id), F = i.items.filter((b) => {
|
|
837
|
+
if (b.measurement != null) {
|
|
842
838
|
const w = n.getAvailableMeasurements(
|
|
843
|
-
|
|
839
|
+
b.sku._id,
|
|
844
840
|
S.id
|
|
845
841
|
);
|
|
846
|
-
return h.includes(
|
|
842
|
+
return h.includes(b.sku._id) && w.includes(b.measurement.id);
|
|
847
843
|
}
|
|
848
|
-
return h.includes(
|
|
849
|
-
}).map((
|
|
844
|
+
return h.includes(b.sku._id);
|
|
845
|
+
}).map((b) => b.sku._id);
|
|
850
846
|
i.onChange(
|
|
851
|
-
i.items.filter((
|
|
847
|
+
i.items.filter((b) => F.includes(b.sku._id)),
|
|
852
848
|
e
|
|
853
849
|
);
|
|
854
850
|
} finally {
|
|
855
851
|
i.supplier.internal ? C.value = n.getNetSuiteLocation(
|
|
856
852
|
`${i.supplier.internal}_${i.supplier._id}`
|
|
857
853
|
) : C.value = n.getNetSuiteVendor(i.supplier._id);
|
|
858
|
-
const S = i.supplier.internal ? n.getLocationSubsidiary((o = C.value) == null ? void 0 : o.netSuiteId).id : (
|
|
854
|
+
const S = i.supplier.internal ? n.getLocationSubsidiary((o = C.value) == null ? void 0 : o.netSuiteId).id : (v = C.value) == null ? void 0 : v.subsidiaryId, h = i.supplier.internal ? (m = n.currentLocationSubsidiary()) == null ? void 0 : m.id : (y = n.currentVendorSubsidiary(i.supplier._id)) == null ? void 0 : y.id;
|
|
859
855
|
!n.isEnabled || S && n.isEnabled && S == h ? _("netsuite:ready", e) : d.value = !0;
|
|
860
856
|
}
|
|
861
857
|
});
|
|
862
|
-
const $ =
|
|
858
|
+
const $ = U(
|
|
863
859
|
() => i.supplier.internal ? n.currentLocationSubsidiary() : n.currentVendorSubsidiary(i.supplier._id)
|
|
864
|
-
),
|
|
860
|
+
), p = U(() => {
|
|
865
861
|
var e, o;
|
|
866
862
|
return C.value == null ? `Cannot find the NetSuite location for "${i.supplier.name}"` : `The subsidiary of the request
|
|
867
863
|
location is ${(o = n.getLocationSubsidiary((e = C.value) == null ? void 0 : e.netSuiteId)) == null ? void 0 : o.fullName}`;
|
|
868
864
|
});
|
|
869
865
|
return (e, o) => {
|
|
870
|
-
const
|
|
866
|
+
const v = D("FmLabel"), m = D("FmIcon"), y = D("FmField"), S = D("FmTooltip");
|
|
871
867
|
return s(n).isEnabled && i.required ? (k(), T("div", ta, [
|
|
872
|
-
c(
|
|
868
|
+
c(v, {
|
|
873
869
|
label: `NetSuite ${s(t)("inventory.transfer.form.netsuite.subsidiary")}`
|
|
874
870
|
}, null, 8, ["label"]),
|
|
875
871
|
l("div", sa, [
|
|
@@ -882,12 +878,12 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
882
878
|
Te("This field is locked and based on the location of the request.")
|
|
883
879
|
])),
|
|
884
880
|
default: P(() => [
|
|
885
|
-
c(
|
|
881
|
+
c(y, null, {
|
|
886
882
|
default: P(() => {
|
|
887
883
|
var h;
|
|
888
884
|
return [
|
|
889
885
|
l("div", aa, [
|
|
890
|
-
c(
|
|
886
|
+
c(m, {
|
|
891
887
|
name: "lock_outline",
|
|
892
888
|
size: "sm",
|
|
893
889
|
color: e.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
@@ -903,7 +899,7 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
903
899
|
]),
|
|
904
900
|
_: 1
|
|
905
901
|
}, 8, ["disabled"]),
|
|
906
|
-
d.value ? (k(), T("div", oa, R(
|
|
902
|
+
d.value ? (k(), T("div", oa, R(p.value), 1)) : B("", !0)
|
|
907
903
|
])
|
|
908
904
|
])) : B("", !0);
|
|
909
905
|
};
|
|
@@ -929,29 +925,37 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
929
925
|
},
|
|
930
926
|
emits: ["validation-success", "form:ready"],
|
|
931
927
|
setup(g, { expose: x, emit: n }) {
|
|
932
|
-
const i = g, _ = n, t = _t(), { t: d } = ge(), C = Ze(), $ = Le(),
|
|
928
|
+
const i = g, _ = n, t = _t(), { t: d } = ge(), C = Ze(), $ = Le(), p = qe(), e = et(), o = Ge(), v = Ct(), { breakpoints: m } = We(), y = U(() => m.value.xs || m.value.sm), S = vt({
|
|
933
929
|
value: !1
|
|
934
|
-
}), h =
|
|
930
|
+
}), h = q(!1), F = U(
|
|
935
931
|
() => {
|
|
936
932
|
var a;
|
|
937
|
-
return ((a = i.modelValue) == null ? void 0 : a.templateDoc) ??
|
|
933
|
+
return ((a = i.modelValue) == null ? void 0 : a.templateDoc) ?? v.templates.find((f) => f._id === t.template);
|
|
938
934
|
}
|
|
939
|
-
),
|
|
935
|
+
), b = U(() => t.status === "DRAFT" || !t._rev);
|
|
940
936
|
be(F, (a) => {
|
|
941
|
-
a &&
|
|
937
|
+
if (a && b.value) {
|
|
938
|
+
const f = e.suppliers.find(
|
|
939
|
+
(M) => {
|
|
940
|
+
var Z;
|
|
941
|
+
return M._id === ((Z = a.purchaseOrder.supplier) == null ? void 0 : Z._id);
|
|
942
|
+
}
|
|
943
|
+
);
|
|
944
|
+
t.supplier = f ?? t.supplier;
|
|
945
|
+
}
|
|
942
946
|
}), Be(() => {
|
|
943
947
|
var a;
|
|
944
948
|
try {
|
|
945
|
-
if (t.items = t.items.map((
|
|
949
|
+
if (t.items = t.items.map((f) => ({ ...f, id: f.id ?? f.sku._id })), !t.template) return;
|
|
946
950
|
t.items.length || (t.items = ((a = F.value) == null ? void 0 : a.purchaseOrder.items) ?? []);
|
|
947
951
|
} finally {
|
|
948
952
|
h.value = !0;
|
|
949
953
|
}
|
|
950
|
-
}), be([h, S], ([a,
|
|
951
|
-
|
|
954
|
+
}), be([h, S], ([a, f], [M, Z]) => {
|
|
955
|
+
f.value && Z.value && _("form:ready");
|
|
952
956
|
});
|
|
953
|
-
const w =
|
|
954
|
-
() => C.currentLocation.type ===
|
|
957
|
+
const w = U(
|
|
958
|
+
() => C.currentLocation.type === Ut.restaurant
|
|
955
959
|
);
|
|
956
960
|
C.watchLocation(async () => {
|
|
957
961
|
location && (t.supplier || (t.supplier = e.suppliers.find((a) => a) ?? t.supplier));
|
|
@@ -963,15 +967,15 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
963
967
|
},
|
|
964
968
|
!0,
|
|
965
969
|
!0
|
|
966
|
-
), N =
|
|
970
|
+
), N = U({
|
|
967
971
|
get() {
|
|
968
972
|
var a;
|
|
969
|
-
return typeof ((a = t == null ? void 0 : t.supplier) == null ? void 0 : a.internal) == "string" ?
|
|
973
|
+
return typeof ((a = t == null ? void 0 : t.supplier) == null ? void 0 : a.internal) == "string" ? ae.TRANSFER : ae.PURCHASE;
|
|
970
974
|
},
|
|
971
975
|
set(a) {
|
|
972
976
|
var M;
|
|
973
|
-
const
|
|
974
|
-
a !==
|
|
977
|
+
const f = typeof ((M = t == null ? void 0 : t.supplier) == null ? void 0 : M.internal) == "string" ? ae.TRANSFER : ae.PURCHASE;
|
|
978
|
+
a !== f && (t.supplier = a === ae.PURCHASE ? H.locationOptionsTypePurchase.value[0] : H.locationOptionsTypeTransfer.value[0]);
|
|
975
979
|
}
|
|
976
980
|
});
|
|
977
981
|
be(
|
|
@@ -981,21 +985,21 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
981
985
|
},
|
|
982
986
|
(a) => {
|
|
983
987
|
o.mustUsePoTemplate && !a && wt(() => {
|
|
984
|
-
var
|
|
985
|
-
t.supplier = ((M = (
|
|
986
|
-
(
|
|
988
|
+
var f, M;
|
|
989
|
+
t.supplier = ((M = (f = H.locationOptionsTypeTransfer.value) == null ? void 0 : f.filter(
|
|
990
|
+
(Z) => Z.internal === "restaurant"
|
|
987
991
|
)) == null ? void 0 : M[0]) ?? t.supplier;
|
|
988
992
|
});
|
|
989
993
|
},
|
|
990
994
|
{ immediate: !0 }
|
|
991
995
|
);
|
|
992
|
-
const K =
|
|
996
|
+
const K = U(() => {
|
|
993
997
|
let a = H.transferLocationOptions.value;
|
|
994
|
-
return o.mustUsePoTemplate && !t.template && (a = a.filter((
|
|
998
|
+
return o.mustUsePoTemplate && !t.template && (a = a.filter((f) => {
|
|
995
999
|
var M;
|
|
996
|
-
return (M =
|
|
1000
|
+
return (M = f.sublabel) == null ? void 0 : M.startsWith("restaurant");
|
|
997
1001
|
})), a;
|
|
998
|
-
}),
|
|
1002
|
+
}), J = U({
|
|
999
1003
|
get() {
|
|
1000
1004
|
var a;
|
|
1001
1005
|
return (a = t.supplier) == null ? void 0 : a._id;
|
|
@@ -1003,7 +1007,7 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1003
1007
|
set(a) {
|
|
1004
1008
|
H.transferLocationModel.value = a;
|
|
1005
1009
|
}
|
|
1006
|
-
}), A =
|
|
1010
|
+
}), A = U({
|
|
1007
1011
|
get() {
|
|
1008
1012
|
return t.remark ?? void 0;
|
|
1009
1013
|
},
|
|
@@ -1017,32 +1021,32 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1017
1021
|
setEffectiveAt(a) {
|
|
1018
1022
|
t.effectiveAt = a;
|
|
1019
1023
|
}
|
|
1020
|
-
}), { comparePricesToggle: O, comparePriceFetching: oe, comparePriceBySku:
|
|
1024
|
+
}), { comparePricesToggle: O, comparePriceFetching: oe, comparePriceBySku: W } = Zs(), ce = q();
|
|
1021
1025
|
x({
|
|
1022
1026
|
validateInputs: () => {
|
|
1023
|
-
var a,
|
|
1024
|
-
(
|
|
1027
|
+
var a, f;
|
|
1028
|
+
(f = (a = ce.value) == null ? void 0 : a.validateInputs) == null || f.call(a);
|
|
1025
1029
|
},
|
|
1026
1030
|
resetInputsValidation: () => {
|
|
1027
|
-
var a,
|
|
1028
|
-
(
|
|
1031
|
+
var a, f;
|
|
1032
|
+
(f = (a = ce.value) == null ? void 0 : a.resetInputsValidation) == null || f.call(a);
|
|
1029
1033
|
},
|
|
1030
1034
|
resetInputs: () => {
|
|
1031
|
-
var a,
|
|
1032
|
-
(
|
|
1035
|
+
var a, f;
|
|
1036
|
+
(f = (a = ce.value) == null ? void 0 : a.resetInputs) == null || f.call(a);
|
|
1033
1037
|
}
|
|
1034
1038
|
});
|
|
1035
|
-
const ie =
|
|
1039
|
+
const ie = U(() => ({
|
|
1036
1040
|
updateItem: (a) => {
|
|
1037
|
-
const
|
|
1038
|
-
t.items = t.items.map((M) => M.id && M.id !== a.id || !M.id && M.sku._id !== a.sku._id ? M :
|
|
1041
|
+
const f = qt.parse(a);
|
|
1042
|
+
t.items = t.items.map((M) => M.id && M.id !== a.id || !M.id && M.sku._id !== a.sku._id ? M : f);
|
|
1039
1043
|
},
|
|
1040
1044
|
deleteItem: (a) => {
|
|
1041
1045
|
t.items = t.items.filter(
|
|
1042
|
-
(
|
|
1046
|
+
(f) => f.id ? f.id !== a.id : f.sku._id !== a.sku._id
|
|
1043
1047
|
);
|
|
1044
1048
|
}
|
|
1045
|
-
})),
|
|
1049
|
+
})), he = ys({
|
|
1046
1050
|
updateItem: (a) => ie.value.updateItem(a),
|
|
1047
1051
|
deleteItem: (a) => ie.value.deleteItem(a),
|
|
1048
1052
|
get supplier() {
|
|
@@ -1060,42 +1064,42 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1060
1064
|
get disabled() {
|
|
1061
1065
|
return i.disabled;
|
|
1062
1066
|
}
|
|
1063
|
-
}), Me =
|
|
1067
|
+
}), Me = U(() => he.columnDefs.value);
|
|
1064
1068
|
function Ne() {
|
|
1065
|
-
var pe, _e, fe,
|
|
1066
|
-
const a = (fe = (_e = (pe = F.value) == null ? void 0 : pe.purchaseOrder) == null ? void 0 : _e.items) == null ? void 0 : fe.groupBy((z) => z.sku._id),
|
|
1067
|
-
var
|
|
1068
|
-
const
|
|
1069
|
+
var pe, _e, fe, Ce, Se;
|
|
1070
|
+
const a = (fe = (_e = (pe = F.value) == null ? void 0 : pe.purchaseOrder) == null ? void 0 : _e.items) == null ? void 0 : fe.groupBy((z) => z.sku._id), f = p.isEnabled ? p.getAvailableItems((Se = (Ce = t.netSuite) == null ? void 0 : Ce.subsidiary) == null ? void 0 : Se.id) : [], M = a != null && a.size ? $.skus.filter((z) => a.has(z._id)) : $.skus, Z = p.isEnabled ? M.filter((z) => {
|
|
1071
|
+
var se, ee, le, ue;
|
|
1072
|
+
const G = (ee = (se = F.value) == null ? void 0 : se.purchaseOrder) == null ? void 0 : ee.items.find(
|
|
1069
1073
|
(ve) => ve.sku._id === z._id
|
|
1070
1074
|
);
|
|
1071
|
-
if (
|
|
1072
|
-
const ve =
|
|
1073
|
-
|
|
1075
|
+
if (G != null && G.measurement != null) {
|
|
1076
|
+
const ve = p.getAvailableMeasurements(
|
|
1077
|
+
G.sku._id,
|
|
1074
1078
|
(ue = (le = t.netSuite) == null ? void 0 : le.subsidiary) == null ? void 0 : ue.id
|
|
1075
1079
|
);
|
|
1076
|
-
return
|
|
1080
|
+
return f.includes(G.sku._id) && ve.includes(G.measurement.id);
|
|
1077
1081
|
}
|
|
1078
|
-
return
|
|
1082
|
+
return f.includes(z._id);
|
|
1079
1083
|
}).map((z) => z._id) : M.map((z) => z._id), me = M.map(
|
|
1080
1084
|
(z) => {
|
|
1081
|
-
var
|
|
1085
|
+
var G, se, ee, le;
|
|
1082
1086
|
return {
|
|
1083
|
-
label: ((
|
|
1084
|
-
sublabel: ((le = (
|
|
1087
|
+
label: ((se = (G = a == null ? void 0 : a.get(z._id)) == null ? void 0 : G[0]) == null ? void 0 : se.name) ?? z.name,
|
|
1088
|
+
sublabel: ((le = (ee = a == null ? void 0 : a.get(z._id)) == null ? void 0 : ee[0]) == null ? void 0 : le.code) ?? z.code,
|
|
1085
1089
|
value: z,
|
|
1086
|
-
disabled: !
|
|
1090
|
+
disabled: !Z.includes(z._id)
|
|
1087
1091
|
};
|
|
1088
1092
|
}
|
|
1089
|
-
),
|
|
1090
|
-
var
|
|
1091
|
-
return (
|
|
1093
|
+
), xe = me.filter((z) => {
|
|
1094
|
+
var G;
|
|
1095
|
+
return (G = t.items) == null ? void 0 : G.find((se) => se.sku._id === z.value._id);
|
|
1092
1096
|
}).map((z) => z.value);
|
|
1093
1097
|
L.open({
|
|
1094
1098
|
title: d("inventory.transfer.form.items.selectItem"),
|
|
1095
1099
|
closeButton: !0,
|
|
1096
1100
|
contentComponent: Bt,
|
|
1097
1101
|
contentComponentProps: {
|
|
1098
|
-
modelValue:
|
|
1102
|
+
modelValue: xe,
|
|
1099
1103
|
items: me,
|
|
1100
1104
|
virtualScroll: !0
|
|
1101
1105
|
},
|
|
@@ -1109,23 +1113,23 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1109
1113
|
variant: "tertiary"
|
|
1110
1114
|
}
|
|
1111
1115
|
}).onPrimary((z) => {
|
|
1112
|
-
const
|
|
1116
|
+
const G = t.items ?? [], se = z.map((ee) => {
|
|
1113
1117
|
var ve, Re;
|
|
1114
|
-
const le =
|
|
1118
|
+
const le = G.find((we) => we.sku._id === ee._id);
|
|
1115
1119
|
if (le)
|
|
1116
1120
|
return le;
|
|
1117
1121
|
const ue = ((Re = (ve = F.value) == null ? void 0 : ve.purchaseOrder.items) == null ? void 0 : Re.find(
|
|
1118
|
-
(
|
|
1122
|
+
(we) => we.sku._id === ee._id
|
|
1119
1123
|
)) ?? {
|
|
1120
|
-
sku:
|
|
1121
|
-
code:
|
|
1122
|
-
name:
|
|
1124
|
+
sku: ee,
|
|
1125
|
+
code: ee.code,
|
|
1126
|
+
name: ee.name,
|
|
1123
1127
|
quantity: {
|
|
1124
1128
|
amount: 1,
|
|
1125
1129
|
precision: 0
|
|
1126
1130
|
}
|
|
1127
1131
|
};
|
|
1128
|
-
return N.value ==
|
|
1132
|
+
return N.value == ae.PURCHASE && (ue.totalCost = De(
|
|
1129
1133
|
ue.sku,
|
|
1130
1134
|
ue.quantity,
|
|
1131
1135
|
ue.measurement,
|
|
@@ -1134,28 +1138,28 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1134
1138
|
}
|
|
1135
1139
|
)), ue;
|
|
1136
1140
|
});
|
|
1137
|
-
|
|
1141
|
+
se.sort((ee, le) => ee.sku.code.localeCompare(le.sku.code)), t.items = se;
|
|
1138
1142
|
});
|
|
1139
1143
|
}
|
|
1140
1144
|
function He(a) {
|
|
1141
1145
|
return a;
|
|
1142
1146
|
}
|
|
1143
|
-
const
|
|
1147
|
+
const ke = U(() => {
|
|
1144
1148
|
const a = [];
|
|
1145
1149
|
return (!o.mustUsePoTemplate || o.mustUsePoTemplate && t.template) && a.push({
|
|
1146
1150
|
label: d("inventory.transfer.form.type.purchase"),
|
|
1147
|
-
value:
|
|
1151
|
+
value: ae.PURCHASE
|
|
1148
1152
|
}), a.push({
|
|
1149
1153
|
label: d("inventory.transfer.form.type.transfer"),
|
|
1150
|
-
value:
|
|
1154
|
+
value: ae.TRANSFER
|
|
1151
1155
|
}), a;
|
|
1152
|
-
}), Pe =
|
|
1156
|
+
}), Pe = U(() => {
|
|
1153
1157
|
var a;
|
|
1154
|
-
return (a = i.modelValue) == null ? void 0 : a.items.every((
|
|
1158
|
+
return (a = i.modelValue) == null ? void 0 : a.items.every((f) => f.quantity.amount <= 0);
|
|
1155
1159
|
});
|
|
1156
|
-
return (a,
|
|
1160
|
+
return (a, f) => {
|
|
1157
1161
|
var ve, Re;
|
|
1158
|
-
const M = D("FmChip"),
|
|
1162
|
+
const M = D("FmChip"), Z = D("FmLabel"), me = D("FmIcon"), xe = D("FmField"), pe = D("FmTooltip"), _e = D("FmSelect"), fe = D("FmTextField"), Ce = D("FmTextarea"), Se = D("FmSwitch"), z = D("FmDatePicker"), G = D("FmTimePicker"), se = D("FmFormGroup"), ee = D("FmButton"), le = D("FmTable"), ue = D("FmForm");
|
|
1159
1163
|
return k(), T("div", na, [
|
|
1160
1164
|
l("div", ra, [
|
|
1161
1165
|
(ve = i.modelValue) != null && ve.template ? (k(), Q(M, {
|
|
@@ -1183,16 +1187,16 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1183
1187
|
class: "flex flex-col gap-32",
|
|
1184
1188
|
disabled: a.disabled,
|
|
1185
1189
|
onValidationFailed: console.log,
|
|
1186
|
-
onValidationSuccess:
|
|
1190
|
+
onValidationSuccess: f[14] || (f[14] = (we) => _("validation-success"))
|
|
1187
1191
|
}, {
|
|
1188
1192
|
default: P(() => {
|
|
1189
|
-
var
|
|
1193
|
+
var we, tt, st, at, ot, lt, nt, rt;
|
|
1190
1194
|
return [
|
|
1191
1195
|
l("div", ia, [
|
|
1192
1196
|
l("div", ua, [
|
|
1193
|
-
(
|
|
1197
|
+
(we = i.modelValue) != null && we.template ? (k(), T(ne, { key: 0 }, [
|
|
1194
1198
|
l("div", da, [
|
|
1195
|
-
c(
|
|
1199
|
+
c(Z, {
|
|
1196
1200
|
label: s(d)("inventory.transfer.form.type.title")
|
|
1197
1201
|
}, null, 8, ["label"]),
|
|
1198
1202
|
l("div", ca, [
|
|
@@ -1201,11 +1205,11 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1201
1205
|
placement: "left",
|
|
1202
1206
|
disabled: a.disabled
|
|
1203
1207
|
}, {
|
|
1204
|
-
content: P(() =>
|
|
1208
|
+
content: P(() => f[15] || (f[15] = [
|
|
1205
1209
|
Te("This field is locked from template.")
|
|
1206
1210
|
])),
|
|
1207
1211
|
default: P(() => [
|
|
1208
|
-
c(
|
|
1212
|
+
c(xe, null, {
|
|
1209
1213
|
default: P(() => [
|
|
1210
1214
|
l("div", ma, [
|
|
1211
1215
|
c(me, {
|
|
@@ -1232,8 +1236,8 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1232
1236
|
])
|
|
1233
1237
|
]),
|
|
1234
1238
|
l("div", pa, [
|
|
1235
|
-
c(
|
|
1236
|
-
label: N.value === s(
|
|
1239
|
+
c(Z, {
|
|
1240
|
+
label: N.value === s(ae).PURCHASE ? s(d)("inventory.transfer.form.purchaseFrom") : s(d)("inventory.transfer.form.transferFrom")
|
|
1237
1241
|
}, null, 8, ["label"]),
|
|
1238
1242
|
l("div", fa, [
|
|
1239
1243
|
c(pe, {
|
|
@@ -1241,11 +1245,11 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1241
1245
|
placement: "left",
|
|
1242
1246
|
disabled: a.disabled
|
|
1243
1247
|
}, {
|
|
1244
|
-
content: P(() =>
|
|
1248
|
+
content: P(() => f[16] || (f[16] = [
|
|
1245
1249
|
Te("This field is locked from template.")
|
|
1246
1250
|
])),
|
|
1247
1251
|
default: P(() => [
|
|
1248
|
-
c(
|
|
1252
|
+
c(xe, null, {
|
|
1249
1253
|
default: P(() => {
|
|
1250
1254
|
var I;
|
|
1251
1255
|
return [
|
|
@@ -1257,7 +1261,7 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1257
1261
|
}, null, 8, ["color"]),
|
|
1258
1262
|
l("div", {
|
|
1259
1263
|
class: Y({ "text-fm-color-typo-disabled": a.disabled })
|
|
1260
|
-
}, R((I = K.value.find((
|
|
1264
|
+
}, R((I = K.value.find((te) => te.value === J.value)) == null ? void 0 : I.label), 3)
|
|
1261
1265
|
])
|
|
1262
1266
|
];
|
|
1263
1267
|
}),
|
|
@@ -1273,9 +1277,9 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1273
1277
|
label: s(d)("inventory.transfer.form.type.title"),
|
|
1274
1278
|
"label-mark": "required",
|
|
1275
1279
|
modelValue: N.value,
|
|
1276
|
-
"onUpdate:modelValue":
|
|
1277
|
-
items:
|
|
1278
|
-
rules: [s(
|
|
1280
|
+
"onUpdate:modelValue": f[0] || (f[0] = (I) => N.value = I),
|
|
1281
|
+
items: ke.value,
|
|
1282
|
+
rules: [s(Ue)(1)(ke.value)]
|
|
1279
1283
|
}, {
|
|
1280
1284
|
default: P(() => [
|
|
1281
1285
|
l("span", {
|
|
@@ -1288,19 +1292,19 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1288
1292
|
_: 1
|
|
1289
1293
|
}, 8, ["label", "modelValue", "items", "rules"]),
|
|
1290
1294
|
c(_e, {
|
|
1291
|
-
label: N.value === s(
|
|
1295
|
+
label: N.value === s(ae).PURCHASE ? s(d)("inventory.transfer.form.purchaseFrom") : s(d)("inventory.transfer.form.transferFrom"),
|
|
1292
1296
|
"label-mark": "required",
|
|
1293
|
-
modelValue:
|
|
1294
|
-
"onUpdate:modelValue":
|
|
1297
|
+
modelValue: J.value,
|
|
1298
|
+
"onUpdate:modelValue": f[1] || (f[1] = (I) => J.value = I),
|
|
1295
1299
|
items: K.value,
|
|
1296
|
-
rules: [s(
|
|
1300
|
+
rules: [s(Ue)(1)(K.value)]
|
|
1297
1301
|
}, {
|
|
1298
1302
|
"menu-wrapper": P((I) => {
|
|
1299
|
-
var
|
|
1303
|
+
var te, Ee;
|
|
1300
1304
|
return [
|
|
1301
1305
|
c(ms, Qe(I, {
|
|
1302
1306
|
items: K.value,
|
|
1303
|
-
"model-value": (Ee = (
|
|
1307
|
+
"model-value": (Ee = (te = a.modelValue) == null ? void 0 : te.supplier) == null ? void 0 : Ee._id
|
|
1304
1308
|
}), null, 16, ["items", "model-value"])
|
|
1305
1309
|
];
|
|
1306
1310
|
}),
|
|
@@ -1312,7 +1316,7 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1312
1316
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
1313
1317
|
a.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
1314
1318
|
])
|
|
1315
|
-
}, R((I = K.value.find((
|
|
1319
|
+
}, R((I = K.value.find((te) => te.value === J.value)) == null ? void 0 : I.label), 3)
|
|
1316
1320
|
];
|
|
1317
1321
|
}),
|
|
1318
1322
|
_: 1
|
|
@@ -1322,14 +1326,14 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1322
1326
|
label: s(d)("inventory.transfer.form.reference"),
|
|
1323
1327
|
"label-mark": "optional",
|
|
1324
1328
|
modelValue: s(t).ref,
|
|
1325
|
-
"onUpdate:modelValue":
|
|
1329
|
+
"onUpdate:modelValue": f[2] || (f[2] = (I) => s(t).ref = I)
|
|
1326
1330
|
}, null, 8, ["label", "modelValue"]),
|
|
1327
|
-
c(
|
|
1331
|
+
c(Ce, {
|
|
1328
1332
|
label: s(d)("inventory.transfer.form.remark"),
|
|
1329
1333
|
"label-mark": "optional",
|
|
1330
1334
|
"max-length": 240,
|
|
1331
1335
|
modelValue: A.value,
|
|
1332
|
-
"onUpdate:modelValue":
|
|
1336
|
+
"onUpdate:modelValue": f[3] || (f[3] = (I) => A.value = I),
|
|
1333
1337
|
class: Y([a.disabled ? "text-fm-color-typo-disabled " : ""])
|
|
1334
1338
|
}, null, 8, ["label", "modelValue", "class"]),
|
|
1335
1339
|
h.value ? (k(), Q(la, {
|
|
@@ -1339,10 +1343,10 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1339
1343
|
supplier: s(t).supplier,
|
|
1340
1344
|
setting: s(t).netSuite,
|
|
1341
1345
|
items: s(t).items,
|
|
1342
|
-
onChange: (I,
|
|
1343
|
-
s(t).items = I, s(t).netSuite =
|
|
1346
|
+
onChange: (I, te) => {
|
|
1347
|
+
s(t).items = I, s(t).netSuite = te;
|
|
1344
1348
|
},
|
|
1345
|
-
"onNetsuite:ready":
|
|
1349
|
+
"onNetsuite:ready": f[4] || (f[4] = (I) => {
|
|
1346
1350
|
S.value = !0;
|
|
1347
1351
|
})
|
|
1348
1352
|
}, null, 8, ["required", "disabled", "supplier", "setting", "items", "onChange"])) : B("", !0),
|
|
@@ -1351,40 +1355,40 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1351
1355
|
class: Y([
|
|
1352
1356
|
"flex",
|
|
1353
1357
|
{
|
|
1354
|
-
"flex-col":
|
|
1358
|
+
"flex-col": y.value
|
|
1355
1359
|
}
|
|
1356
1360
|
])
|
|
1357
1361
|
}, [
|
|
1358
|
-
c(
|
|
1362
|
+
c(Se, {
|
|
1359
1363
|
modelValue: s(V),
|
|
1360
|
-
"onUpdate:modelValue":
|
|
1364
|
+
"onUpdate:modelValue": f[5] || (f[5] = (I) => Fe(V) ? V.value = I : null),
|
|
1361
1365
|
label: s(d)("inventory.transfer.form.backdate.title"),
|
|
1362
1366
|
sublabel: s(d)("inventory.transfer.form.backdate.subtitle"),
|
|
1363
1367
|
"label-placement": "right",
|
|
1364
1368
|
disabled: w.value && !a.lastClosingDate || a.disabled
|
|
1365
1369
|
}, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
|
|
1366
1370
|
l("div", {
|
|
1367
|
-
class: Y({ hidden:
|
|
1371
|
+
class: Y({ hidden: y.value, "w-16": !y.value })
|
|
1368
1372
|
}, null, 2),
|
|
1369
1373
|
s(V) ? (k(), T("div", ba, [
|
|
1370
1374
|
l("div", ga, [
|
|
1371
1375
|
c(z, {
|
|
1372
1376
|
modelValue: s(r),
|
|
1373
|
-
"onUpdate:modelValue":
|
|
1377
|
+
"onUpdate:modelValue": f[6] || (f[6] = (I) => Fe(r) ? r.value = I : null)
|
|
1374
1378
|
}, null, 8, ["modelValue"])
|
|
1375
1379
|
]),
|
|
1376
1380
|
l("div", _a, [
|
|
1377
|
-
c(
|
|
1381
|
+
c(G, {
|
|
1378
1382
|
modelValue: s(u),
|
|
1379
|
-
"onUpdate:modelValue":
|
|
1383
|
+
"onUpdate:modelValue": f[7] || (f[7] = (I) => Fe(u) ? u.value = I : null)
|
|
1380
1384
|
}, null, 8, ["modelValue"])
|
|
1381
1385
|
])
|
|
1382
1386
|
])) : B("", !0)
|
|
1383
1387
|
], 2),
|
|
1384
|
-
s(E) ? (k(), Q(
|
|
1388
|
+
s(E) ? (k(), Q(se, {
|
|
1385
1389
|
key: 0,
|
|
1386
1390
|
modelValue: s(E),
|
|
1387
|
-
"onUpdate:modelValue":
|
|
1391
|
+
"onUpdate:modelValue": f[8] || (f[8] = (I) => Fe(E) ? E.value = I : null),
|
|
1388
1392
|
rules: [s(zt)(new Date(a.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
1389
1393
|
}, null, 8, ["modelValue", "rules"])) : B("", !0),
|
|
1390
1394
|
w.value && !a.lastClosingDate ? (k(), T("div", ha, [
|
|
@@ -1399,22 +1403,22 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1399
1403
|
])
|
|
1400
1404
|
]),
|
|
1401
1405
|
l("div", xa, [
|
|
1402
|
-
c(
|
|
1406
|
+
c(se, {
|
|
1403
1407
|
"model-value": s(t).items,
|
|
1404
|
-
rules: [s(
|
|
1408
|
+
rules: [s(Ue)(1)]
|
|
1405
1409
|
}, null, 8, ["model-value", "rules"]),
|
|
1406
1410
|
l("div", {
|
|
1407
1411
|
class: Y([
|
|
1408
1412
|
"flex gap-16",
|
|
1409
1413
|
{
|
|
1410
|
-
"flex-col items-start":
|
|
1411
|
-
"items-center": !
|
|
1414
|
+
"flex-col items-start": y.value,
|
|
1415
|
+
"items-center": !y.value
|
|
1412
1416
|
}
|
|
1413
1417
|
])
|
|
1414
1418
|
}, [
|
|
1415
1419
|
l("div", Ca, R(s(d)("inventory.transfer.form.items.title")), 1),
|
|
1416
1420
|
l("div", Sa, [
|
|
1417
|
-
c(
|
|
1421
|
+
c(ee, {
|
|
1418
1422
|
disabled: a.disabled,
|
|
1419
1423
|
label: s(d)("inventory.transfer.form.items.addItem"),
|
|
1420
1424
|
"prepend-icon": "add",
|
|
@@ -1422,7 +1426,7 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1422
1426
|
"text-color": "primary",
|
|
1423
1427
|
"bg-color": "transparent",
|
|
1424
1428
|
"border-color": "primary",
|
|
1425
|
-
onClick:
|
|
1429
|
+
onClick: f[9] || (f[9] = (I) => Ne()),
|
|
1426
1430
|
size: "md"
|
|
1427
1431
|
}, null, 8, ["disabled", "label"]),
|
|
1428
1432
|
s(t).template ? (k(), Q(pe, {
|
|
@@ -1434,29 +1438,29 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1434
1438
|
]),
|
|
1435
1439
|
default: P(() => [
|
|
1436
1440
|
c(mt, {
|
|
1437
|
-
"onUpdate:poItems":
|
|
1441
|
+
"onUpdate:poItems": f[10] || (f[10] = (I) => s(t).items = I),
|
|
1438
1442
|
disabled: ""
|
|
1439
1443
|
})
|
|
1440
1444
|
]),
|
|
1441
1445
|
_: 1
|
|
1442
1446
|
})) : (k(), Q(mt, {
|
|
1443
1447
|
key: 1,
|
|
1444
|
-
"onUpdate:poItems":
|
|
1448
|
+
"onUpdate:poItems": f[11] || (f[11] = (I) => s(t).items = I),
|
|
1445
1449
|
disabled: a.disabled || !!s(t).template
|
|
1446
1450
|
}, null, 8, ["disabled"]))
|
|
1447
1451
|
])
|
|
1448
1452
|
], 2),
|
|
1449
|
-
N.value === s(
|
|
1450
|
-
c(
|
|
1453
|
+
N.value === s(ae).PURCHASE && b.value && s(o).enableTotalCost && ((tt = a.modelValue) != null && tt.items.length) ? (k(), T("div", wa, [
|
|
1454
|
+
c(Se, {
|
|
1451
1455
|
label: s(oe) ? s(d)("inventory.transfer.form.items.fetchingData") : s(d)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1452
1456
|
"prepend-icon": "compare_arrows",
|
|
1453
1457
|
"label-placement": "right",
|
|
1454
1458
|
"model-value": s(O),
|
|
1455
|
-
"onUpdate:modelValue":
|
|
1459
|
+
"onUpdate:modelValue": f[12] || (f[12] = (I) => Fe(O) ? O.value = I : null),
|
|
1456
1460
|
disabled: s(oe) || a.disabled
|
|
1457
1461
|
}, null, 8, ["label", "model-value", "disabled"])
|
|
1458
1462
|
])) : B("", !0),
|
|
1459
|
-
c(
|
|
1463
|
+
c(se, {
|
|
1460
1464
|
"model-value": Pe.value,
|
|
1461
1465
|
rules: [() => Pe.value ? "Must have at least one non-zero item" : !0]
|
|
1462
1466
|
}, null, 8, ["model-value", "rules"]),
|
|
@@ -1473,16 +1477,16 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1473
1477
|
"page-size": s(t).items.length
|
|
1474
1478
|
}, {
|
|
1475
1479
|
"table-row": P((I) => {
|
|
1476
|
-
var
|
|
1480
|
+
var te, Ee, it, ut;
|
|
1477
1481
|
return [
|
|
1478
1482
|
c(ea, {
|
|
1479
|
-
"compare-price-by-sku": s(
|
|
1480
|
-
"show-compare-price": N.value === s(
|
|
1483
|
+
"compare-price-by-sku": s(W),
|
|
1484
|
+
"show-compare-price": N.value === s(ae).PURCHASE && s(O),
|
|
1481
1485
|
row: I,
|
|
1482
|
-
"template-item": (ut = (it = (Ee = (
|
|
1486
|
+
"template-item": (ut = (it = (Ee = (te = a.modelValue) == null ? void 0 : te.templateDoc) == null ? void 0 : Ee.purchaseOrder) == null ? void 0 : it.items) == null ? void 0 : ut.find(
|
|
1483
1487
|
(je) => je.sku._id === I.original.sku._id
|
|
1484
1488
|
),
|
|
1485
|
-
"onUpdate:item":
|
|
1489
|
+
"onUpdate:item": f[13] || (f[13] = (je) => ie.value.updateItem(je)),
|
|
1486
1490
|
disabled: a.disabled
|
|
1487
1491
|
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "template-item", "disabled"])
|
|
1488
1492
|
];
|
|
@@ -1490,14 +1494,14 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1490
1494
|
"list-row": P((I) => [
|
|
1491
1495
|
(k(), Q(ht, {
|
|
1492
1496
|
row: I,
|
|
1493
|
-
key: s(t).items.map((
|
|
1497
|
+
key: s(t).items.map((te) => te.sku._id).join(".")
|
|
1494
1498
|
}, {
|
|
1495
|
-
default: P((
|
|
1499
|
+
default: P((te) => [
|
|
1496
1500
|
c(Rs, {
|
|
1497
|
-
"compare-price-by-sku": s(
|
|
1498
|
-
"show-compare-price": N.value === s(
|
|
1501
|
+
"compare-price-by-sku": s(W),
|
|
1502
|
+
"show-compare-price": N.value === s(ae).PURCHASE && s(O),
|
|
1499
1503
|
row: I,
|
|
1500
|
-
"cell-by-col-id":
|
|
1504
|
+
"cell-by-col-id": te
|
|
1501
1505
|
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
|
|
1502
1506
|
]),
|
|
1503
1507
|
_: 2
|
|
@@ -1525,12 +1529,12 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1525
1529
|
emits: ["update:show", "submitted"],
|
|
1526
1530
|
setup(g, { expose: x, emit: n }) {
|
|
1527
1531
|
var V;
|
|
1528
|
-
const i = g, _ = n, t = Je(), d = Ct(), C = Ve(), $ = et(),
|
|
1532
|
+
const i = g, _ = n, t = Je(), d = Ct(), C = Ve(), $ = et(), p = Le(), e = Ze(), { t: o } = ge(), v = q(!1), m = q(!1), y = q(!1);
|
|
1529
1533
|
async function S(r) {
|
|
1530
1534
|
if (r) {
|
|
1531
|
-
|
|
1535
|
+
m.value = !1;
|
|
1532
1536
|
try {
|
|
1533
|
-
await $.readSuppliers(),
|
|
1537
|
+
await $.readSuppliers(), m.value = !0;
|
|
1534
1538
|
} catch {
|
|
1535
1539
|
C.open({
|
|
1536
1540
|
title: o("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
|
|
@@ -1575,15 +1579,15 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1575
1579
|
templateDoc: d.templates.find((u) => u._id === i.templateId)
|
|
1576
1580
|
};
|
|
1577
1581
|
}
|
|
1578
|
-
const F = xt(i, "show"),
|
|
1582
|
+
const F = xt(i, "show"), b = q(i.modelValue ?? h()), w = q(((V = i.modelValue) == null ? void 0 : V._id) ?? `${Math.random()}`);
|
|
1579
1583
|
be(
|
|
1580
1584
|
() => i.show,
|
|
1581
1585
|
(r) => {
|
|
1582
1586
|
var u;
|
|
1583
|
-
r && (
|
|
1587
|
+
r && (y.value = !1, b.value = i.modelValue ?? h(), w.value = ((u = i.modelValue) == null ? void 0 : u._id) ?? `${Math.random()}`);
|
|
1584
1588
|
}
|
|
1585
1589
|
);
|
|
1586
|
-
const L =
|
|
1590
|
+
const L = U(() => !m.value || !y.value), H = U(() => {
|
|
1587
1591
|
switch (i.mode) {
|
|
1588
1592
|
case Ae.READ:
|
|
1589
1593
|
return "View transfer";
|
|
@@ -1593,7 +1597,7 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1593
1597
|
return o("inventory.transfer.receiveRequest.update.title");
|
|
1594
1598
|
}
|
|
1595
1599
|
return "";
|
|
1596
|
-
}), N =
|
|
1600
|
+
}), N = q();
|
|
1597
1601
|
x({
|
|
1598
1602
|
validateInputs: () => {
|
|
1599
1603
|
var r, u;
|
|
@@ -1609,8 +1613,8 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1609
1613
|
}
|
|
1610
1614
|
});
|
|
1611
1615
|
async function K() {
|
|
1612
|
-
const r =
|
|
1613
|
-
if (
|
|
1616
|
+
const r = b.value;
|
|
1617
|
+
if (v.value = !0, r.items = r.items.filter((u) => u.quantity.amount > 0), !r.items.length) {
|
|
1614
1618
|
C.open({
|
|
1615
1619
|
title: "Cannot create order",
|
|
1616
1620
|
message: "There are no items with non-zero amount in your request.",
|
|
@@ -1632,12 +1636,12 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1632
1636
|
type: "error"
|
|
1633
1637
|
}), console.error("Error in creating purchase order", u);
|
|
1634
1638
|
} finally {
|
|
1635
|
-
|
|
1639
|
+
v.value = !1;
|
|
1636
1640
|
}
|
|
1637
1641
|
}
|
|
1638
|
-
async function
|
|
1639
|
-
const r =
|
|
1640
|
-
if (
|
|
1642
|
+
async function J() {
|
|
1643
|
+
const r = b.value;
|
|
1644
|
+
if (v.value = !0, r.items = r.items.filter((u) => u.quantity.amount > 0), !r.items.length) {
|
|
1641
1645
|
C.open({
|
|
1642
1646
|
title: "Cannot create order",
|
|
1643
1647
|
message: "There are no items with non-zero amount in your request.",
|
|
@@ -1659,7 +1663,7 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1659
1663
|
type: "error"
|
|
1660
1664
|
}), console.error("Error in updating purchase order", u);
|
|
1661
1665
|
} finally {
|
|
1662
|
-
|
|
1666
|
+
v.value = !1;
|
|
1663
1667
|
}
|
|
1664
1668
|
}
|
|
1665
1669
|
function A() {
|
|
@@ -1667,7 +1671,7 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1667
1671
|
case Ae.CREATE:
|
|
1668
1672
|
return K();
|
|
1669
1673
|
case Ae.UPDATE:
|
|
1670
|
-
return
|
|
1674
|
+
return J();
|
|
1671
1675
|
}
|
|
1672
1676
|
}
|
|
1673
1677
|
function E() {
|
|
@@ -1678,7 +1682,7 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1678
1682
|
const O = D("FmButton"), oe = D("FmSideSheet");
|
|
1679
1683
|
return k(), Q(oe, {
|
|
1680
1684
|
modelValue: s(F),
|
|
1681
|
-
"onUpdate:modelValue": u[3] || (u[3] = (
|
|
1685
|
+
"onUpdate:modelValue": u[3] || (u[3] = (W) => Fe(F) ? F.value = W : null),
|
|
1682
1686
|
"dismiss-away": "",
|
|
1683
1687
|
"close-button": "",
|
|
1684
1688
|
"max-width": 900
|
|
@@ -1693,13 +1697,13 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1693
1697
|
class: "w-full",
|
|
1694
1698
|
ref_key: "formRef",
|
|
1695
1699
|
ref: N,
|
|
1696
|
-
"onForm:ready": u[0] || (u[0] = () =>
|
|
1700
|
+
"onForm:ready": u[0] || (u[0] = () => y.value = !0),
|
|
1697
1701
|
onValidationSuccess: A,
|
|
1698
|
-
modelValue:
|
|
1699
|
-
"onUpdate:modelValue": u[1] || (u[1] = (
|
|
1700
|
-
disabled:
|
|
1702
|
+
modelValue: b.value,
|
|
1703
|
+
"onUpdate:modelValue": u[1] || (u[1] = (W) => b.value = W),
|
|
1704
|
+
disabled: v.value || L.value,
|
|
1701
1705
|
suppliers: s($).suppliers,
|
|
1702
|
-
skus: s(
|
|
1706
|
+
skus: s(p).skus,
|
|
1703
1707
|
key: w.value,
|
|
1704
1708
|
"last-closing-date": r.lastClosingDate
|
|
1705
1709
|
}, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
|
|
@@ -1707,7 +1711,7 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1707
1711
|
"side-sheet-footer": P(() => [
|
|
1708
1712
|
l("div", Da, [
|
|
1709
1713
|
c(O, {
|
|
1710
|
-
loading:
|
|
1714
|
+
loading: v.value,
|
|
1711
1715
|
disabled: L.value,
|
|
1712
1716
|
label: s(o)("common.save"),
|
|
1713
1717
|
onClick: E
|
|
@@ -1716,7 +1720,7 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1716
1720
|
disabled: L.value,
|
|
1717
1721
|
variant: "tertiary",
|
|
1718
1722
|
label: s(o)("common.close"),
|
|
1719
|
-
onClick: u[2] || (u[2] = (
|
|
1723
|
+
onClick: u[2] || (u[2] = (W) => _("update:show", !1))
|
|
1720
1724
|
}, null, 8, ["disabled", "label"])
|
|
1721
1725
|
])
|
|
1722
1726
|
]),
|
|
@@ -1726,16 +1730,16 @@ const Js = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Ws = { key: 0 }
|
|
|
1726
1730
|
}
|
|
1727
1731
|
});
|
|
1728
1732
|
function Va(g) {
|
|
1729
|
-
const [x, n, i, ..._] = Lt(g), t = i.map((
|
|
1733
|
+
const [x, n, i, ..._] = Lt(g), t = i.map((p) => p.toLowerCase().trim().replace(/ /g, "_")), C = ["item_name", "transfer_quantity(uom)", "uom", "scanned_code"].filter((p) => !t.includes(p));
|
|
1730
1734
|
if (C.length)
|
|
1731
1735
|
throw new Error(
|
|
1732
1736
|
`Missing headers (${C.join()}). Excel file does not come from the template.`
|
|
1733
1737
|
);
|
|
1734
|
-
return _.map((
|
|
1738
|
+
return _.map((p, e) => {
|
|
1735
1739
|
const o = {};
|
|
1736
|
-
for (const
|
|
1737
|
-
const
|
|
1738
|
-
Object.assign(o, { [
|
|
1740
|
+
for (const v in t) {
|
|
1741
|
+
const m = t[v];
|
|
1742
|
+
Object.assign(o, { [m]: p[v] });
|
|
1739
1743
|
}
|
|
1740
1744
|
return {
|
|
1741
1745
|
index: e,
|
|
@@ -1748,35 +1752,35 @@ function Pa(g) {
|
|
|
1748
1752
|
try {
|
|
1749
1753
|
return x.reduce(
|
|
1750
1754
|
(i, _) => {
|
|
1751
|
-
const t = new Array(), d = g.Sheets[_], C = Le(), $ = Va(d),
|
|
1752
|
-
for (const { index: o, data:
|
|
1753
|
-
|
|
1754
|
-
const
|
|
1755
|
-
if (!
|
|
1755
|
+
const t = new Array(), d = g.Sheets[_], C = Le(), $ = Va(d), p = [];
|
|
1756
|
+
for (const { index: o, data: v } of $) {
|
|
1757
|
+
v.scanned_code === "" && t.push(`Row ${o + 1}: Scanned code is empty`), v.item_name === "" && t.push(`Row ${o + 1}: Item name is empty`), v.uom === "" && t.push(`Row ${o + 1}: UOM is empty`), v["transfer_quantity(uom)"] === "" && t.push(`Row ${o + 1}: Transfer quantity is empty`);
|
|
1758
|
+
const m = C.skus.find((h) => h.code === v.scanned_code);
|
|
1759
|
+
if (!m) {
|
|
1756
1760
|
t.push(`Row ${o + 1}: SKU not found`);
|
|
1757
1761
|
continue;
|
|
1758
1762
|
}
|
|
1759
|
-
const
|
|
1763
|
+
const y = m.unit.abbrev === v.uom;
|
|
1760
1764
|
let S = null;
|
|
1761
|
-
if (!
|
|
1762
|
-
const h =
|
|
1765
|
+
if (!y) {
|
|
1766
|
+
const h = m.unit.measurements.find((F) => F.abbrev === v.uom);
|
|
1763
1767
|
if (!h) {
|
|
1764
1768
|
t.push(`Row ${o + 1}: Measurement not found`);
|
|
1765
1769
|
continue;
|
|
1766
1770
|
}
|
|
1767
1771
|
S = h;
|
|
1768
1772
|
}
|
|
1769
|
-
|
|
1770
|
-
sku:
|
|
1771
|
-
code:
|
|
1772
|
-
name:
|
|
1773
|
-
quantity: bt.fromNumber(Number(
|
|
1773
|
+
p.push({
|
|
1774
|
+
sku: m,
|
|
1775
|
+
code: v.scanned_code,
|
|
1776
|
+
name: v.item_name,
|
|
1777
|
+
quantity: bt.fromNumber(Number(v["transfer_quantity(uom)"])),
|
|
1774
1778
|
measurement: S
|
|
1775
1779
|
});
|
|
1776
1780
|
}
|
|
1777
1781
|
const e = {
|
|
1778
1782
|
type: "create",
|
|
1779
|
-
poItems:
|
|
1783
|
+
poItems: p,
|
|
1780
1784
|
excelSheetName: _,
|
|
1781
1785
|
errors: t
|
|
1782
1786
|
};
|
|
@@ -1795,10 +1799,10 @@ function Pa(g) {
|
|
|
1795
1799
|
};
|
|
1796
1800
|
}
|
|
1797
1801
|
}
|
|
1798
|
-
const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = { class: "flex flex-col" }, Oa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" },
|
|
1802
|
+
const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = { class: "flex flex-col" }, Oa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Ua = {
|
|
1799
1803
|
key: 0,
|
|
1800
1804
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
1801
|
-
},
|
|
1805
|
+
}, qa = { key: 0 }, Ma = {
|
|
1802
1806
|
class: /* @__PURE__ */ Y(["fm-typo-en-body-lg-600"])
|
|
1803
1807
|
}, Na = { class: "flex-1" }, za = { class: "flex-auto line-clamp-2 text-ellipsis break-all fm-typo-en-body-sm-400" }, Ba = { class: "flex-auto line-clamp-2 text-ellipsis break-all" }, La = { class: "text-fm-color-typo-primary" }, Ha = { class: "ml-auto" }, ja = { key: 0 }, Ya = /* @__PURE__ */ re({
|
|
1804
1808
|
__name: "XilnexResult",
|
|
@@ -1809,11 +1813,11 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
1809
1813
|
errors: {}
|
|
1810
1814
|
},
|
|
1811
1815
|
setup(g) {
|
|
1812
|
-
const x = g, { t: n } = ge(), i =
|
|
1816
|
+
const x = g, { t: n } = ge(), i = q(!1), _ = () => {
|
|
1813
1817
|
x.errors.length && (i.value = !i.value);
|
|
1814
1818
|
};
|
|
1815
1819
|
return (t, d) => {
|
|
1816
|
-
var
|
|
1820
|
+
var p;
|
|
1817
1821
|
const C = D("FmIcon"), $ = D("FmTooltip");
|
|
1818
1822
|
return k(), T("div", Ea, [
|
|
1819
1823
|
l("div", {
|
|
@@ -1830,9 +1834,9 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
1830
1834
|
})
|
|
1831
1835
|
}, [
|
|
1832
1836
|
Te(R(t.name) + " ", 1),
|
|
1833
|
-
t.type === "create" ? (k(), T("span",
|
|
1837
|
+
t.type === "create" ? (k(), T("span", Ua, "(" + R(s(n)("inventory.closing.template.import.new")) + ")", 1)) : B("", !0)
|
|
1834
1838
|
], 2),
|
|
1835
|
-
t.errors.length ? (k(), T("div",
|
|
1839
|
+
t.errors.length ? (k(), T("div", qa, [
|
|
1836
1840
|
c(C, {
|
|
1837
1841
|
name: "error",
|
|
1838
1842
|
size: "sm",
|
|
@@ -1842,7 +1846,7 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
1842
1846
|
]),
|
|
1843
1847
|
d[0] || (d[0] = l("hr", { class: "my-2" }, null, -1)),
|
|
1844
1848
|
l("div", Ma, [
|
|
1845
|
-
(
|
|
1849
|
+
(p = t.items) != null && p.length ? (k(!0), T(ne, { key: 0 }, Ie(t.items, (e, o) => (k(), T("div", {
|
|
1846
1850
|
key: o,
|
|
1847
1851
|
class: "flex gap-4 mt-2 items-center"
|
|
1848
1852
|
}, [
|
|
@@ -1894,7 +1898,7 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
1894
1898
|
}, [
|
|
1895
1899
|
t.errors.length ? (k(), T("div", ja, [
|
|
1896
1900
|
l("ol", null, [
|
|
1897
|
-
(k(!0), T(ne, null,
|
|
1901
|
+
(k(!0), T(ne, null, Ie(t.errors, (e, o) => (k(), T("li", { key: o }, R(e), 1))), 128))
|
|
1898
1902
|
])
|
|
1899
1903
|
])) : B("", !0)
|
|
1900
1904
|
], 2)) : B("", !0)
|
|
@@ -1916,16 +1920,16 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
1916
1920
|
}, so = { class: "fm-typo-en-body-lg-600" }, pt = "Transfer note", ao = /* @__PURE__ */ re({
|
|
1917
1921
|
__name: "XilnexImportForm",
|
|
1918
1922
|
setup(g, { expose: x }) {
|
|
1919
|
-
const n =
|
|
1920
|
-
|
|
1921
|
-
const
|
|
1923
|
+
const n = q(null), i = Ve(), _ = q(!1), t = q(!1), d = _t(), C = q(!1), $ = qe();
|
|
1924
|
+
q([]);
|
|
1925
|
+
const p = U({
|
|
1922
1926
|
get() {
|
|
1923
|
-
var
|
|
1924
|
-
return ((
|
|
1927
|
+
var b;
|
|
1928
|
+
return ((b = d.supplier) == null ? void 0 : b.name) ?? "";
|
|
1925
1929
|
},
|
|
1926
|
-
set(
|
|
1927
|
-
|
|
1928
|
-
name:
|
|
1930
|
+
set(b) {
|
|
1931
|
+
b && (d.supplier = {
|
|
1932
|
+
name: b,
|
|
1929
1933
|
registrationNumber: "",
|
|
1930
1934
|
_id: "xilnex",
|
|
1931
1935
|
internal: "restaurant",
|
|
@@ -1941,67 +1945,67 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
1941
1945
|
}
|
|
1942
1946
|
});
|
|
1943
1947
|
Be(async () => {
|
|
1944
|
-
const
|
|
1945
|
-
console.log(
|
|
1948
|
+
const b = await $.getNetSuiteLocations();
|
|
1949
|
+
console.log(b), C.value = !0;
|
|
1946
1950
|
});
|
|
1947
|
-
const e =
|
|
1951
|
+
const e = U({
|
|
1948
1952
|
get() {
|
|
1949
1953
|
return "";
|
|
1950
1954
|
},
|
|
1951
|
-
set(
|
|
1952
|
-
if (
|
|
1953
|
-
const w = d.effectiveAt ? new Date(d.effectiveAt) : /* @__PURE__ */ new Date(), [L, H, N] =
|
|
1955
|
+
set(b) {
|
|
1956
|
+
if (b) {
|
|
1957
|
+
const w = d.effectiveAt ? new Date(d.effectiveAt) : /* @__PURE__ */ new Date(), [L, H, N] = b.split("-");
|
|
1954
1958
|
w.setFullYear(parseInt(L)), w.setMonth(parseInt(H) - 1), w.setDate(parseInt(N)), d.effectiveAt = w.toISOString();
|
|
1955
1959
|
}
|
|
1956
1960
|
}
|
|
1957
|
-
}), o =
|
|
1961
|
+
}), o = U({
|
|
1958
1962
|
get() {
|
|
1959
1963
|
return null;
|
|
1960
1964
|
},
|
|
1961
|
-
set(
|
|
1962
|
-
if (
|
|
1963
|
-
const w = d.effectiveAt ? new Date(d.effectiveAt) : /* @__PURE__ */ new Date(), [L, H] =
|
|
1965
|
+
set(b) {
|
|
1966
|
+
if (b) {
|
|
1967
|
+
const w = d.effectiveAt ? new Date(d.effectiveAt) : /* @__PURE__ */ new Date(), [L, H] = b.split(":");
|
|
1964
1968
|
w.setMinutes(parseInt(L)), w.setSeconds(parseInt(H)), d.effectiveAt = w.toISOString();
|
|
1965
1969
|
}
|
|
1966
1970
|
}
|
|
1967
|
-
}),
|
|
1968
|
-
() => !!
|
|
1969
|
-
), S =
|
|
1971
|
+
}), v = q(new Array()), m = q([]), y = U(
|
|
1972
|
+
() => !!v.value.length || m.value.some((b) => b.errors.length)
|
|
1973
|
+
), S = q();
|
|
1970
1974
|
x({
|
|
1971
1975
|
validateInputs: () => {
|
|
1972
|
-
var
|
|
1973
|
-
(w = (
|
|
1976
|
+
var b, w;
|
|
1977
|
+
(w = (b = S.value) == null ? void 0 : b.validateInputs) == null || w.call(b);
|
|
1974
1978
|
},
|
|
1975
1979
|
resetInputsValidation: () => {
|
|
1976
|
-
var
|
|
1977
|
-
(w = (
|
|
1980
|
+
var b, w;
|
|
1981
|
+
(w = (b = S.value) == null ? void 0 : b.resetInputsValidation) == null || w.call(b);
|
|
1978
1982
|
},
|
|
1979
1983
|
resetInputs: () => {
|
|
1980
|
-
var
|
|
1981
|
-
(w = (
|
|
1984
|
+
var b, w;
|
|
1985
|
+
(w = (b = S.value) == null ? void 0 : b.resetInputs) == null || w.call(b);
|
|
1982
1986
|
}
|
|
1983
1987
|
});
|
|
1984
1988
|
const { t: h } = ge();
|
|
1985
|
-
async function F(
|
|
1986
|
-
|
|
1989
|
+
async function F(b) {
|
|
1990
|
+
v.value = [], m.value = [];
|
|
1987
1991
|
try {
|
|
1988
1992
|
_.value = !0;
|
|
1989
1993
|
const [w] = await Promise.all([
|
|
1990
|
-
jt(
|
|
1994
|
+
jt(b),
|
|
1991
1995
|
// fake buffer
|
|
1992
1996
|
new Promise((H) => setTimeout(H, 1e3))
|
|
1993
1997
|
]), L = Pa(w);
|
|
1994
1998
|
if (L.invalidExcel) {
|
|
1995
|
-
|
|
1999
|
+
v.value.push(
|
|
1996
2000
|
L.invalidExcelMessage ?? h("inventory.ingredient.import.fileError.invalidExcel")
|
|
1997
2001
|
);
|
|
1998
2002
|
return;
|
|
1999
2003
|
}
|
|
2000
|
-
if (
|
|
2001
|
-
|
|
2004
|
+
if (m.value = L.importCreateResult, !m.value.length) {
|
|
2005
|
+
v.value.push(h("inventory.ingredient.import.fileError.noData"));
|
|
2002
2006
|
return;
|
|
2003
2007
|
}
|
|
2004
|
-
d.items =
|
|
2008
|
+
d.items = m.value.map((H) => H.poItems).flat();
|
|
2005
2009
|
} catch (w) {
|
|
2006
2010
|
i.open({
|
|
2007
2011
|
title: h("inventory.ingredient.import.fileError.unableToRead"),
|
|
@@ -2009,16 +2013,16 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2009
2013
|
type: "error"
|
|
2010
2014
|
}), console.error("Error in reading file", w);
|
|
2011
2015
|
} finally {
|
|
2012
|
-
|
|
2016
|
+
v.value.length && i.open({
|
|
2013
2017
|
title: h("inventory.ingredient.import.fileError.invalidExcel"),
|
|
2014
2018
|
type: "error"
|
|
2015
2019
|
}), _.value = !1;
|
|
2016
2020
|
}
|
|
2017
2021
|
}
|
|
2018
|
-
return be(n, (
|
|
2019
|
-
|
|
2020
|
-
}), (
|
|
2021
|
-
const L = D("FmSelect"), H = D("FmDatePicker"), N = D("FmTimePicker"), K = D("FmCircularProgress"),
|
|
2022
|
+
return be(n, (b) => {
|
|
2023
|
+
b && F(b);
|
|
2024
|
+
}), (b, w) => {
|
|
2025
|
+
const L = D("FmSelect"), H = D("FmDatePicker"), N = D("FmTimePicker"), K = D("FmCircularProgress"), J = D("FmLabel"), A = D("FmIcon"), E = D("FmButton"), V = D("FmForm");
|
|
2022
2026
|
return k(), Q(V, {
|
|
2023
2027
|
ref_key: "formRef",
|
|
2024
2028
|
ref: S
|
|
@@ -2026,8 +2030,8 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2026
2030
|
default: P(() => [
|
|
2027
2031
|
l("div", Qa, [
|
|
2028
2032
|
c(L, {
|
|
2029
|
-
modelValue:
|
|
2030
|
-
"onUpdate:modelValue": w[0] || (w[0] = (r) =>
|
|
2033
|
+
modelValue: p.value,
|
|
2034
|
+
"onUpdate:modelValue": w[0] || (w[0] = (r) => p.value = r),
|
|
2031
2035
|
label: "Transfer from",
|
|
2032
2036
|
searchable: "",
|
|
2033
2037
|
searchTarget: "label",
|
|
@@ -2077,7 +2081,7 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2077
2081
|
n.value ? {
|
|
2078
2082
|
name: "default",
|
|
2079
2083
|
fn: P(({ openFileDialog: r }) => [
|
|
2080
|
-
c(
|
|
2084
|
+
c(J, null, {
|
|
2081
2085
|
default: P(() => [
|
|
2082
2086
|
Te(R(pt))
|
|
2083
2087
|
]),
|
|
@@ -2089,8 +2093,8 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2089
2093
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
2090
2094
|
{
|
|
2091
2095
|
"border border-fm-color-neutral-gray-100": _.value,
|
|
2092
|
-
"border border-fm-color-neutral-gray-200": !_.value && !
|
|
2093
|
-
"border border-fm-color-system-error-200":
|
|
2096
|
+
"border border-fm-color-neutral-gray-200": !_.value && !y.value,
|
|
2097
|
+
"border border-fm-color-system-error-200": y.value
|
|
2094
2098
|
}
|
|
2095
2099
|
])
|
|
2096
2100
|
}, [
|
|
@@ -2100,9 +2104,9 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2100
2104
|
color: "neutral-gray-200"
|
|
2101
2105
|
})) : (k(), Q(A, {
|
|
2102
2106
|
key: 1,
|
|
2103
|
-
name:
|
|
2107
|
+
name: y.value ? "error" : "attach_file",
|
|
2104
2108
|
outline: "",
|
|
2105
|
-
color:
|
|
2109
|
+
color: y.value ? "system-error-300" : void 0
|
|
2106
2110
|
}, null, 8, ["name", "color"])),
|
|
2107
2111
|
l("div", {
|
|
2108
2112
|
class: Y([
|
|
@@ -2118,14 +2122,14 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2118
2122
|
_.value ? B("", !0) : (k(), T("div", Wa, [
|
|
2119
2123
|
c(E, {
|
|
2120
2124
|
label: s(h)("inventory.ingredient.import.replaceFile"),
|
|
2121
|
-
variant:
|
|
2122
|
-
"prepend-icon":
|
|
2125
|
+
variant: y.value ? "destructive" : "secondary",
|
|
2126
|
+
"prepend-icon": y.value ? void 0 : "autorenew",
|
|
2123
2127
|
onClick: r
|
|
2124
2128
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
2125
2129
|
]))
|
|
2126
2130
|
], 2),
|
|
2127
|
-
|
|
2128
|
-
(k(!0), T(ne, null,
|
|
2131
|
+
v.value.length ? (k(), T("div", Ga, [
|
|
2132
|
+
(k(!0), T(ne, null, Ie(v.value, (u, O) => (k(), T("div", {
|
|
2129
2133
|
key: O,
|
|
2130
2134
|
class: "flex gap-8 items-center"
|
|
2131
2135
|
}, [
|
|
@@ -2144,7 +2148,7 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2144
2148
|
]), 1032, ["class", "button-label"]),
|
|
2145
2149
|
n.value ? (k(), T("div", to, [
|
|
2146
2150
|
l("div", so, R(s(h)("inventory.ingredient.import.summary")), 1),
|
|
2147
|
-
(k(!0), T(ne, null,
|
|
2151
|
+
(k(!0), T(ne, null, Ie(m.value, (r, u) => (k(), Q(Ya, {
|
|
2148
2152
|
key: u,
|
|
2149
2153
|
name: `Transfer Note ${u + 1}`,
|
|
2150
2154
|
items: r.poItems,
|
|
@@ -2166,28 +2170,28 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2166
2170
|
},
|
|
2167
2171
|
emits: ["update:show", "submitted"],
|
|
2168
2172
|
setup(g, { expose: x, emit: n }) {
|
|
2169
|
-
const i = n, t = xt(g, "show"), d = Ve(), C = Je(), $ =
|
|
2173
|
+
const i = n, t = xt(g, "show"), d = Ve(), C = Je(), $ = q(!1), p = q(), e = q();
|
|
2170
2174
|
x({
|
|
2171
2175
|
validateInputs: () => {
|
|
2172
|
-
var
|
|
2173
|
-
(
|
|
2176
|
+
var m, y;
|
|
2177
|
+
(y = (m = p.value) == null ? void 0 : m.validateInputs) == null || y.call(m);
|
|
2174
2178
|
},
|
|
2175
2179
|
resetInputsValidation: () => {
|
|
2176
|
-
var
|
|
2177
|
-
(
|
|
2180
|
+
var m, y;
|
|
2181
|
+
(y = (m = p.value) == null ? void 0 : m.resetInputsValidation) == null || y.call(m);
|
|
2178
2182
|
},
|
|
2179
2183
|
resetInputs: () => {
|
|
2180
|
-
var
|
|
2181
|
-
(
|
|
2184
|
+
var m, y;
|
|
2185
|
+
(y = (m = p.value) == null ? void 0 : m.resetInputs) == null || y.call(m);
|
|
2182
2186
|
}
|
|
2183
2187
|
});
|
|
2184
2188
|
function o() {
|
|
2185
|
-
var
|
|
2186
|
-
(
|
|
2189
|
+
var m, y;
|
|
2190
|
+
(y = (m = p.value) == null ? void 0 : m.validateInputs) == null || y.call(m);
|
|
2187
2191
|
}
|
|
2188
|
-
async function
|
|
2189
|
-
var
|
|
2190
|
-
if (!((S = (
|
|
2192
|
+
async function v() {
|
|
2193
|
+
var y, S, h, F, b;
|
|
2194
|
+
if (!((S = (y = e.value) == null ? void 0 : y.supplier) != null && S.name)) {
|
|
2191
2195
|
d.open({
|
|
2192
2196
|
title: "Upload failed",
|
|
2193
2197
|
message: "Location is required",
|
|
@@ -2195,7 +2199,7 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2195
2199
|
});
|
|
2196
2200
|
return;
|
|
2197
2201
|
}
|
|
2198
|
-
if (!((h = e.value) != null && h.items) || ((
|
|
2202
|
+
if (!((h = e.value) != null && h.items) || ((b = (F = e.value) == null ? void 0 : F.items) == null ? void 0 : b.length) === 0) {
|
|
2199
2203
|
d.open({
|
|
2200
2204
|
title: "Upload failed",
|
|
2201
2205
|
message: "No data to upload",
|
|
@@ -2203,8 +2207,8 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2203
2207
|
});
|
|
2204
2208
|
return;
|
|
2205
2209
|
}
|
|
2206
|
-
const
|
|
2207
|
-
if (!
|
|
2210
|
+
const m = e.value.effectiveAt ? new Date(e.value.effectiveAt) : null;
|
|
2211
|
+
if (!m) {
|
|
2208
2212
|
d.open({
|
|
2209
2213
|
title: "Invalid date",
|
|
2210
2214
|
message: "Transfer date is required",
|
|
@@ -2212,7 +2216,7 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2212
2216
|
});
|
|
2213
2217
|
return;
|
|
2214
2218
|
}
|
|
2215
|
-
if (
|
|
2219
|
+
if (m.getTime() > (/* @__PURE__ */ new Date()).getTime()) {
|
|
2216
2220
|
d.open({
|
|
2217
2221
|
title: "Invalid date",
|
|
2218
2222
|
message: "Transfer date cannot be in the future",
|
|
@@ -2233,15 +2237,15 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2233
2237
|
$.value = !1;
|
|
2234
2238
|
}
|
|
2235
2239
|
}
|
|
2236
|
-
return (
|
|
2240
|
+
return (m, y) => {
|
|
2237
2241
|
const S = D("FmSpacer"), h = D("FmButton"), F = D("FmDialog");
|
|
2238
2242
|
return k(), Q(F, {
|
|
2239
2243
|
modelValue: s(t),
|
|
2240
|
-
"onUpdate:modelValue":
|
|
2244
|
+
"onUpdate:modelValue": y[2] || (y[2] = (b) => Fe(t) ? t.value = b : null),
|
|
2241
2245
|
overlay: !0,
|
|
2242
2246
|
"close-button": !1
|
|
2243
2247
|
}, {
|
|
2244
|
-
"dialog-header": P(() =>
|
|
2248
|
+
"dialog-header": P(() => y[3] || (y[3] = [
|
|
2245
2249
|
l("div", null, "Xilnex transfer order", -1)
|
|
2246
2250
|
])),
|
|
2247
2251
|
"dialog-footer": P(() => [
|
|
@@ -2252,7 +2256,7 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2252
2256
|
label: "Cancel",
|
|
2253
2257
|
size: "md",
|
|
2254
2258
|
variant: "tertiary",
|
|
2255
|
-
onClick:
|
|
2259
|
+
onClick: y[1] || (y[1] = (b) => i("update:show", !1))
|
|
2256
2260
|
}, null, 8, ["disabled"]),
|
|
2257
2261
|
c(h, {
|
|
2258
2262
|
disabled: $.value,
|
|
@@ -2268,10 +2272,10 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2268
2272
|
l("div", oo, [
|
|
2269
2273
|
c(ao, {
|
|
2270
2274
|
ref_key: "formRef",
|
|
2271
|
-
ref:
|
|
2272
|
-
onValidationSuccess:
|
|
2275
|
+
ref: p,
|
|
2276
|
+
onValidationSuccess: v,
|
|
2273
2277
|
modelValue: e.value,
|
|
2274
|
-
"onUpdate:modelValue":
|
|
2278
|
+
"onUpdate:modelValue": y[0] || (y[0] = (b) => e.value = b)
|
|
2275
2279
|
}, null, 8, ["modelValue"])
|
|
2276
2280
|
])
|
|
2277
2281
|
]),
|
|
@@ -2291,9 +2295,9 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2291
2295
|
startDate: ze.string().optional().nullable(),
|
|
2292
2296
|
endDate: ze.string().optional().nullable()
|
|
2293
2297
|
});
|
|
2294
|
-
const i =
|
|
2295
|
-
() => !
|
|
2296
|
-
), _ = os(), t = Ge(), d =
|
|
2298
|
+
const i = U(
|
|
2299
|
+
() => !v._currentLocation || e.loading.value
|
|
2300
|
+
), _ = os(), t = Ge(), d = qe();
|
|
2297
2301
|
function C() {
|
|
2298
2302
|
const A = {
|
|
2299
2303
|
name: "",
|
|
@@ -2308,22 +2312,22 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2308
2312
|
}
|
|
2309
2313
|
}
|
|
2310
2314
|
function $() {
|
|
2311
|
-
_.setItem(ft, JSON.stringify(
|
|
2315
|
+
_.setItem(ft, JSON.stringify(p.value));
|
|
2312
2316
|
}
|
|
2313
|
-
const
|
|
2317
|
+
const p = q(C()), e = Jt(
|
|
2314
2318
|
Ye.RECEIVE_REQUEST,
|
|
2315
|
-
|
|
2319
|
+
p.value
|
|
2316
2320
|
), { columnDefs: o } = Wt(
|
|
2317
2321
|
Ye.RECEIVE_REQUEST,
|
|
2318
2322
|
e
|
|
2319
|
-
),
|
|
2320
|
-
async function
|
|
2321
|
-
const A = `inventory-record_${ct(
|
|
2323
|
+
), v = Ze();
|
|
2324
|
+
async function m() {
|
|
2325
|
+
const A = `inventory-record_${ct(p.value.startDate).format("DD-MM-YYYY_HH-mm")}-${ct(p.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, E = e.purchaseOrders.value.flatMap(
|
|
2322
2326
|
(r) => r.items.map((u) => {
|
|
2323
|
-
var
|
|
2324
|
-
const O = new Date(ss(r._id) ?? ""), oe = r.effectiveAt ? new Date(r.effectiveAt) : void 0,
|
|
2327
|
+
var he;
|
|
2328
|
+
const O = new Date(ss(r._id) ?? ""), oe = r.effectiveAt ? new Date(r.effectiveAt) : void 0, W = $e(
|
|
2325
2329
|
es(u.sku, r.deliveryOrder || [])
|
|
2326
|
-
), ce =
|
|
2330
|
+
), ce = $e(u.quantity), ie = ((he = u == null ? void 0 : u.measurement) == null ? void 0 : he.abbrev) || u.sku.unit.abbrev;
|
|
2327
2331
|
return {
|
|
2328
2332
|
"SKU code": u.code,
|
|
2329
2333
|
"SKU name": u.name,
|
|
@@ -2332,7 +2336,7 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2332
2336
|
Date: O,
|
|
2333
2337
|
Status: r.status,
|
|
2334
2338
|
Reference: r.ref ?? "",
|
|
2335
|
-
"Received quantity":
|
|
2339
|
+
"Received quantity": W,
|
|
2336
2340
|
"Ordered quantity": ce,
|
|
2337
2341
|
Unit: ie,
|
|
2338
2342
|
"Total cost": u.totalCost ? Ke(u.totalCost) : null
|
|
@@ -2364,11 +2368,11 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2364
2368
|
type: "success"
|
|
2365
2369
|
});
|
|
2366
2370
|
}
|
|
2367
|
-
const
|
|
2368
|
-
be([() =>
|
|
2369
|
-
!A.startDate || !A.endDate || (
|
|
2370
|
-
|
|
2371
|
-
|
|
2371
|
+
const y = q(dt()), S = q("");
|
|
2372
|
+
be([() => y.value], ([A]) => {
|
|
2373
|
+
!A.startDate || !A.endDate || (p.value.startDate = A.startDate, p.value.endDate = A.endDate, e.updateDateRange(
|
|
2374
|
+
p.value.startDate,
|
|
2375
|
+
p.value.endDate
|
|
2372
2376
|
), $());
|
|
2373
2377
|
}), be([() => S.value], () => {
|
|
2374
2378
|
$();
|
|
@@ -2390,9 +2394,9 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2390
2394
|
if (A === "refresh")
|
|
2391
2395
|
return e.fetchData();
|
|
2392
2396
|
if (A === "export")
|
|
2393
|
-
return
|
|
2397
|
+
return m();
|
|
2394
2398
|
}
|
|
2395
|
-
const { breakpoints: F } = We(),
|
|
2399
|
+
const { breakpoints: F } = We(), b = U(() => F.value.xs || F.value.sm), w = U(() => b.value ? 10 : 20), L = Yt(), H = U(() => [
|
|
2396
2400
|
{
|
|
2397
2401
|
label: x("inventory.transfer.receiveRequest.actions.create"),
|
|
2398
2402
|
value: "create",
|
|
@@ -2413,7 +2417,7 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2413
2417
|
label: x("inventory.common.export"),
|
|
2414
2418
|
value: "export"
|
|
2415
2419
|
}
|
|
2416
|
-
]), N =
|
|
2420
|
+
]), N = U(() => {
|
|
2417
2421
|
const A = [
|
|
2418
2422
|
{
|
|
2419
2423
|
type: "string",
|
|
@@ -2453,7 +2457,7 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2453
2457
|
}
|
|
2454
2458
|
];
|
|
2455
2459
|
return [...A, ...d.isEnabled ? E : []];
|
|
2456
|
-
}), K =
|
|
2460
|
+
}), K = q(null), J = U(() => {
|
|
2457
2461
|
if (!K.value)
|
|
2458
2462
|
return e.purchaseOrders.value;
|
|
2459
2463
|
const A = Qt.build(K.value);
|
|
@@ -2484,15 +2488,15 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2484
2488
|
class: Y([
|
|
2485
2489
|
"flex flex-col gap-8 max-h-full",
|
|
2486
2490
|
{
|
|
2487
|
-
"p-0":
|
|
2488
|
-
"px-24 ": !
|
|
2491
|
+
"p-0": b.value,
|
|
2492
|
+
"px-24 ": !b.value
|
|
2489
2493
|
}
|
|
2490
2494
|
])
|
|
2491
2495
|
}, [
|
|
2492
2496
|
c(Zt, {
|
|
2493
2497
|
"date-range-query": "",
|
|
2494
|
-
"date-range":
|
|
2495
|
-
"onUpdate:dateRange": E[0] || (E[0] = (u) =>
|
|
2498
|
+
"date-range": y.value,
|
|
2499
|
+
"onUpdate:dateRange": E[0] || (E[0] = (u) => y.value = u),
|
|
2496
2500
|
searchable: "",
|
|
2497
2501
|
"change-location": "",
|
|
2498
2502
|
search: S.value,
|
|
@@ -2505,11 +2509,11 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2505
2509
|
(k(), Q(V, {
|
|
2506
2510
|
style: yt(s(L).tableHeight),
|
|
2507
2511
|
"column-defs": s(o),
|
|
2508
|
-
"row-data":
|
|
2512
|
+
"row-data": J.value,
|
|
2509
2513
|
"search-value": S.value,
|
|
2510
2514
|
loading: i.value,
|
|
2511
2515
|
onRowClick: E[3] || (E[3] = (u) => s(e).promptShowTransferDetails(u.original)),
|
|
2512
|
-
key: (r = s(
|
|
2516
|
+
key: (r = s(v)._currentLocation) == null ? void 0 : r.dbName,
|
|
2513
2517
|
"page-size": w.value
|
|
2514
2518
|
}, {
|
|
2515
2519
|
"list-row": P((u) => [
|
|
@@ -2518,32 +2522,32 @@ const Ra = exports.FfCalculator, Ea = { class: "flex flex-col flex-1" }, Aa = {
|
|
|
2518
2522
|
onRowClick: s(e).promptShowTransferDetails
|
|
2519
2523
|
}, {
|
|
2520
2524
|
default: P((O) => {
|
|
2521
|
-
var oe,
|
|
2525
|
+
var oe, W, ce, ie, he, Me, Ne, He, ke, Pe, a, f, M, Z, me, xe, pe, _e, fe, Ce;
|
|
2522
2526
|
return [
|
|
2523
2527
|
l("div", no, [
|
|
2524
2528
|
l("div", ro, [
|
|
2525
2529
|
c(s(de), {
|
|
2526
|
-
render: (ce = (
|
|
2527
|
-
props: (
|
|
2530
|
+
render: (ce = (W = (oe = O._id) == null ? void 0 : oe.column) == null ? void 0 : W.columnDef) == null ? void 0 : ce.cell,
|
|
2531
|
+
props: (he = (ie = O._id) == null ? void 0 : ie.getContext) == null ? void 0 : he.call(ie)
|
|
2528
2532
|
}, null, 8, ["render", "props"])
|
|
2529
2533
|
]),
|
|
2530
2534
|
l("div", io, [
|
|
2531
2535
|
c(s(de), {
|
|
2532
2536
|
render: (He = (Ne = (Me = O.supplier_name) == null ? void 0 : Me.column) == null ? void 0 : Ne.columnDef) == null ? void 0 : He.cell,
|
|
2533
|
-
props: (Pe = (
|
|
2537
|
+
props: (Pe = (ke = O.supplier_name) == null ? void 0 : ke.getContext) == null ? void 0 : Pe.call(ke)
|
|
2534
2538
|
}, null, 8, ["render", "props"])
|
|
2535
2539
|
]),
|
|
2536
|
-
l("div", uo, R(u.original.items.map((
|
|
2540
|
+
l("div", uo, R(u.original.items.map((Se) => `${Se.name}`).join(", ")), 1),
|
|
2537
2541
|
u.original.ref ? (k(), T("div", co, [
|
|
2538
2542
|
c(s(de), {
|
|
2539
|
-
render: (M = (
|
|
2540
|
-
props: (me = (
|
|
2543
|
+
render: (M = (f = (a = O.ref) == null ? void 0 : a.column) == null ? void 0 : f.columnDef) == null ? void 0 : M.cell,
|
|
2544
|
+
props: (me = (Z = O.ref) == null ? void 0 : Z.getContext) == null ? void 0 : me.call(Z)
|
|
2541
2545
|
}, null, 8, ["render", "props"])
|
|
2542
2546
|
])) : B("", !0),
|
|
2543
2547
|
l("div", mo, [
|
|
2544
2548
|
c(s(de), {
|
|
2545
|
-
render: (_e = (pe = (
|
|
2546
|
-
props: (
|
|
2549
|
+
render: (_e = (pe = (xe = O.status) == null ? void 0 : xe.column) == null ? void 0 : pe.columnDef) == null ? void 0 : _e.cell,
|
|
2550
|
+
props: (Ce = (fe = O.status) == null ? void 0 : fe.getContext) == null ? void 0 : Ce.call(fe)
|
|
2547
2551
|
}, null, 8, ["render", "props"])
|
|
2548
2552
|
])
|
|
2549
2553
|
])
|