@feedmepos/mf-inventory-portal 0.0.25-dev.21 → 0.0.25-dev.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-D6WBVERc.js → App-DznQj-PT.js} +36 -34
- package/dist/{ApprovalView-BIBoagE8.js → ApprovalView-C5yLxIHf.js} +2 -2
- package/dist/{BindingsDialog-DHRRkK1Z.js → BindingsDialog-DwD1FLfX.js} +2 -2
- package/dist/{BindingsPicker-DohvMDDF.js → BindingsPicker-DlU4LkwQ.js} +1 -1
- package/dist/{BindingsTable-C_JwU9ei.js → BindingsTable-DGRTuMsE.js} +1 -1
- package/dist/{ClosingDraftView-BBebhUj-.js → ClosingDraftView-sdHlG6wI.js} +2 -2
- package/dist/{ClosingTemplateView-CXRN19-D.js → ClosingTemplateView-Caj8XrPa.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BJufUQNE.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BoCXfF2a.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C5Xk19jY.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BT-FAOlr.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-7HNI82u-.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-3EDOov9j.js} +1 -1
- package/dist/{IngredientGroupView-l2bAc1Kj.js → IngredientGroupView-Br3codan.js} +1 -1
- package/dist/{IngredientsView-zDXt7KEx.js → IngredientsView-DlvtaI45.js} +4 -4
- package/dist/{IntegrationView-BYnlAPrP.js → IntegrationView-3x8mJUvO.js} +1 -1
- package/dist/{InventoryBindingForm-BuweG4Vl.js → InventoryBindingForm-DXsVPBa7.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DgxN0U4N.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B4yIWdTd.js} +3 -3
- package/dist/{InventoryBindingSummary-BpEo0JsK.js → InventoryBindingSummary-DyWd80ov.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CcjzkzCt.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CxgG5SAH.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Ej20iSHA.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CjRiVqol.js} +1 -1
- package/dist/{PublishView-DCZ0zIaP.js → PublishView-DlGGZzK-.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-Cag7UEvz.js → PurchaseOrderPrintPreview-yqUPquop.js} +1 -1
- package/dist/{ReceiveRequestView-ChIJGA98.js → ReceiveRequestView-PufDIDNK.js} +162 -166
- package/dist/{RecipeView-bBshe0eF.js → RecipeView-Bw9O3zjB.js} +3 -3
- package/dist/{StockView-D6-oKpAC.js → StockView-C7aUV9Kn.js} +7 -7
- package/dist/{SupplierView-dyIcGp9Q.js → SupplierView-Mf3H2jU5.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-C_7wbQow.js → TransferDetails.vue_vue_type_script_setup_true_lang-C76mYw9N.js} +4 -4
- package/dist/{TransferTemplateView-D2rxV0k_.js → TransferTemplateView-BAx_of6-.js} +7 -7
- package/dist/{UnitView-DVS5Az5c.js → UnitView-Ca7GwXeW.js} +3 -3
- package/dist/{WarehouseView-CR03TpnA.js → WarehouseView-DOr_Z8O0.js} +1 -1
- package/dist/{app-oV9ISfFL.js → app-6L7nz_nU.js} +10 -10
- package/dist/app.js +1 -1
- package/dist/{decimal-C7zgfr5G.js → decimal-DnvQm8_y.js} +1 -1
- package/dist/{feature-CDQQ-mV9.js → feature-C3t9l5E5.js} +1 -1
- package/dist/{format-unit-display-CVBzrNQ4.js → format-unit-display-BP8FJtfB.js} +2 -2
- package/dist/{index-0VS4cuk3.js → index-0ZuWSPMG.js} +2 -2
- package/dist/{stock-BIP_NIK_.js → stock-BBtSSj_E.js} +1 -1
- package/dist/{supplier-DUQ2VSMg.js → supplier-DekMzif8.js} +1 -1
- package/dist/{use-ingredient-select-dialog-VkU5_Aaj.js → use-ingredient-select-dialog-CM7uZfKE.js} +1 -1
- package/dist/{use-inventory-binding-dialog-BXp0z3v_.js → use-inventory-binding-dialog-DQXwlGS6.js} +1 -1
- package/dist/{vue-i18n-CCd5_SRR.js → vue-i18n-DVJ8qHf7.js} +134 -134
- package/package.json +3 -3
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { defineComponent as le, onMounted as Be, onUnmounted as Vt, renderSlot as Rt, h as q, reactive as vt, computed as O, openBlock as C, createElementBlock as V, Fragment as be, renderList as Te, createElementVNode as i, toDisplayString as E, unref as t, resolveComponent as P, createVNode as v, withCtx as T, createCommentVNode as j, ref as Q, createBlock as Y, watch as _e, normalizeClass as ee, createTextVNode as Me, normalizeStyle as bt, nextTick as qt, mergeProps as Ye, isRef as we, Teleport as At } from "vue";
|
|
2
|
-
import { H as Ke, J as Et, Y as Ot, Z as
|
|
3
|
-
import { u as Ct, a as Jt, P as Qe, b as Wt, _ as Xt, g as es } from "./TransferDetails.vue_vue_type_script_setup_true_lang-
|
|
4
|
-
import { _ as xt, u as ts, i as ss, e as os } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { H as Ke, J as Et, Y as Ot, Z as Ie, b as Je, l as mt, i as ae, O as Ne, a0 as We, K as gt, as as Mt, A as Ue, M as Ut, m as _t, ab as Xe, E as de, at as Bt, a as kt, au as Nt, av as zt, aw as Lt, G as ht, u as ze, ax as Ht, $ as jt, T as Qt, ay as Yt, B as St, d as $e, az as Oe, a5 as ct, y as Kt, _ as Zt, z as Gt, N as pt } from "./app-6L7nz_nU.js";
|
|
3
|
+
import { u as Ct, a as Jt, P as Qe, b as Wt, _ as Xt, g as es } from "./TransferDetails.vue_vue_type_script_setup_true_lang-C76mYw9N.js";
|
|
4
|
+
import { _ as xt, u as ts, i as ss, e as os } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CjRiVqol.js";
|
|
5
5
|
import { u as ns } from "./useTabStorage-BkIVScW_.js";
|
|
6
6
|
import { useDialog as wt, useBreakpoints as et, components as ue, FmButtonVariant as as, useSnackbar as Le, useProxiedModel as ls } from "@feedmepos/ui-library";
|
|
7
|
-
import { P as X, u as It } from "./format-unit-display-
|
|
8
|
-
import { _ as Ft, F as Dt, a as Ze, b as $t } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import { u as tt } from "./feature-
|
|
10
|
-
import { c as ve, u as rs, _ as is, l as us } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-
|
|
7
|
+
import { P as X, u as It } from "./format-unit-display-BP8FJtfB.js";
|
|
8
|
+
import { _ as Ft, F as Dt, a as Ze, b as $t } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BT-FAOlr.js";
|
|
9
|
+
import { u as tt } from "./feature-C3t9l5E5.js";
|
|
10
|
+
import { c as ve, u as rs, _ as is, l as us } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BoCXfF2a.js";
|
|
11
11
|
import { useI18n as ke } from "@feedmepos/mf-common";
|
|
12
12
|
import { defineStore as ds } from "pinia";
|
|
13
|
-
import { u as st } from "./supplier-
|
|
13
|
+
import { u as st } from "./supplier-DekMzif8.js";
|
|
14
14
|
import { _ as ms } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
15
|
-
import { u as cs } from "./vue-i18n-
|
|
15
|
+
import { u as cs } from "./vue-i18n-DVJ8qHf7.js";
|
|
16
16
|
import "./array-hChJVZLE.js";
|
|
17
17
|
const ps = /* @__PURE__ */ le({
|
|
18
18
|
__name: "MountListener",
|
|
19
19
|
emits: ["mounted", "unmounted"],
|
|
20
20
|
setup(m, { emit: b }) {
|
|
21
21
|
const l = b;
|
|
22
|
-
return Be(() => l("mounted")), Vt(() => l("unmounted")), (r,
|
|
22
|
+
return Be(() => l("mounted")), Vt(() => l("unmounted")), (r, k) => Rt(r.$slots, "default");
|
|
23
23
|
}
|
|
24
24
|
}), Tt = ds("inventoryMultiSelectDialog", () => {
|
|
25
25
|
const m = wt(), { t: b } = ke();
|
|
26
26
|
return { multiSelect: async (s, p, c) => {
|
|
27
|
-
const u = c ?? ((e) => e), { promise:
|
|
27
|
+
const u = c ?? ((e) => e), { promise: h, resolve: n } = Promise.withResolvers();
|
|
28
28
|
return m.open({
|
|
29
29
|
title: "Select items",
|
|
30
30
|
closeButton: !0,
|
|
@@ -45,11 +45,11 @@ const ps = /* @__PURE__ */ le({
|
|
|
45
45
|
variant: "tertiary"
|
|
46
46
|
}
|
|
47
47
|
}).onPrimary((e) => {
|
|
48
|
-
const a = e.map((
|
|
48
|
+
const a = e.map((_) => u(_));
|
|
49
49
|
n(a);
|
|
50
|
-
}),
|
|
50
|
+
}), h;
|
|
51
51
|
}, singleSelect: async (s, p, c) => {
|
|
52
|
-
const u = c ?? ((e) => e), { promise:
|
|
52
|
+
const u = c ?? ((e) => e), { promise: h, resolve: n } = Promise.withResolvers();
|
|
53
53
|
return m.open({
|
|
54
54
|
title: "Select items",
|
|
55
55
|
closeButton: !0,
|
|
@@ -75,8 +75,8 @@ const ps = /* @__PURE__ */ le({
|
|
|
75
75
|
return n(null);
|
|
76
76
|
const a = u(e[0]);
|
|
77
77
|
n(a);
|
|
78
|
-
}),
|
|
79
|
-
}, confirmation: async (s, p, c, u,
|
|
78
|
+
}), h;
|
|
79
|
+
}, confirmation: async (s, p, c, u, h) => {
|
|
80
80
|
const { promise: n, resolve: e } = Promise.withResolvers();
|
|
81
81
|
return m.open({
|
|
82
82
|
title: s,
|
|
@@ -100,7 +100,7 @@ const ps = /* @__PURE__ */ le({
|
|
|
100
100
|
close: !0,
|
|
101
101
|
variant: "tertiary"
|
|
102
102
|
},
|
|
103
|
-
tertiaryActions:
|
|
103
|
+
tertiaryActions: h,
|
|
104
104
|
closeButton: !0,
|
|
105
105
|
dismissAway: !0
|
|
106
106
|
}).onPrimary(() => {
|
|
@@ -108,7 +108,7 @@ const ps = /* @__PURE__ */ le({
|
|
|
108
108
|
}).onSecondary(() => {
|
|
109
109
|
e((u == null ? void 0 : u.value) ?? !1);
|
|
110
110
|
}).onTertiary(() => {
|
|
111
|
-
e((
|
|
111
|
+
e((h == null ? void 0 : h.value) ?? void 0);
|
|
112
112
|
}), n;
|
|
113
113
|
} };
|
|
114
114
|
});
|
|
@@ -116,7 +116,7 @@ function Ge(m) {
|
|
|
116
116
|
return m.reduce((b, l) => {
|
|
117
117
|
const r = l.measurement ? Et(l.quantity, l.measurement.conversion) : l.quantity;
|
|
118
118
|
return Ot(b, r);
|
|
119
|
-
},
|
|
119
|
+
}, Ie.reset());
|
|
120
120
|
}
|
|
121
121
|
var H = /* @__PURE__ */ ((m) => (m.Code = "Code", m.Name = "Name", m.TemplateName = "TemplateName", m.Amount = "Amount", m.Cost = "Cost", m.Delete = "Delete", m))(H || {});
|
|
122
122
|
const fs = () => (ke(), q(
|
|
@@ -128,20 +128,20 @@ const fs = () => (ke(), q(
|
|
|
128
128
|
`Total (${_t()})`
|
|
129
129
|
));
|
|
130
130
|
function ys(m) {
|
|
131
|
-
const { t: b } = ke(), l = vt({}), { breakpoints: r } = et(),
|
|
131
|
+
const { t: b } = ke(), l = vt({}), { breakpoints: r } = et(), k = tt(), s = Je(), p = Tt();
|
|
132
132
|
Be(() => {
|
|
133
133
|
for (const n of m.items) {
|
|
134
134
|
if (!n.totalCost)
|
|
135
135
|
continue;
|
|
136
136
|
const e = ve(n.sku, n.quantity, n.measurement, {
|
|
137
137
|
supplier: m.supplier
|
|
138
|
-
}), a = n.totalCost ??
|
|
138
|
+
}), a = n.totalCost ?? Ie.reset();
|
|
139
139
|
e ? l[n.sku._id] = e.amount !== a.amount || e.precision !== a.precision : l[n.sku._id] = !0;
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
function c(n) {
|
|
143
|
-
var a,
|
|
144
|
-
return !!(((
|
|
143
|
+
var a, _, S, g, x, w, $;
|
|
144
|
+
return !!(((_ = (a = n.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : _.amount) ?? (($ = (w = (x = (g = (S = m.supplier) == null ? void 0 : S.supplyItems) == null ? void 0 : g.find((M) => M.skuId === n._id)) == null ? void 0 : x.defaultCost) == null ? void 0 : w.costPerUnit) == null ? void 0 : $.amount));
|
|
145
145
|
}
|
|
146
146
|
const u = [
|
|
147
147
|
{
|
|
@@ -173,10 +173,10 @@ function ys(m) {
|
|
|
173
173
|
)
|
|
174
174
|
) : q(ue.FmTextField, {
|
|
175
175
|
modelValue: e.code,
|
|
176
|
-
"onUpdate:modelValue": (
|
|
176
|
+
"onUpdate:modelValue": (_) => {
|
|
177
177
|
m.updateItem({
|
|
178
178
|
...e,
|
|
179
|
-
code:
|
|
179
|
+
code: _
|
|
180
180
|
});
|
|
181
181
|
},
|
|
182
182
|
key: e.sku._id,
|
|
@@ -214,10 +214,10 @@ function ys(m) {
|
|
|
214
214
|
)
|
|
215
215
|
) : q(ue.FmTextField, {
|
|
216
216
|
modelValue: e.name,
|
|
217
|
-
"onUpdate:modelValue": (
|
|
217
|
+
"onUpdate:modelValue": (_) => {
|
|
218
218
|
m.updateItem({
|
|
219
219
|
...e,
|
|
220
|
-
name:
|
|
220
|
+
name: _
|
|
221
221
|
});
|
|
222
222
|
},
|
|
223
223
|
key: e.sku._id,
|
|
@@ -234,7 +234,7 @@ function ys(m) {
|
|
|
234
234
|
enableSorting: !1,
|
|
235
235
|
cell(n) {
|
|
236
236
|
var S, g;
|
|
237
|
-
const e = n.row.original, a = (S = e.subItems) != null && S.length ? e.sku.code : e.code,
|
|
237
|
+
const e = n.row.original, a = (S = e.subItems) != null && S.length ? e.sku.code : e.code, _ = (g = e.subItems) != null && g.length ? e.sku.name : e.name;
|
|
238
238
|
return q(
|
|
239
239
|
ue.FmTooltip,
|
|
240
240
|
{ zIndex: 50 },
|
|
@@ -244,7 +244,7 @@ function ys(m) {
|
|
|
244
244
|
q(
|
|
245
245
|
"div",
|
|
246
246
|
{ class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
|
|
247
|
-
|
|
247
|
+
_
|
|
248
248
|
),
|
|
249
249
|
q(
|
|
250
250
|
"div",
|
|
@@ -256,7 +256,7 @@ function ys(m) {
|
|
|
256
256
|
]);
|
|
257
257
|
},
|
|
258
258
|
content() {
|
|
259
|
-
return
|
|
259
|
+
return _;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
);
|
|
@@ -267,9 +267,9 @@ function ys(m) {
|
|
|
267
267
|
header: () => b("inventory.transfer.form.items.table.Amount"),
|
|
268
268
|
minSize: 200,
|
|
269
269
|
cell(n) {
|
|
270
|
-
var
|
|
270
|
+
var _, S, g, x;
|
|
271
271
|
const e = n.row.original;
|
|
272
|
-
if ((
|
|
272
|
+
if ((_ = e.subItems) != null && _.length) {
|
|
273
273
|
const w = Ge(e.subItems);
|
|
274
274
|
return q(
|
|
275
275
|
"span",
|
|
@@ -305,7 +305,7 @@ function ys(m) {
|
|
|
305
305
|
quantity: w.amount,
|
|
306
306
|
measurement: w.measurement
|
|
307
307
|
};
|
|
308
|
-
|
|
308
|
+
k.enableTotalCost && ($.totalCost = ve(e.sku, e.quantity, e.measurement, {
|
|
309
309
|
supplier: m.supplier,
|
|
310
310
|
// NOTE: set undefined here if `manualTotalCost[row.sku._id] = false`, so that the function
|
|
311
311
|
// will return the auto calculated default cost instead of the manual total cost
|
|
@@ -339,7 +339,7 @@ function ys(m) {
|
|
|
339
339
|
header: fs,
|
|
340
340
|
size: 180,
|
|
341
341
|
cell(n) {
|
|
342
|
-
const e = n.row.original, a = c(e.sku),
|
|
342
|
+
const e = n.row.original, a = c(e.sku), _ = r.value.xs || r.value.sm;
|
|
343
343
|
return !l[e.sku._id] && a ? q(
|
|
344
344
|
"div",
|
|
345
345
|
{
|
|
@@ -371,7 +371,7 @@ function ys(m) {
|
|
|
371
371
|
[
|
|
372
372
|
q(
|
|
373
373
|
"span",
|
|
374
|
-
|
|
374
|
+
_ ? We(
|
|
375
375
|
ve(e.sku, e.quantity, e.measurement, {
|
|
376
376
|
supplier: m.supplier
|
|
377
377
|
})
|
|
@@ -412,7 +412,7 @@ function ys(m) {
|
|
|
412
412
|
},
|
|
413
413
|
{
|
|
414
414
|
prepend() {
|
|
415
|
-
return
|
|
415
|
+
return _ ? q(
|
|
416
416
|
"div",
|
|
417
417
|
{
|
|
418
418
|
class: [
|
|
@@ -452,9 +452,9 @@ function ys(m) {
|
|
|
452
452
|
var S, g, x;
|
|
453
453
|
const e = n.row.original, a = (x = (g = (S = m.template) == null ? void 0 : S.purchaseOrder) == null ? void 0 : g.items) == null ? void 0 : x.find(
|
|
454
454
|
(w) => w.sku._id === e.sku._id
|
|
455
|
-
),
|
|
455
|
+
), _ = (a == null ? void 0 : a.subItems) ?? [];
|
|
456
456
|
return q("div", { class: "flex justify-end" }, [
|
|
457
|
-
...
|
|
457
|
+
..._.length ? [
|
|
458
458
|
q(ue.FmButton, {
|
|
459
459
|
key: e.sku._id,
|
|
460
460
|
type: "button",
|
|
@@ -464,7 +464,7 @@ function ys(m) {
|
|
|
464
464
|
disabled: m.disabled,
|
|
465
465
|
onClick: async () => {
|
|
466
466
|
var te;
|
|
467
|
-
const w = ((te = e.subItems) == null ? void 0 : te.map((F) => F.id)) ?? [], $ =
|
|
467
|
+
const w = ((te = e.subItems) == null ? void 0 : te.map((F) => F.id)) ?? [], $ = _.map(
|
|
468
468
|
(F) => ({
|
|
469
469
|
label: F.name,
|
|
470
470
|
sublabel: F.code,
|
|
@@ -472,7 +472,7 @@ function ys(m) {
|
|
|
472
472
|
})
|
|
473
473
|
), M = await p.multiSelect($, w, (F) => {
|
|
474
474
|
var D;
|
|
475
|
-
return ((D = e.subItems) == null ? void 0 : D.find((L) => L.id === F)) ??
|
|
475
|
+
return ((D = e.subItems) == null ? void 0 : D.find((L) => L.id === F)) ?? _.find((L) => L.id === F);
|
|
476
476
|
}).then((F) => F == null ? void 0 : F.filter((D) => D).map((D) => D));
|
|
477
477
|
M && m.updateItem({
|
|
478
478
|
...e,
|
|
@@ -504,7 +504,7 @@ function ys(m) {
|
|
|
504
504
|
}
|
|
505
505
|
];
|
|
506
506
|
return {
|
|
507
|
-
columnDefs: O(() =>
|
|
507
|
+
columnDefs: O(() => k.enableTotalCost && m.transferType === X.PURCHASE ? u : u.filter(
|
|
508
508
|
(n) => n.id !== "Cost"
|
|
509
509
|
/* Cost */
|
|
510
510
|
))
|
|
@@ -518,9 +518,9 @@ const vs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
518
518
|
setup(m) {
|
|
519
519
|
const b = st();
|
|
520
520
|
function l(r) {
|
|
521
|
-
return b.suppliers.find((
|
|
521
|
+
return b.suppliers.find((k) => k._id === r);
|
|
522
522
|
}
|
|
523
|
-
return (r,
|
|
523
|
+
return (r, k) => (C(), V("div", vs, [
|
|
524
524
|
(C(!0), V(be, null, Te(Object.keys(r.prices), (s) => {
|
|
525
525
|
var p;
|
|
526
526
|
return C(), V("div", {
|
|
@@ -537,13 +537,13 @@ const vs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
537
537
|
}, [
|
|
538
538
|
i("div", _s, [
|
|
539
539
|
i("span", null, E(c.totalCost ? t(We)(c.totalCost) : "No data"), 1),
|
|
540
|
-
|
|
540
|
+
k[0] || (k[0] = i("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
|
|
541
541
|
i("span", null, E(t(ae)(c.totalUnit, !1)), 1),
|
|
542
542
|
i("span", null, E(((u = c.measurement) == null ? void 0 : u.abbrev) ?? c.unit.abbrev), 1)
|
|
543
543
|
]),
|
|
544
544
|
i("div", ks, [
|
|
545
545
|
i("span", null, "(#" + E(c.seqNumber) + ")", 1),
|
|
546
|
-
|
|
546
|
+
k[1] || (k[1] = i("span", null, E(" "), -1)),
|
|
547
547
|
i("span", null, E(t(Xe)(new Date(c.date))), 1)
|
|
548
548
|
])
|
|
549
549
|
]);
|
|
@@ -567,8 +567,8 @@ const vs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
567
567
|
setup(m) {
|
|
568
568
|
const { t: b } = ke();
|
|
569
569
|
return (l, r) => {
|
|
570
|
-
var p, c, u,
|
|
571
|
-
const
|
|
570
|
+
var p, c, u, h, n, e, a, _, S, g, x, w, $, M, te, F, D, L, U, A, N, G, J, y, d, R, K;
|
|
571
|
+
const k = P("FmLabel"), s = P("FmSpacer");
|
|
572
572
|
return C(), V("div", hs, [
|
|
573
573
|
i("div", Ss, [
|
|
574
574
|
i("div", Cs, [
|
|
@@ -578,23 +578,23 @@ const vs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
578
578
|
i("div", null, [
|
|
579
579
|
v(t(de), {
|
|
580
580
|
render: (u = (c = (p = l.cellByColId.Delete) == null ? void 0 : p.column) == null ? void 0 : c.columnDef) == null ? void 0 : u.cell,
|
|
581
|
-
props: (n = (
|
|
581
|
+
props: (n = (h = l.cellByColId.Delete) == null ? void 0 : h.getContext) == null ? void 0 : n.call(h)
|
|
582
582
|
}, null, 8, ["render", "props"])
|
|
583
583
|
])
|
|
584
584
|
]),
|
|
585
585
|
i("div", Is, [
|
|
586
586
|
i("div", Fs, [
|
|
587
|
-
v(
|
|
587
|
+
v(k, {
|
|
588
588
|
label: t(b)(`inventory.transfer.form.items.table.${t(H).Code}`)
|
|
589
589
|
}, null, 8, ["label"]),
|
|
590
590
|
v(t(de), {
|
|
591
|
-
render: (
|
|
591
|
+
render: (_ = (a = (e = l.cellByColId[t(H).Code]) == null ? void 0 : e.column) == null ? void 0 : a.columnDef) == null ? void 0 : _.cell,
|
|
592
592
|
props: (g = (S = l.cellByColId[t(H).Code]) == null ? void 0 : S.getContext) == null ? void 0 : g.call(S)
|
|
593
593
|
}, null, 8, ["render", "props"]),
|
|
594
594
|
r[0] || (r[0] = i("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
595
595
|
]),
|
|
596
596
|
i("div", Ds, [
|
|
597
|
-
v(
|
|
597
|
+
v(k, {
|
|
598
598
|
label: t(b)(`inventory.transfer.form.items.table.${t(H).Name}`)
|
|
599
599
|
}, null, 8, ["label"]),
|
|
600
600
|
v(t(de), {
|
|
@@ -606,7 +606,7 @@ const vs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
606
606
|
]),
|
|
607
607
|
i("div", $s, [
|
|
608
608
|
i("div", Ts, [
|
|
609
|
-
v(
|
|
609
|
+
v(k, {
|
|
610
610
|
label: t(b)(`inventory.transfer.form.items.table.${t(H).Amount}`)
|
|
611
611
|
}, null, 8, ["label"]),
|
|
612
612
|
v(t(de), {
|
|
@@ -618,7 +618,7 @@ const vs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
618
618
|
l.cellByColId[t(H).Cost] ? (C(), V("div", Ps, [
|
|
619
619
|
v(xt, { "z-index": 50 }, {
|
|
620
620
|
default: T(() => [
|
|
621
|
-
v(
|
|
621
|
+
v(k, {
|
|
622
622
|
label: t(b)(`inventory.transfer.form.items.table.${t(H).Cost}2`)
|
|
623
623
|
}, null, 8, ["label"])
|
|
624
624
|
]),
|
|
@@ -662,9 +662,9 @@ function Rs(m) {
|
|
|
662
662
|
return b.value === null ? "" : Xe(b.value);
|
|
663
663
|
},
|
|
664
664
|
set(s) {
|
|
665
|
-
s ? b.value = /* @__PURE__ */ new Date(`${s} ${
|
|
665
|
+
s ? b.value = /* @__PURE__ */ new Date(`${s} ${k.value}`) : b.value = null;
|
|
666
666
|
}
|
|
667
|
-
}),
|
|
667
|
+
}), k = O({
|
|
668
668
|
get() {
|
|
669
669
|
return b.value === null ? "" : Bt(b.value);
|
|
670
670
|
},
|
|
@@ -676,7 +676,7 @@ function Rs(m) {
|
|
|
676
676
|
backdatePo: b,
|
|
677
677
|
backdateSwitch: l,
|
|
678
678
|
backdateModel: r,
|
|
679
|
-
backdateTimeModel:
|
|
679
|
+
backdateTimeModel: k
|
|
680
680
|
};
|
|
681
681
|
}
|
|
682
682
|
const qs = {
|
|
@@ -730,11 +730,11 @@ const qs = {
|
|
|
730
730
|
},
|
|
731
731
|
emits: ["update:poItems"],
|
|
732
732
|
setup(m, { emit: b }) {
|
|
733
|
-
const l = b, r = Q(!1),
|
|
734
|
-
async function
|
|
735
|
-
if (
|
|
733
|
+
const l = b, r = Q(!1), k = Q(7), s = ts(), p = Le(), c = kt(), { t: u } = ke();
|
|
734
|
+
async function h() {
|
|
735
|
+
if (k.value < 1)
|
|
736
736
|
return;
|
|
737
|
-
r.value = !1, await s.readPurchaseOrder(
|
|
737
|
+
r.value = !1, await s.readPurchaseOrder(k.value);
|
|
738
738
|
const n = [];
|
|
739
739
|
if (s.purchaseOrderForecast.skus.length <= 0) {
|
|
740
740
|
p.open({
|
|
@@ -743,16 +743,16 @@ const qs = {
|
|
|
743
743
|
});
|
|
744
744
|
return;
|
|
745
745
|
}
|
|
746
|
-
const e = s.purchaseOrderForecast.skus.reduce((a,
|
|
747
|
-
const S = c.skus.find((w) => w._id ===
|
|
748
|
-
if (a.find((w) => w.sku._id ===
|
|
746
|
+
const e = s.purchaseOrderForecast.skus.reduce((a, _) => {
|
|
747
|
+
const S = c.skus.find((w) => w._id === _.id);
|
|
748
|
+
if (a.find((w) => w.sku._id === _.id) || !S)
|
|
749
749
|
return a;
|
|
750
750
|
const x = {
|
|
751
751
|
sku: S,
|
|
752
752
|
code: S.code,
|
|
753
753
|
name: S.name,
|
|
754
754
|
quantity: {
|
|
755
|
-
amount:
|
|
755
|
+
amount: _.amount,
|
|
756
756
|
precision: 0
|
|
757
757
|
}
|
|
758
758
|
};
|
|
@@ -761,7 +761,7 @@ const qs = {
|
|
|
761
761
|
l("update:poItems", e);
|
|
762
762
|
}
|
|
763
763
|
return (n, e) => {
|
|
764
|
-
const a = P("FmButton"),
|
|
764
|
+
const a = P("FmButton"), _ = P("FmIcon"), S = P("FmStepperField"), g = P("FmPopover");
|
|
765
765
|
return C(), Y(g, {
|
|
766
766
|
disabled: n.disabled,
|
|
767
767
|
class: "flex",
|
|
@@ -808,14 +808,14 @@ const qs = {
|
|
|
808
808
|
})
|
|
809
809
|
]),
|
|
810
810
|
v(S, {
|
|
811
|
-
modelValue:
|
|
812
|
-
"onUpdate:modelValue": e[1] || (e[1] = (x) =>
|
|
811
|
+
modelValue: k.value,
|
|
812
|
+
"onUpdate:modelValue": e[1] || (e[1] = (x) => k.value = x),
|
|
813
813
|
label: t(u)("inventory.transfer.form.items.forecastStock.days"),
|
|
814
814
|
rules: [t(Ue)(1)]
|
|
815
815
|
}, {
|
|
816
816
|
"helper-text": T(() => [
|
|
817
817
|
i("div", Qs, [
|
|
818
|
-
v(
|
|
818
|
+
v(_, {
|
|
819
819
|
name: "warning",
|
|
820
820
|
size: "sm",
|
|
821
821
|
class: "text-fm-color-system-warning-300"
|
|
@@ -834,7 +834,7 @@ const qs = {
|
|
|
834
834
|
}, null, 8, ["label"]),
|
|
835
835
|
v(a, {
|
|
836
836
|
label: t(u)("inventory.transfer.form.items.forecastStock.generate"),
|
|
837
|
-
onClick:
|
|
837
|
+
onClick: h
|
|
838
838
|
}, null, 8, ["label"])
|
|
839
839
|
])
|
|
840
840
|
])
|
|
@@ -847,24 +847,24 @@ const qs = {
|
|
|
847
847
|
function Zs() {
|
|
848
848
|
const m = Le(), b = Ct(), l = Q(!1);
|
|
849
849
|
_e(l, (p) => {
|
|
850
|
-
p && (
|
|
851
|
-
|
|
850
|
+
p && (k.value = !0, r().finally(() => {
|
|
851
|
+
k.value = !1;
|
|
852
852
|
}));
|
|
853
853
|
});
|
|
854
854
|
async function r() {
|
|
855
855
|
try {
|
|
856
856
|
const { startDate: p, endDate: c } = Nt(6), n = (await b.getPurchaseOrders({ start: p, end: c })).filter(
|
|
857
857
|
(e) => {
|
|
858
|
-
var a,
|
|
859
|
-
return e.status === zt.enum.COMPLETE && ((a = e.supplier) == null ? void 0 : a.internal) !== "warehouse" && ((
|
|
858
|
+
var a, _;
|
|
859
|
+
return e.status === zt.enum.COMPLETE && ((a = e.supplier) == null ? void 0 : a.internal) !== "warehouse" && ((_ = e.supplier) == null ? void 0 : _.internal) !== "restaurant";
|
|
860
860
|
}
|
|
861
861
|
).reduce((e, a) => {
|
|
862
|
-
const
|
|
862
|
+
const _ = new Date(Lt(a._id)), S = a.supplier._id;
|
|
863
863
|
for (const g of a.items) {
|
|
864
864
|
if (!g.totalCost) continue;
|
|
865
865
|
const x = e[g.sku._id] ?? {}, w = x[S] ?? [];
|
|
866
866
|
w.push({
|
|
867
|
-
date:
|
|
867
|
+
date: _.toISOString(),
|
|
868
868
|
totalUnit: g.quantity,
|
|
869
869
|
totalCost: g.totalCost,
|
|
870
870
|
unit: g.sku.unit,
|
|
@@ -882,10 +882,10 @@ function Zs() {
|
|
|
882
882
|
}), l.value = !1;
|
|
883
883
|
}
|
|
884
884
|
}
|
|
885
|
-
const
|
|
885
|
+
const k = Q(!1), s = Q({});
|
|
886
886
|
return {
|
|
887
887
|
comparePricesToggle: l,
|
|
888
|
-
comparePriceFetching:
|
|
888
|
+
comparePriceFetching: k,
|
|
889
889
|
comparePriceBySku: s
|
|
890
890
|
};
|
|
891
891
|
}
|
|
@@ -909,13 +909,13 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
909
909
|
},
|
|
910
910
|
emits: ["delete:model-value"],
|
|
911
911
|
setup(m, { emit: b }) {
|
|
912
|
-
const l = ht(), r = b,
|
|
913
|
-
return _e(
|
|
912
|
+
const l = ht(), r = b, k = Q(ae(l.quantity));
|
|
913
|
+
return _e(k, (s) => {
|
|
914
914
|
if (!`${s}`) return;
|
|
915
915
|
const p = +s;
|
|
916
916
|
Number.isNaN(p) || (l.quantity = gt(p));
|
|
917
917
|
}), (s, p) => {
|
|
918
|
-
const c = P("FmIcon"), u = P("FmTooltip"),
|
|
918
|
+
const c = P("FmIcon"), u = P("FmTooltip"), h = P("FmButton");
|
|
919
919
|
return C(), V("tr", Gs, [
|
|
920
920
|
(C(!0), V(be, null, Te(s.row.getVisibleCells(), (n, e) => (C(), V("td", {
|
|
921
921
|
key: n.id,
|
|
@@ -970,7 +970,7 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
970
970
|
"disable-unit": ""
|
|
971
971
|
}, null, 8, ["model-value", "unit", "rules", "stepper", "disabled"])
|
|
972
972
|
])) : n.column.id === t(H).Delete ? (C(), V("div", oo, [
|
|
973
|
-
v(
|
|
973
|
+
v(h, {
|
|
974
974
|
key: "row.sku._id",
|
|
975
975
|
type: "button",
|
|
976
976
|
icon: "delete",
|
|
@@ -997,12 +997,12 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
997
997
|
emits: ["update:item"],
|
|
998
998
|
setup(m, { emit: b }) {
|
|
999
999
|
const l = m, r = b;
|
|
1000
|
-
function
|
|
1000
|
+
function k(u) {
|
|
1001
1001
|
return u.column.columnDef.meta;
|
|
1002
1002
|
}
|
|
1003
1003
|
function s(u) {
|
|
1004
|
-
var
|
|
1005
|
-
return ((n = (
|
|
1004
|
+
var h, n;
|
|
1005
|
+
return ((n = (h = l.templateItem) == null ? void 0 : h.subItems) == null ? void 0 : n.find((e) => e.id === u.id)) ?? {
|
|
1006
1006
|
id: u.id,
|
|
1007
1007
|
code: u.code,
|
|
1008
1008
|
name: u.name,
|
|
@@ -1027,8 +1027,8 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1027
1027
|
subItems: n.length ? n : null
|
|
1028
1028
|
});
|
|
1029
1029
|
}
|
|
1030
|
-
return (u,
|
|
1031
|
-
var n, e, a,
|
|
1030
|
+
return (u, h) => {
|
|
1031
|
+
var n, e, a, _, S;
|
|
1032
1032
|
return C(), V(be, null, [
|
|
1033
1033
|
i("tr", {
|
|
1034
1034
|
class: ee(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
|
|
@@ -1039,11 +1039,11 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1039
1039
|
var x, w, $, M;
|
|
1040
1040
|
return C(), V("td", {
|
|
1041
1041
|
key: g.id,
|
|
1042
|
-
class: ee(["h-[56px] text-fm-color-typo-primary", ((x =
|
|
1042
|
+
class: ee(["h-[56px] text-fm-color-typo-primary", ((x = k(g)) == null ? void 0 : x.cellClass) ?? "px-16"]),
|
|
1043
1043
|
style: bt({
|
|
1044
|
-
width: (w =
|
|
1045
|
-
maxWidth: ($ =
|
|
1046
|
-
textAlign: ((M =
|
|
1044
|
+
width: (w = k(g)) == null ? void 0 : w.width,
|
|
1045
|
+
maxWidth: ($ = k(g)) == null ? void 0 : $.maxWidth,
|
|
1046
|
+
textAlign: ((M = k(g)) == null ? void 0 : M.textAlign) ?? "left"
|
|
1047
1047
|
})
|
|
1048
1048
|
}, [
|
|
1049
1049
|
i("span", ao, [
|
|
@@ -1065,7 +1065,7 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1065
1065
|
"sub-item-index": x,
|
|
1066
1066
|
disabled: u.disabled
|
|
1067
1067
|
}, null, 8, ["row", "model-value", "template-sub-item", "sub-item-index", "disabled"]))), 128)) : j("", !0),
|
|
1068
|
-
u.showComparePrice && Object.keys(u.comparePriceBySku[(
|
|
1068
|
+
u.showComparePrice && Object.keys(u.comparePriceBySku[(_ = u.row.original.sku) == null ? void 0 : _._id] ?? {}).length > 0 ? (C(), V("tr", lo, [
|
|
1069
1069
|
i("td", {
|
|
1070
1070
|
colspan: u.row.getVisibleCells().length
|
|
1071
1071
|
}, [
|
|
@@ -1095,16 +1095,16 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1095
1095
|
},
|
|
1096
1096
|
emits: ["netsuite:ready"],
|
|
1097
1097
|
setup(m, { emit: b }) {
|
|
1098
|
-
const l = Je(), r = m,
|
|
1098
|
+
const l = Je(), r = m, k = b, { t: s } = cs(), p = Q(!1), c = Q();
|
|
1099
1099
|
Be(() => {
|
|
1100
|
-
var e, a,
|
|
1100
|
+
var e, a, _, S;
|
|
1101
1101
|
let n = {
|
|
1102
1102
|
id: "",
|
|
1103
1103
|
subsidiary: { id: "", name: "" },
|
|
1104
1104
|
errors: []
|
|
1105
1105
|
};
|
|
1106
1106
|
if (!l.isEnabled || !r.required) {
|
|
1107
|
-
|
|
1107
|
+
k("netsuite:ready", n);
|
|
1108
1108
|
return;
|
|
1109
1109
|
}
|
|
1110
1110
|
try {
|
|
@@ -1140,19 +1140,19 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1140
1140
|
r.supplier.internal ? c.value = l.getNetSuiteLocation(
|
|
1141
1141
|
`${r.supplier.internal}_${r.supplier._id}`
|
|
1142
1142
|
) : c.value = l.getNetSuiteVendor(r.supplier._id);
|
|
1143
|
-
const g = r.supplier.internal ? l.getLocationSubsidiary((e = c.value) == null ? void 0 : e.netSuiteId).id : (a = c.value) == null ? void 0 : a.subsidiaryId, x = r.supplier.internal ? (
|
|
1144
|
-
!l.isEnabled || g && l.isEnabled && g == x ?
|
|
1143
|
+
const g = r.supplier.internal ? l.getLocationSubsidiary((e = c.value) == null ? void 0 : e.netSuiteId).id : (a = c.value) == null ? void 0 : a.subsidiaryId, x = r.supplier.internal ? (_ = l.currentLocationSubsidiary()) == null ? void 0 : _.id : (S = l.currentVendorSubsidiary(r.supplier._id)) == null ? void 0 : S.id;
|
|
1144
|
+
!l.isEnabled || g && l.isEnabled && g == x ? k("netsuite:ready", n) : p.value = !0;
|
|
1145
1145
|
}
|
|
1146
1146
|
});
|
|
1147
1147
|
const u = O(
|
|
1148
1148
|
() => r.supplier.internal ? l.currentLocationSubsidiary() : l.currentVendorSubsidiary(r.supplier._id)
|
|
1149
|
-
),
|
|
1149
|
+
), h = O(() => {
|
|
1150
1150
|
var n, e;
|
|
1151
1151
|
return c.value == null ? `Cannot find the NetSuite location for "${r.supplier.name}"` : `The subsidiary of the request
|
|
1152
1152
|
location is ${(e = l.getLocationSubsidiary((n = c.value) == null ? void 0 : n.netSuiteId)) == null ? void 0 : e.fullName}`;
|
|
1153
1153
|
});
|
|
1154
1154
|
return (n, e) => {
|
|
1155
|
-
const a = P("FmLabel"),
|
|
1155
|
+
const a = P("FmLabel"), _ = P("FmIcon"), S = P("FmField"), g = P("FmTooltip");
|
|
1156
1156
|
return t(l).isEnabled && r.required ? (C(), V("div", uo, [
|
|
1157
1157
|
v(a, {
|
|
1158
1158
|
label: `NetSuite ${t(s)("inventory.transfer.form.netsuite.subsidiary")}`
|
|
@@ -1172,7 +1172,7 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1172
1172
|
var x;
|
|
1173
1173
|
return [
|
|
1174
1174
|
i("div", co, [
|
|
1175
|
-
v(
|
|
1175
|
+
v(_, {
|
|
1176
1176
|
name: "lock_outline",
|
|
1177
1177
|
size: "sm",
|
|
1178
1178
|
color: n.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
@@ -1188,7 +1188,7 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1188
1188
|
]),
|
|
1189
1189
|
_: 1
|
|
1190
1190
|
}, 8, ["disabled"]),
|
|
1191
|
-
p.value ? (C(), V("div", po, E(
|
|
1191
|
+
p.value ? (C(), V("div", po, E(h.value), 1)) : j("", !0)
|
|
1192
1192
|
])
|
|
1193
1193
|
])) : j("", !0);
|
|
1194
1194
|
};
|
|
@@ -1213,7 +1213,7 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1213
1213
|
},
|
|
1214
1214
|
emits: ["validation-success", "form:ready"],
|
|
1215
1215
|
setup(m, { expose: b, emit: l }) {
|
|
1216
|
-
const r = m,
|
|
1216
|
+
const r = m, k = l, s = ht(), { t: p } = ke(), c = ze(), u = kt(), h = Je(), n = st(), e = tt(), a = It(), { breakpoints: _ } = et(), S = O(() => _.value.xs || _.value.sm), g = vt({
|
|
1217
1217
|
value: !1
|
|
1218
1218
|
}), x = Q(!1), w = O(
|
|
1219
1219
|
() => {
|
|
@@ -1238,7 +1238,7 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1238
1238
|
x.value = !0;
|
|
1239
1239
|
}
|
|
1240
1240
|
}), _e([x, g], ([o, f], [z, W]) => {
|
|
1241
|
-
f.value && W.value &&
|
|
1241
|
+
f.value && W.value && k("form:ready");
|
|
1242
1242
|
});
|
|
1243
1243
|
const M = O(
|
|
1244
1244
|
() => c.currentLocation.type === Ht.enum.restaurant
|
|
@@ -1348,14 +1348,14 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1348
1348
|
}
|
|
1349
1349
|
}), Pe = O(() => xe.columnDefs.value);
|
|
1350
1350
|
function Ve() {
|
|
1351
|
-
var pe, he, qe, Ae,
|
|
1352
|
-
const o = new Set((qe = (he = (pe = w.value) == null ? void 0 : pe.purchaseOrder) == null ? void 0 : he.items) == null ? void 0 : qe.map((B) => B.sku._id)), f =
|
|
1351
|
+
var pe, he, qe, Ae, Fe;
|
|
1352
|
+
const o = new Set((qe = (he = (pe = w.value) == null ? void 0 : pe.purchaseOrder) == null ? void 0 : he.items) == null ? void 0 : qe.map((B) => B.sku._id)), f = h.isEnabled ? h.getAvailableItems((Fe = (Ae = s.netSuite) == null ? void 0 : Ae.subsidiary) == null ? void 0 : Fe.id) : [], z = o.size ? u.skus.filter((B) => o.has(B._id)) : u.skus, W = h.isEnabled ? z.filter((B) => {
|
|
1353
1353
|
var re, ne, fe, ie;
|
|
1354
1354
|
const oe = (ne = (re = w.value) == null ? void 0 : re.purchaseOrder) == null ? void 0 : ne.items.find(
|
|
1355
1355
|
(ye) => ye.sku._id === B._id
|
|
1356
1356
|
);
|
|
1357
1357
|
if (oe != null && oe.measurement != null) {
|
|
1358
|
-
const ye =
|
|
1358
|
+
const ye = h.getAvailableMeasurements(
|
|
1359
1359
|
oe.sku._id,
|
|
1360
1360
|
(ie = (fe = s.netSuite) == null ? void 0 : fe.subsidiary) == null ? void 0 : ie.id
|
|
1361
1361
|
);
|
|
@@ -1393,11 +1393,11 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1393
1393
|
}
|
|
1394
1394
|
}).onPrimary((B) => {
|
|
1395
1395
|
const oe = s.items ?? [], re = B.map((ne) => {
|
|
1396
|
-
var ye,
|
|
1396
|
+
var ye, De;
|
|
1397
1397
|
const fe = oe.find((Se) => Se.sku._id === ne._id);
|
|
1398
1398
|
if (fe)
|
|
1399
1399
|
return fe;
|
|
1400
|
-
const ie = ((
|
|
1400
|
+
const ie = ((De = (ye = w.value) == null ? void 0 : ye.purchaseOrder.items) == null ? void 0 : De.find(
|
|
1401
1401
|
(Se) => Se.sku._id === ne._id
|
|
1402
1402
|
)) ?? {
|
|
1403
1403
|
sku: ne,
|
|
@@ -1434,14 +1434,14 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1434
1434
|
}), o;
|
|
1435
1435
|
});
|
|
1436
1436
|
return (o, f) => {
|
|
1437
|
-
var ye,
|
|
1438
|
-
const z = P("FmChip"), W = P("FmLabel"), me = P("FmIcon"), ce = P("FmField"), pe = P("FmTooltip"), he = P("FmSelect"), qe = P("FmTextField"), Ae = P("FmTextarea"),
|
|
1437
|
+
var ye, De;
|
|
1438
|
+
const z = P("FmChip"), W = P("FmLabel"), me = P("FmIcon"), ce = P("FmField"), pe = P("FmTooltip"), he = P("FmSelect"), qe = P("FmTextField"), Ae = P("FmTextarea"), Fe = P("FmSwitch"), B = P("FmDatePicker"), oe = P("FmTimePicker"), re = P("FmFormGroup"), ne = P("FmButton"), fe = P("FmTable"), ie = P("FmForm");
|
|
1439
1439
|
return C(), V("div", yo, [
|
|
1440
1440
|
i("div", vo, [
|
|
1441
1441
|
(ye = r.modelValue) != null && ye.template ? (C(), Y(z, {
|
|
1442
1442
|
key: 0,
|
|
1443
1443
|
variant: o.disabled ? "warning" : void 0,
|
|
1444
|
-
label: `${t(p)("inventory.transfer.template.title")}: ${((
|
|
1444
|
+
label: `${t(p)("inventory.transfer.template.title")}: ${((De = w.value) == null ? void 0 : De.name) ?? t(p)("inventory.transfer.form.loading")}`,
|
|
1445
1445
|
icon: "summarize",
|
|
1446
1446
|
compact: ""
|
|
1447
1447
|
}, null, 8, ["variant", "label"])) : j("", !0),
|
|
@@ -1464,7 +1464,7 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1464
1464
|
class: "flex flex-col gap-32",
|
|
1465
1465
|
disabled: o.disabled,
|
|
1466
1466
|
onValidationFailed: console.log,
|
|
1467
|
-
onValidationSuccess: f[14] || (f[14] = (Se) =>
|
|
1467
|
+
onValidationSuccess: f[14] || (f[14] = (Se) => k("validation-success"))
|
|
1468
1468
|
}, {
|
|
1469
1469
|
default: T(() => {
|
|
1470
1470
|
var Se, ot, nt, at, lt, rt, it, ut;
|
|
@@ -1635,7 +1635,7 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1635
1635
|
}
|
|
1636
1636
|
])
|
|
1637
1637
|
}, [
|
|
1638
|
-
v(
|
|
1638
|
+
v(Fe, {
|
|
1639
1639
|
modelValue: t(G),
|
|
1640
1640
|
"onUpdate:modelValue": f[5] || (f[5] = (I) => we(G) ? G.value = I : null),
|
|
1641
1641
|
label: t(p)("inventory.transfer.form.backdate.title"),
|
|
@@ -1727,7 +1727,7 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1727
1727
|
])
|
|
1728
1728
|
], 2),
|
|
1729
1729
|
D.value === t(X).PURCHASE && $.value && t(e).enableTotalCost && ((ot = o.modelValue) != null && ot.items.length) ? (C(), V("div", qo, [
|
|
1730
|
-
v(
|
|
1730
|
+
v(Fe, {
|
|
1731
1731
|
label: t(R) ? t(p)("inventory.transfer.form.items.fetchingData") : t(p)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1732
1732
|
"prepend-icon": "compare_arrows",
|
|
1733
1733
|
"label-placement": "right",
|
|
@@ -1792,43 +1792,39 @@ const Gs = { class: "hover:bg-fm-color-opacity-sm" }, Js = { class: "flex items-
|
|
|
1792
1792
|
});
|
|
1793
1793
|
function Eo(m, b) {
|
|
1794
1794
|
b ?? (b = `Return to ${m.supplier.name}`);
|
|
1795
|
-
const r = ze().currentLocation,
|
|
1795
|
+
const r = ze().currentLocation, k = us(r), s = {};
|
|
1796
1796
|
for (const c of m.items) {
|
|
1797
1797
|
const u = c.sku._id;
|
|
1798
|
-
s[u] =
|
|
1798
|
+
s[u] = Ie.reset();
|
|
1799
1799
|
}
|
|
1800
1800
|
const p = m.deliveryOrder.flatMap((c) => c.received);
|
|
1801
1801
|
for (const c of p) {
|
|
1802
1802
|
const u = c.sku._id;
|
|
1803
1803
|
if (!s[u]) continue;
|
|
1804
|
-
const
|
|
1805
|
-
s[u] =
|
|
1804
|
+
const h = c.measurement ? Ie.multiply([c.measurement.conversion, c.amount]) : c.amount;
|
|
1805
|
+
s[u] = Ie.add([s[u], h]);
|
|
1806
1806
|
}
|
|
1807
1807
|
return {
|
|
1808
1808
|
_id: m._id,
|
|
1809
1809
|
name: b,
|
|
1810
1810
|
purchaseOrder: {
|
|
1811
|
-
supplier:
|
|
1811
|
+
supplier: k,
|
|
1812
1812
|
ref: m.ref,
|
|
1813
1813
|
remark: m.remark,
|
|
1814
1814
|
items: m.items.map((c) => {
|
|
1815
|
-
|
|
1816
|
-
const { subItems: u, ..._ } = c;
|
|
1817
|
-
c = _;
|
|
1818
|
-
}
|
|
1815
|
+
const u = c.measurement ? Ie.divide([s[c.sku._id], c.measurement.conversion]) : s[c.sku._id];
|
|
1819
1816
|
return {
|
|
1820
|
-
|
|
1817
|
+
sku: c.sku,
|
|
1818
|
+
code: c.code,
|
|
1819
|
+
name: c.name,
|
|
1821
1820
|
quantityStep: {
|
|
1822
1821
|
amount: 1,
|
|
1823
1822
|
precision: Ne(c.sku.unit, c.measurement)
|
|
1824
1823
|
},
|
|
1825
|
-
quantity:
|
|
1826
|
-
maximumQuantity:
|
|
1824
|
+
quantity: u,
|
|
1825
|
+
maximumQuantity: u
|
|
1827
1826
|
};
|
|
1828
|
-
}).filter((c) =>
|
|
1829
|
-
var u;
|
|
1830
|
-
return (u = c.maximumQuantity) == null ? void 0 : u.amount;
|
|
1831
|
-
})
|
|
1827
|
+
}).filter((c) => c.maximumQuantity.amount > 0)
|
|
1832
1828
|
}
|
|
1833
1829
|
};
|
|
1834
1830
|
}
|
|
@@ -1846,7 +1842,7 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
1846
1842
|
emits: ["update:show", "submitted"],
|
|
1847
1843
|
setup(m, { expose: b, emit: l }) {
|
|
1848
1844
|
var J;
|
|
1849
|
-
const r = m,
|
|
1845
|
+
const r = m, k = l, s = Ct(), p = It(), c = Le(), u = st(), h = ze(), { t: n } = ke(), e = Q(!1), a = Q(!1), _ = Q(!1), S = Tt();
|
|
1850
1846
|
async function g(y) {
|
|
1851
1847
|
if (y) {
|
|
1852
1848
|
a.value = !1;
|
|
@@ -1861,7 +1857,7 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
1861
1857
|
}
|
|
1862
1858
|
}
|
|
1863
1859
|
}
|
|
1864
|
-
|
|
1860
|
+
h.watchLocation(g);
|
|
1865
1861
|
function x() {
|
|
1866
1862
|
const y = {
|
|
1867
1863
|
remark: void 0,
|
|
@@ -1906,18 +1902,18 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
1906
1902
|
() => r.show,
|
|
1907
1903
|
(y) => {
|
|
1908
1904
|
var d;
|
|
1909
|
-
y && (
|
|
1905
|
+
y && (_.value = !1, $.value = r.modelValue ?? x(), M.value = ((d = r.modelValue) == null ? void 0 : d._id) ?? `${Math.random()}`);
|
|
1910
1906
|
}
|
|
1911
1907
|
);
|
|
1912
|
-
const te = O(() => !a.value || !
|
|
1908
|
+
const te = O(() => !a.value || !_.value), F = O(() => {
|
|
1913
1909
|
if (r.returnFrom)
|
|
1914
1910
|
return "Return transfer";
|
|
1915
1911
|
switch (r.mode) {
|
|
1916
|
-
case
|
|
1912
|
+
case $e.READ:
|
|
1917
1913
|
return "View transfer";
|
|
1918
|
-
case
|
|
1914
|
+
case $e.CREATE:
|
|
1919
1915
|
return n("inventory.transfer.receiveRequest.create.title");
|
|
1920
|
-
case
|
|
1916
|
+
case $e.UPDATE:
|
|
1921
1917
|
return n("inventory.transfer.receiveRequest.update.title");
|
|
1922
1918
|
}
|
|
1923
1919
|
return "";
|
|
@@ -1952,7 +1948,7 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
1952
1948
|
type: "error"
|
|
1953
1949
|
}), console.error("Error in creating purchase order", R);
|
|
1954
1950
|
} finally {
|
|
1955
|
-
e.value = !1,
|
|
1951
|
+
e.value = !1, k("update:show", !1);
|
|
1956
1952
|
}
|
|
1957
1953
|
}
|
|
1958
1954
|
}
|
|
@@ -1978,7 +1974,7 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
1978
1974
|
title: n("inventory.transfer.receiveRequest.create.success"),
|
|
1979
1975
|
message: n("inventory.transfer.receiveRequest.create.successMessage"),
|
|
1980
1976
|
type: "success"
|
|
1981
|
-
}),
|
|
1977
|
+
}), k("update:show", !1), k("submitted");
|
|
1982
1978
|
} catch (d) {
|
|
1983
1979
|
c.open({
|
|
1984
1980
|
title: n("inventory.transfer.receiveRequest.create.error.title"),
|
|
@@ -2011,7 +2007,7 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
2011
2007
|
title: n("inventory.transfer.receiveRequest.update.success"),
|
|
2012
2008
|
message: n("inventory.transfer.receiveRequest.update.successMessage"),
|
|
2013
2009
|
type: "success"
|
|
2014
|
-
}),
|
|
2010
|
+
}), k("update:show", !1), k("submitted");
|
|
2015
2011
|
} catch (d) {
|
|
2016
2012
|
c.open({
|
|
2017
2013
|
title: n("inventory.transfer.receiveRequest.update.error.title"),
|
|
@@ -2024,9 +2020,9 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
2024
2020
|
}
|
|
2025
2021
|
function N() {
|
|
2026
2022
|
switch (r.mode) {
|
|
2027
|
-
case
|
|
2023
|
+
case $e.CREATE:
|
|
2028
2024
|
return r.returnFrom ? L() : U();
|
|
2029
|
-
case
|
|
2025
|
+
case $e.UPDATE:
|
|
2030
2026
|
return A();
|
|
2031
2027
|
}
|
|
2032
2028
|
}
|
|
@@ -2053,7 +2049,7 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
2053
2049
|
class: "w-full",
|
|
2054
2050
|
ref_key: "formRef",
|
|
2055
2051
|
ref: D,
|
|
2056
|
-
"onForm:ready": d[0] || (d[0] = () =>
|
|
2052
|
+
"onForm:ready": d[0] || (d[0] = () => _.value = !0),
|
|
2057
2053
|
onValidationSuccess: N,
|
|
2058
2054
|
modelValue: $.value,
|
|
2059
2055
|
"onUpdate:modelValue": d[1] || (d[1] = (se) => $.value = se),
|
|
@@ -2075,7 +2071,7 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
2075
2071
|
disabled: te.value,
|
|
2076
2072
|
variant: "tertiary",
|
|
2077
2073
|
label: t(n)("common.close"),
|
|
2078
|
-
onClick: d[2] || (d[2] = (se) =>
|
|
2074
|
+
onClick: d[2] || (d[2] = (se) => k("update:show", !1))
|
|
2079
2075
|
}, null, 8, ["disabled", "label"])
|
|
2080
2076
|
])
|
|
2081
2077
|
]),
|
|
@@ -2096,13 +2092,13 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
2096
2092
|
endDate: Oe.string().optional().nullable()
|
|
2097
2093
|
});
|
|
2098
2094
|
const r = O(
|
|
2099
|
-
() => !e._currentLocation ||
|
|
2100
|
-
),
|
|
2095
|
+
() => !e._currentLocation || h.loading.value
|
|
2096
|
+
), k = ns(), s = tt();
|
|
2101
2097
|
function p() {
|
|
2102
2098
|
const F = {
|
|
2103
2099
|
name: "",
|
|
2104
2100
|
...ct()
|
|
2105
|
-
}, D =
|
|
2101
|
+
}, D = k.getItem(yt);
|
|
2106
2102
|
if (!D)
|
|
2107
2103
|
return F;
|
|
2108
2104
|
try {
|
|
@@ -2112,17 +2108,17 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
2112
2108
|
}
|
|
2113
2109
|
}
|
|
2114
2110
|
function c() {
|
|
2115
|
-
|
|
2111
|
+
k.setItem(yt, JSON.stringify(u.value));
|
|
2116
2112
|
}
|
|
2117
|
-
const u = Q(p()),
|
|
2113
|
+
const u = Q(p()), h = Jt(
|
|
2118
2114
|
Qe.RECEIVE_REQUEST,
|
|
2119
2115
|
u.value
|
|
2120
2116
|
), { columnDefs: n } = Wt(
|
|
2121
2117
|
Qe.RECEIVE_REQUEST,
|
|
2122
|
-
|
|
2118
|
+
h
|
|
2123
2119
|
), e = ze();
|
|
2124
2120
|
async function a() {
|
|
2125
|
-
const F = `inventory-record_${pt(u.value.startDate).format("DD-MM-YYYY_HH-mm")}-${pt(u.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, D =
|
|
2121
|
+
const F = `inventory-record_${pt(u.value.startDate).format("DD-MM-YYYY_HH-mm")}-${pt(u.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, D = h.purchaseOrders.value.flatMap(
|
|
2126
2122
|
(U) => U.items.map((A) => {
|
|
2127
2123
|
const N = new Date(ss(U._id) ?? ""), G = U.effectiveAt ? new Date(U.effectiveAt) : void 0, J = ae(
|
|
2128
2124
|
es(A.sku, U.deliveryOrder || [])
|
|
@@ -2167,9 +2163,9 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
2167
2163
|
type: "success"
|
|
2168
2164
|
});
|
|
2169
2165
|
}
|
|
2170
|
-
const
|
|
2171
|
-
_e([() =>
|
|
2172
|
-
!F.startDate || !F.endDate || (u.value.startDate = F.startDate, u.value.endDate = F.endDate,
|
|
2166
|
+
const _ = Q(ct()), S = Q("");
|
|
2167
|
+
_e([() => _.value], ([F]) => {
|
|
2168
|
+
!F.startDate || !F.endDate || (u.value.startDate = F.startDate, u.value.endDate = F.endDate, h.updateDateRange(
|
|
2173
2169
|
u.value.startDate,
|
|
2174
2170
|
u.value.endDate
|
|
2175
2171
|
), c());
|
|
@@ -2186,10 +2182,10 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
2186
2182
|
});
|
|
2187
2183
|
return;
|
|
2188
2184
|
}
|
|
2189
|
-
return
|
|
2185
|
+
return h.promptCreateTransferDialog();
|
|
2190
2186
|
}
|
|
2191
2187
|
if (F === "refresh")
|
|
2192
|
-
return
|
|
2188
|
+
return h.fetchData();
|
|
2193
2189
|
if (F === "export")
|
|
2194
2190
|
return a();
|
|
2195
2191
|
}
|
|
@@ -2230,8 +2226,8 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
2230
2226
|
}, [
|
|
2231
2227
|
v(Gt, {
|
|
2232
2228
|
"date-range-query": "",
|
|
2233
|
-
"date-range":
|
|
2234
|
-
"onUpdate:dateRange": D[0] || (D[0] = (A) =>
|
|
2229
|
+
"date-range": _.value,
|
|
2230
|
+
"onUpdate:dateRange": D[0] || (D[0] = (A) => _.value = A),
|
|
2235
2231
|
searchable: "",
|
|
2236
2232
|
"change-location": "",
|
|
2237
2233
|
search: S.value,
|
|
@@ -2240,17 +2236,17 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
2240
2236
|
(C(), Y(L, {
|
|
2241
2237
|
style: bt(t(M).tableHeight),
|
|
2242
2238
|
"column-defs": t(n),
|
|
2243
|
-
"row-data": t(
|
|
2239
|
+
"row-data": t(h).purchaseOrders.value,
|
|
2244
2240
|
"search-value": S.value,
|
|
2245
2241
|
loading: r.value,
|
|
2246
|
-
onRowClick: D[2] || (D[2] = (A) => t(
|
|
2242
|
+
onRowClick: D[2] || (D[2] = (A) => t(h).promptShowTransferDetails(A.original)),
|
|
2247
2243
|
key: (U = t(e)._currentLocation) == null ? void 0 : U.dbName,
|
|
2248
2244
|
"page-size": $.value
|
|
2249
2245
|
}, {
|
|
2250
2246
|
"list-row": T((A) => [
|
|
2251
2247
|
v(St, {
|
|
2252
2248
|
row: A,
|
|
2253
|
-
onRowClick: t(
|
|
2249
|
+
onRowClick: t(h).promptShowTransferDetails
|
|
2254
2250
|
}, {
|
|
2255
2251
|
default: T((N) => {
|
|
2256
2252
|
var G, J, y, d, R, K, se, Ce, xe, Pe, Ve, He, Re, o, f, z, W, me, ce, pe;
|
|
@@ -2291,9 +2287,9 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
2291
2287
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
2292
2288
|
], 2),
|
|
2293
2289
|
(C(), Y(At, { to: "body" }, [
|
|
2294
|
-
v(Bo, Ye(t(
|
|
2295
|
-
onSubmitted: t(
|
|
2296
|
-
"on-submit:return-stock": (A, N) => t(
|
|
2290
|
+
v(Bo, Ye(t(h).transferDialogProps.value, {
|
|
2291
|
+
onSubmitted: t(h).fetchData,
|
|
2292
|
+
"on-submit:return-stock": (A, N) => t(h).submitAction(
|
|
2297
2293
|
A,
|
|
2298
2294
|
"returnStock",
|
|
2299
2295
|
void 0,
|
|
@@ -2302,9 +2298,9 @@ const Oo = { class: "flex items-center" }, Mo = { class: "fm-typo-en-title-md-80
|
|
|
2302
2298
|
}), null, 16, ["onSubmitted", "on-submit:return-stock"]),
|
|
2303
2299
|
v(Xt, Ye({
|
|
2304
2300
|
scope: t(Qe).RECEIVE_REQUEST
|
|
2305
|
-
}, t(
|
|
2306
|
-
onSubmitted: t(
|
|
2307
|
-
onReturnStock: t(
|
|
2301
|
+
}, t(h).transferDetailsProps.value, {
|
|
2302
|
+
onSubmitted: t(h).fetchData,
|
|
2303
|
+
onReturnStock: t(h).promptReturnTransferDialog
|
|
2308
2304
|
}), null, 16, ["scope", "onSubmitted", "onReturnStock"])
|
|
2309
2305
|
]))
|
|
2310
2306
|
];
|