@feedmepos/mf-inventory-portal 0.0.22-dev.16 → 0.0.22-dev.18
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/{ApprovalView-CAYVSFN0.js → ApprovalView-S1q223mv.js} +4 -4
- package/dist/{BindingsDialog-vA6l3jG3.js → BindingsDialog-BSbdzY-J.js} +1 -1
- package/dist/{BindingsPicker-CtkS9du1.js → BindingsPicker-DC7kPvJh.js} +1 -1
- package/dist/{BindingsTable-BsTvZ3Uc.js → BindingsTable-BSfuqvaC.js} +1 -1
- package/dist/{ClosingTemplateView-Bjd9mypa.js → ClosingTemplateView-cA5Ejfd7.js} +5 -5
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C-ixTs_z.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bqrx9o7B.js} +1 -1
- package/dist/{IngredientsView-mZKGdmy8.js → IngredientsView-Yf92qpqA.js} +3 -3
- package/dist/{IntegrationView-DQXcW-ln.js → IntegrationView-5u86ntps.js} +2 -2
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CkIFefTS.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BnRywiF4.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DbP09mHM.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BygnL2Ew.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-B8fEITH6.js → PurchaseOrderPrintPreview-DHADo9Bt.js} +1 -1
- package/dist/{ReceiveRequestView-0gHjqve_.js → ReceiveRequestView-C38wbyxy.js} +6 -6
- package/dist/{RecipeView-D9Xl9ezv.js → RecipeView-BAz1HYyc.js} +4 -4
- package/dist/{StockView-D1Q8Y387.js → StockView-DRhRck1R.js} +50 -50
- package/dist/{SupplierView-kheETesd.js → SupplierView-Cesxw__J.js} +3 -3
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-urs9F8zy.js +776 -0
- package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-Ck5_VSjb.js → TransferDialog.vue_vue_type_script_setup_true_lang-1FKfFCFO.js} +187 -185
- package/dist/{TransferTemplateView-Cp6Qqig-.js → TransferTemplateView-BHUUIBqk.js} +8 -8
- package/dist/{UnitView-BAcYAfVj.js → UnitView-BqXQi2u0.js} +4 -4
- package/dist/{WarehouseView-CkhMv-Om.js → WarehouseView-Cx2DBoD4.js} +2 -2
- package/dist/{app-BdUHoQTw.js → app-CtT6h8lm.js} +6700 -6581
- package/dist/app.js +1 -1
- package/dist/{decimal-DEVEov-F.js → decimal-DePq7POX.js} +1 -1
- package/dist/{defineDeepModel-BZrIgGc7.js → defineDeepModel-BkjaNIDl.js} +1 -1
- package/dist/{format-time-from-id-DkDDZc4Y.js → format-time-from-id-CVOhjcTS.js} +1 -1
- package/dist/{id-to-date-CN0cWcz6.js → id-to-date-B47E7iX0.js} +1 -1
- package/dist/{purchase-order-transaction-type-B80tMuy6.js → purchase-order-transaction-type-DrviWKxn.js} +3 -3
- package/dist/{supplier-BKYn47F9.js → supplier-B618i0Yb.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-template-enabled-locations-2-Cg7uYAyw.js → use-template-enabled-locations-2-XskpdT3a.js} +1 -1
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +404 -24
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +654 -81
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +614 -41
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1188 -60
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +388 -12
- package/dist/views/transfer-template/helpers/remove-deleted-skus.helper.d.ts +97 -3
- package/dist/{xlsx-BshS3GM8.js → xlsx-CsIKUaXt.js} +1 -1
- package/dist/{xlsx.util-B_wXW9m4.js → xlsx.util-Cy8L4Uc8.js} +2 -2
- package/package.json +1 -1
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-Cigg5L-V.js +0 -763
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { reactive as Ge, onMounted as
|
|
2
|
-
import { useBreakpoints as qe, components as de, FmButtonVariant as tt, useSnackbar as
|
|
1
|
+
import { reactive as Ge, onMounted as Le, computed as P, h as M, defineComponent as re, openBlock as F, createElementBlock as I, Fragment as ae, renderList as Pe, createElementVNode as r, toDisplayString as V, unref as e, resolveComponent as T, createVNode as k, withCtx as O, createCommentVNode as H, ref as N, createBlock as z, watch as $e, normalizeClass as Y, normalizeStyle as et, isRef as ce } from "vue";
|
|
2
|
+
import { useBreakpoints as qe, components as de, FmButtonVariant as tt, useSnackbar as Ae, useDialog as st, useProxiedModel as ot } from "@feedmepos/ui-library";
|
|
3
3
|
import { F as be } from "./row-action.enum-PMKMRrZR.js";
|
|
4
|
-
import { P as A, d as Ne, c as nt } from "./purchase-order-transaction-type-
|
|
5
|
-
import { a as Z, t as lt, ab as Te, E as at, b as He, R as Ie, a5 as rt, a7 as it, s as ut, a8 as
|
|
6
|
-
import { _ as We, u as ht } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { P as A, d as Ne, c as nt } from "./purchase-order-transaction-type-DrviWKxn.js";
|
|
5
|
+
import { a as Z, t as lt, ab as Te, E as at, b as He, R as Ie, a5 as rt, a7 as it, s as ut, a8 as Me, a6 as dt, H as ze, m as ct, A as Se, M as pt, ac as je, P as Ve, Q as Qe, ad as mt, j as De, ae as ft, u as Re, af as yt, ag as vt, ah as bt, G as _t, ai as gt, aj as kt, z as Ct } from "./app-CtT6h8lm.js";
|
|
6
|
+
import { _ as We, u as ht } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BygnL2Ew.js";
|
|
7
7
|
import { useI18n as me } from "@feedmepos/mf-common";
|
|
8
8
|
import "vue-router";
|
|
9
|
-
import { u as xe } from "./supplier-
|
|
10
|
-
import { d as wt } from "./defineDeepModel-
|
|
9
|
+
import { u as xe } from "./supplier-B618i0Yb.js";
|
|
10
|
+
import { d as wt } from "./defineDeepModel-BkjaNIDl.js";
|
|
11
11
|
import { F as pe, _ as St } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
12
12
|
import { _ as xt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
13
|
-
function le(
|
|
13
|
+
function le(n, v, u, i) {
|
|
14
14
|
var c, p, g;
|
|
15
15
|
if (i != null && i.manualTotalCost)
|
|
16
16
|
return i == null ? void 0 : i.manualTotalCost;
|
|
17
17
|
const d = (g = (p = (c = i == null ? void 0 : i.supplier) == null ? void 0 : c.supplyItems) == null ? void 0 : p.find(
|
|
18
|
-
(f) => f.skuId ===
|
|
19
|
-
)) == null ? void 0 : g.defaultCost, t =
|
|
18
|
+
(f) => f.skuId === n._id
|
|
19
|
+
)) == null ? void 0 : g.defaultCost, t = n.defaultCost, l = d ?? t, w = l == null ? void 0 : l.costPerUnit, m = w ? l != null && l.measurement ? +Z(w) / +Z(l == null ? void 0 : l.measurement.conversion) : +Z(w) : void 0, s = m ? u ? m * +Z(u.conversion) : m : void 0, a = s ? +Z(v) * s : void 0;
|
|
20
20
|
return a ? {
|
|
21
21
|
...lt(a ?? 0, 2),
|
|
22
22
|
currency: Te()
|
|
@@ -26,35 +26,35 @@ function le(o, v, u, i) {
|
|
|
26
26
|
currency: Te()
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
var B = /* @__PURE__ */ ((
|
|
29
|
+
var B = /* @__PURE__ */ ((n) => (n.Code = "Code", n.Name = "Name", n.Amount = "Amount", n.Cost = "Cost", n.Delete = "Delete", n))(B || {});
|
|
30
30
|
const Ft = () => {
|
|
31
|
-
const { t:
|
|
31
|
+
const { t: n } = me();
|
|
32
32
|
return M(
|
|
33
33
|
We,
|
|
34
34
|
{
|
|
35
35
|
zIndex: 50,
|
|
36
36
|
class: "whitespace-nowrap"
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
n("inventory.transfer.form.items.table.Cost", [je()])
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
|
-
function Pt(
|
|
41
|
+
function Pt(n) {
|
|
42
42
|
const { t: v } = me(), u = Ge({}), { breakpoints: i } = qe(), d = He();
|
|
43
|
-
|
|
44
|
-
for (const m of
|
|
43
|
+
Le(() => {
|
|
44
|
+
for (const m of n.items) {
|
|
45
45
|
if (!m.totalCost)
|
|
46
46
|
continue;
|
|
47
47
|
const s = le(m.sku, m.quantity, m.measurement, {
|
|
48
|
-
supplier:
|
|
48
|
+
supplier: n.supplier
|
|
49
49
|
}), a = m.totalCost ?? at.reset();
|
|
50
50
|
s ? u[m.sku._id] = s.amount !== a.amount || s.precision !== a.precision : u[m.sku._id] = !0;
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
function t(m) {
|
|
54
54
|
var a, b, c, p, g, f, S;
|
|
55
|
-
return !!(((b = (a = m.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : b.amount) ?? ((S = (f = (g = (p = (c =
|
|
55
|
+
return !!(((b = (a = m.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : b.amount) ?? ((S = (f = (g = (p = (c = n.supplier) == null ? void 0 : c.supplyItems) == null ? void 0 : p.find((x) => x.skuId === m._id)) == null ? void 0 : g.defaultCost) == null ? void 0 : f.costPerUnit) == null ? void 0 : S.amount));
|
|
56
56
|
}
|
|
57
|
-
const
|
|
57
|
+
const l = [
|
|
58
58
|
{
|
|
59
59
|
id: "Code",
|
|
60
60
|
header: () => v("inventory.transfer.form.items.table.Code"),
|
|
@@ -65,7 +65,7 @@ function Pt(o) {
|
|
|
65
65
|
return M(de.FmTextField, {
|
|
66
66
|
modelValue: s.code,
|
|
67
67
|
"onUpdate:modelValue": (a) => {
|
|
68
|
-
|
|
68
|
+
n.updateItem({
|
|
69
69
|
...s,
|
|
70
70
|
code: a
|
|
71
71
|
});
|
|
@@ -86,7 +86,7 @@ function Pt(o) {
|
|
|
86
86
|
return M(de.FmTextField, {
|
|
87
87
|
modelValue: s.name,
|
|
88
88
|
"onUpdate:modelValue": (a) => {
|
|
89
|
-
|
|
89
|
+
n.updateItem({
|
|
90
90
|
...s,
|
|
91
91
|
name: a
|
|
92
92
|
});
|
|
@@ -104,7 +104,7 @@ function Pt(o) {
|
|
|
104
104
|
minSize: 200,
|
|
105
105
|
cell(m) {
|
|
106
106
|
var b, c, p;
|
|
107
|
-
const s = m.row.original, a = (p = (c = (b =
|
|
107
|
+
const s = m.row.original, a = (p = (c = (b = n.template) == null ? void 0 : b.purchaseOrder) == null ? void 0 : c.items) == null ? void 0 : p.find(
|
|
108
108
|
(g) => g.sku._id === s.sku._id
|
|
109
109
|
);
|
|
110
110
|
return M(rt, {
|
|
@@ -124,15 +124,15 @@ function Pt(o) {
|
|
|
124
124
|
measurement: g.measurement
|
|
125
125
|
};
|
|
126
126
|
d.enableTotalCost && (f.totalCost = le(s.sku, s.quantity, s.measurement, {
|
|
127
|
-
supplier:
|
|
127
|
+
supplier: n.supplier,
|
|
128
128
|
// NOTE: set undefined here if `manualTotalCost[row.sku._id] = false`, so that the function
|
|
129
129
|
// will return the auto calculated default cost instead of the manual total cost
|
|
130
130
|
manualTotalCost: u[s.sku._id] ? f.totalCost : void 0
|
|
131
|
-
})),
|
|
131
|
+
})), n.updateItem(f);
|
|
132
132
|
},
|
|
133
133
|
stepper: a == null ? void 0 : a.quantityStep,
|
|
134
134
|
disableUnit: !!a,
|
|
135
|
-
disabled:
|
|
135
|
+
disabled: n.disabled,
|
|
136
136
|
rules: [
|
|
137
137
|
it(
|
|
138
138
|
+Z(
|
|
@@ -142,9 +142,9 @@ function Pt(o) {
|
|
|
142
142
|
}
|
|
143
143
|
)
|
|
144
144
|
),
|
|
145
|
-
a != null && a.maximumQuantity ?
|
|
145
|
+
a != null && a.maximumQuantity ? Me(
|
|
146
146
|
+Z(a == null ? void 0 : a.maximumQuantity)
|
|
147
|
-
) :
|
|
147
|
+
) : Me(1 / 0),
|
|
148
148
|
...a != null && a.quantityStep ? [dt(a.quantityStep)] : []
|
|
149
149
|
],
|
|
150
150
|
applyDefaultRules: !0
|
|
@@ -163,7 +163,7 @@ function Pt(o) {
|
|
|
163
163
|
{
|
|
164
164
|
class: [
|
|
165
165
|
"flex gap-4 fm-typo-en-body-md-400 items-center",
|
|
166
|
-
|
|
166
|
+
n.disabled ? "text-fm-color-typo-disabled" : ""
|
|
167
167
|
],
|
|
168
168
|
key: s.sku._id
|
|
169
169
|
},
|
|
@@ -171,12 +171,12 @@ function Pt(o) {
|
|
|
171
171
|
M(de.FmButton, {
|
|
172
172
|
prependIcon: "edit",
|
|
173
173
|
variant: tt.Tertiary,
|
|
174
|
-
disabled:
|
|
174
|
+
disabled: n.disabled,
|
|
175
175
|
onClick() {
|
|
176
|
-
|
|
176
|
+
n.updateItem({
|
|
177
177
|
...s,
|
|
178
178
|
totalCost: le(s.sku, s.quantity, s.measurement, {
|
|
179
|
-
supplier:
|
|
179
|
+
supplier: n.supplier
|
|
180
180
|
})
|
|
181
181
|
}), u[s.sku._id] = !0;
|
|
182
182
|
}
|
|
@@ -191,11 +191,11 @@ function Pt(o) {
|
|
|
191
191
|
"span",
|
|
192
192
|
b ? ze(
|
|
193
193
|
le(s.sku, s.quantity, s.measurement, {
|
|
194
|
-
supplier:
|
|
194
|
+
supplier: n.supplier
|
|
195
195
|
})
|
|
196
196
|
) : Z(
|
|
197
197
|
le(s.sku, s.quantity, s.measurement, {
|
|
198
|
-
supplier:
|
|
198
|
+
supplier: n.supplier
|
|
199
199
|
})
|
|
200
200
|
)
|
|
201
201
|
),
|
|
@@ -204,7 +204,7 @@ function Pt(o) {
|
|
|
204
204
|
{
|
|
205
205
|
class: [
|
|
206
206
|
"fm-typo-en-body-sm-400",
|
|
207
|
-
|
|
207
|
+
n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
|
|
208
208
|
]
|
|
209
209
|
},
|
|
210
210
|
v("inventory.transfer.form.items.autoCalculated")
|
|
@@ -218,7 +218,7 @@ function Pt(o) {
|
|
|
218
218
|
modelValue: Z(s.totalCost ?? { amount: 0, precision: 0 }),
|
|
219
219
|
key: s.sku._id,
|
|
220
220
|
"onUpdate:modelValue": (c) => {
|
|
221
|
-
|
|
221
|
+
n.updateItem({
|
|
222
222
|
...s,
|
|
223
223
|
totalCost: {
|
|
224
224
|
...ct(+c),
|
|
@@ -235,7 +235,7 @@ function Pt(o) {
|
|
|
235
235
|
{
|
|
236
236
|
class: [
|
|
237
237
|
"text-fm-typo-en-body-lg-400",
|
|
238
|
-
|
|
238
|
+
n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
239
239
|
]
|
|
240
240
|
},
|
|
241
241
|
je()
|
|
@@ -245,14 +245,14 @@ function Pt(o) {
|
|
|
245
245
|
return a ? M(de.FmButton, {
|
|
246
246
|
prependIcon: "close",
|
|
247
247
|
variant: "tertiary",
|
|
248
|
-
disabled:
|
|
248
|
+
disabled: n.disabled,
|
|
249
249
|
onClick() {
|
|
250
|
-
|
|
250
|
+
n.updateItem({
|
|
251
251
|
...s,
|
|
252
252
|
// NOTE: different from PO template, if a default cost is reenabled,
|
|
253
253
|
// the total cost will automatically assigned
|
|
254
254
|
totalCost: le(s.sku, s.quantity, s.measurement, {
|
|
255
|
-
supplier:
|
|
255
|
+
supplier: n.supplier
|
|
256
256
|
})
|
|
257
257
|
}), u[s.sku._id] = !1;
|
|
258
258
|
}
|
|
@@ -275,9 +275,9 @@ function Pt(o) {
|
|
|
275
275
|
icon: "delete",
|
|
276
276
|
variant: "tertiary",
|
|
277
277
|
size: "md",
|
|
278
|
-
disabled:
|
|
278
|
+
disabled: n.disabled,
|
|
279
279
|
onClick: () => {
|
|
280
|
-
|
|
280
|
+
n.deleteItem(s);
|
|
281
281
|
}
|
|
282
282
|
});
|
|
283
283
|
},
|
|
@@ -290,7 +290,7 @@ function Pt(o) {
|
|
|
290
290
|
}
|
|
291
291
|
];
|
|
292
292
|
return {
|
|
293
|
-
columnDefs: P(() => d.enableTotalCost &&
|
|
293
|
+
columnDefs: P(() => d.enableTotalCost && n.transferType === A.PURCHASE ? l : l.filter(
|
|
294
294
|
(m) => m.id !== "Cost"
|
|
295
295
|
/* Cost */
|
|
296
296
|
))
|
|
@@ -301,19 +301,19 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
301
301
|
props: {
|
|
302
302
|
prices: {}
|
|
303
303
|
},
|
|
304
|
-
setup(
|
|
304
|
+
setup(n) {
|
|
305
305
|
const v = xe();
|
|
306
306
|
function u(i) {
|
|
307
307
|
return v.suppliers.find((d) => d._id === i);
|
|
308
308
|
}
|
|
309
309
|
return (i, d) => (F(), I("div", Tt, [
|
|
310
310
|
(F(!0), I(ae, null, Pe(Object.keys(i.prices), (t) => {
|
|
311
|
-
var
|
|
311
|
+
var l;
|
|
312
312
|
return F(), I("div", {
|
|
313
313
|
key: t,
|
|
314
314
|
class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
|
|
315
315
|
}, [
|
|
316
|
-
r("div", It, V((
|
|
316
|
+
r("div", It, V((l = u(t)) == null ? void 0 : l.name), 1),
|
|
317
317
|
r("div", $t, [
|
|
318
318
|
(F(!0), I(ae, null, Pe(i.prices[t].slice(0, 3), (w) => {
|
|
319
319
|
var m;
|
|
@@ -330,7 +330,7 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
330
330
|
r("div", Vt, [
|
|
331
331
|
r("span", null, "(#" + V(w.seqNumber) + ")", 1),
|
|
332
332
|
d[1] || (d[1] = r("span", null, V(" "), -1)),
|
|
333
|
-
r("span", null, V(e(
|
|
333
|
+
r("span", null, V(e(Ve)(new Date(w.date))), 1)
|
|
334
334
|
])
|
|
335
335
|
]);
|
|
336
336
|
}), 128))
|
|
@@ -350,10 +350,10 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
350
350
|
showComparePrice: { type: Boolean },
|
|
351
351
|
row: {}
|
|
352
352
|
},
|
|
353
|
-
setup(
|
|
353
|
+
setup(n) {
|
|
354
354
|
const { t: v } = me();
|
|
355
355
|
return (u, i) => {
|
|
356
|
-
var
|
|
356
|
+
var l, w, m, s, a, b, c, p, g, f, S, x, E, $, U, L, G, ee, K, J, j, _, C, D, te, Q, se;
|
|
357
357
|
const d = T("FmLabel"), t = T("FmSpacer");
|
|
358
358
|
return F(), I("div", Dt, [
|
|
359
359
|
r("div", Rt, [
|
|
@@ -363,7 +363,7 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
363
363
|
]),
|
|
364
364
|
r("div", null, [
|
|
365
365
|
k(e(pe), {
|
|
366
|
-
render: (m = (w = (
|
|
366
|
+
render: (m = (w = (l = u.cellByColId.Delete) == null ? void 0 : l.column) == null ? void 0 : w.columnDef) == null ? void 0 : m.cell,
|
|
367
367
|
props: (a = (s = u.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : a.call(s)
|
|
368
368
|
}, null, 8, ["render", "props"])
|
|
369
369
|
])
|
|
@@ -427,27 +427,27 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
427
427
|
};
|
|
428
428
|
}
|
|
429
429
|
});
|
|
430
|
-
function _e(
|
|
431
|
-
return mt.parse(
|
|
430
|
+
function _e(n) {
|
|
431
|
+
return mt.parse(n);
|
|
432
432
|
}
|
|
433
|
-
function we(
|
|
433
|
+
function we(n) {
|
|
434
434
|
return {
|
|
435
|
-
_id:
|
|
436
|
-
internal:
|
|
437
|
-
contactName:
|
|
438
|
-
name:
|
|
439
|
-
email:
|
|
440
|
-
phoneNumber:
|
|
441
|
-
registrationNumber:
|
|
442
|
-
address:
|
|
435
|
+
_id: n.doc._id,
|
|
436
|
+
internal: n.type,
|
|
437
|
+
contactName: n.doc.profile.name,
|
|
438
|
+
name: n.doc.profile.name,
|
|
439
|
+
email: n.doc.profile.email,
|
|
440
|
+
phoneNumber: n.doc.profile.phoneNo,
|
|
441
|
+
registrationNumber: n.doc.profile.regNo,
|
|
442
|
+
address: n.doc.profile.address
|
|
443
443
|
};
|
|
444
444
|
}
|
|
445
|
-
function jt(
|
|
446
|
-
const i = xe(), d =
|
|
445
|
+
function jt(n, v, u = !1) {
|
|
446
|
+
const i = xe(), d = De();
|
|
447
447
|
d.watchLocation(async () => {
|
|
448
448
|
var S;
|
|
449
449
|
await i.readSuppliers();
|
|
450
|
-
const c =
|
|
450
|
+
const c = n();
|
|
451
451
|
if ((S = c.supplier) != null && S._id) return;
|
|
452
452
|
const p = d.businessLevel ? i.businessSuppliers[0] : i.suppliers[0], f = (u ? d.locations.filter((x) => x.doc._id !== d.currentLocation.doc._id) : d.locations)[0];
|
|
453
453
|
v({
|
|
@@ -458,15 +458,15 @@ function jt(o, v, u = !1) {
|
|
|
458
458
|
const t = P(
|
|
459
459
|
() => {
|
|
460
460
|
var c, p;
|
|
461
|
-
return typeof ((p = (c =
|
|
461
|
+
return typeof ((p = (c = n()) == null ? void 0 : c.supplier) == null ? void 0 : p.internal) == "string" ? A.TRANSFER : A.PURCHASE;
|
|
462
462
|
}
|
|
463
|
-
),
|
|
463
|
+
), l = P({
|
|
464
464
|
get() {
|
|
465
465
|
var c, p;
|
|
466
|
-
return (p = (c =
|
|
466
|
+
return (p = (c = n()) == null ? void 0 : c.supplier) == null ? void 0 : p._id;
|
|
467
467
|
},
|
|
468
468
|
set(c) {
|
|
469
|
-
const p =
|
|
469
|
+
const p = n() ?? {};
|
|
470
470
|
if (t.value === A.PURCHASE) {
|
|
471
471
|
const E = (d.businessLevel ? i.businessSuppliers : i.suppliers).find(($) => $._id === c);
|
|
472
472
|
v({
|
|
@@ -504,7 +504,7 @@ function jt(o, v, u = !1) {
|
|
|
504
504
|
}));
|
|
505
505
|
}), b = P(() => {
|
|
506
506
|
var f, S;
|
|
507
|
-
const c = (S = (f =
|
|
507
|
+
const c = (S = (f = n()) == null ? void 0 : f.supplier) == null ? void 0 : S._id;
|
|
508
508
|
if (t.value === A.PURCHASE) {
|
|
509
509
|
const x = i.suppliers.find((E) => E._id === c);
|
|
510
510
|
return x ? _e(x) : null;
|
|
@@ -513,21 +513,21 @@ function jt(o, v, u = !1) {
|
|
|
513
513
|
return g ? we(g) : null;
|
|
514
514
|
});
|
|
515
515
|
return {
|
|
516
|
-
transferLocationModel:
|
|
516
|
+
transferLocationModel: l,
|
|
517
517
|
transferLocationOptions: a,
|
|
518
518
|
locationOptionsTypePurchase: w,
|
|
519
519
|
locationOptionsTypeTransfer: s,
|
|
520
520
|
selectedLocation: b
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
|
-
function Qt(
|
|
523
|
+
function Qt(n) {
|
|
524
524
|
const v = P({
|
|
525
525
|
get() {
|
|
526
|
-
const t =
|
|
526
|
+
const t = n.getEffectiveAt();
|
|
527
527
|
return t ? new Date(t) : null;
|
|
528
528
|
},
|
|
529
529
|
set(t) {
|
|
530
|
-
|
|
530
|
+
n.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
|
|
531
531
|
}
|
|
532
532
|
}), u = P({
|
|
533
533
|
get() {
|
|
@@ -538,7 +538,7 @@ function Qt(o) {
|
|
|
538
538
|
}
|
|
539
539
|
}), i = P({
|
|
540
540
|
get() {
|
|
541
|
-
return v.value === null ? "" :
|
|
541
|
+
return v.value === null ? "" : Ve(v.value);
|
|
542
542
|
},
|
|
543
543
|
set(t) {
|
|
544
544
|
t ? v.value = /* @__PURE__ */ new Date(`${t} ${d.value}`) : v.value = null;
|
|
@@ -576,47 +576,47 @@ const Wt = {
|
|
|
576
576
|
default: "#c7c7cc"
|
|
577
577
|
}
|
|
578
578
|
},
|
|
579
|
-
setup(
|
|
579
|
+
setup(n) {
|
|
580
580
|
return (v, u) => (F(), I("svg", Wt, [
|
|
581
581
|
r("path", {
|
|
582
582
|
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",
|
|
583
|
-
fill:
|
|
583
|
+
fill: n.color
|
|
584
584
|
}, null, 8, Yt),
|
|
585
585
|
r("path", {
|
|
586
586
|
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",
|
|
587
|
-
fill:
|
|
587
|
+
fill: n.color
|
|
588
588
|
}, null, 8, Zt),
|
|
589
589
|
r("path", {
|
|
590
590
|
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",
|
|
591
|
-
stroke:
|
|
591
|
+
stroke: n.color,
|
|
592
592
|
"stroke-width": "1.5",
|
|
593
593
|
"stroke-linecap": "round",
|
|
594
594
|
"stroke-linejoin": "round"
|
|
595
595
|
}, null, 8, Kt),
|
|
596
596
|
r("path", {
|
|
597
597
|
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",
|
|
598
|
-
stroke:
|
|
598
|
+
stroke: n.color,
|
|
599
599
|
"stroke-width": "1.5",
|
|
600
600
|
"stroke-linecap": "round",
|
|
601
601
|
"stroke-linejoin": "round"
|
|
602
602
|
}, null, 8, Jt)
|
|
603
603
|
]));
|
|
604
604
|
}
|
|
605
|
-
}), Gt = { class: "flex gap-8 items-center" }, es = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, ts = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, ss = { class: "flex items-center w-full" }, os = { class: "flex-1" }, ns = { class: "fm-typo-en-title-sm-800" }, ls = { class: "flex items-start gap-8" }, as = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, rs = { class: "flex gap-1" },
|
|
605
|
+
}), Gt = { class: "flex gap-8 items-center" }, es = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, ts = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, ss = { class: "flex items-center w-full" }, os = { class: "flex-1" }, ns = { class: "fm-typo-en-title-sm-800" }, ls = { class: "flex items-start gap-8" }, as = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, rs = { class: "flex gap-1" }, Ee = /* @__PURE__ */ re({
|
|
606
606
|
__name: "ForecastStock",
|
|
607
607
|
props: {
|
|
608
608
|
disabled: { type: Boolean }
|
|
609
609
|
},
|
|
610
610
|
emits: ["update:poItems"],
|
|
611
|
-
setup(
|
|
612
|
-
const u = v, i = N(!1), d = N(7), t = ht(),
|
|
611
|
+
setup(n, { emit: v }) {
|
|
612
|
+
const u = v, i = N(!1), d = N(7), t = ht(), l = Ae(), w = Re(), { t: m } = me();
|
|
613
613
|
async function s() {
|
|
614
614
|
if (d.value < 1)
|
|
615
615
|
return;
|
|
616
616
|
i.value = !1, await t.readPurchaseOrder(d.value);
|
|
617
617
|
const a = [];
|
|
618
618
|
if (t.purchaseOrderForecast.skus.length <= 0) {
|
|
619
|
-
|
|
619
|
+
l.open({
|
|
620
620
|
message: m("inventory.transfer.form.items.forecastStock.notAvailable"),
|
|
621
621
|
type: "info"
|
|
622
622
|
});
|
|
@@ -724,15 +724,15 @@ const Wt = {
|
|
|
724
724
|
}
|
|
725
725
|
});
|
|
726
726
|
function is() {
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
|
|
727
|
+
const n = Ae(), v = Ne(), u = N(!1);
|
|
728
|
+
$e(u, (l) => {
|
|
729
|
+
l && (d.value = !0, i().finally(() => {
|
|
730
730
|
d.value = !1;
|
|
731
731
|
}));
|
|
732
732
|
});
|
|
733
733
|
async function i() {
|
|
734
734
|
try {
|
|
735
|
-
const { startDate:
|
|
735
|
+
const { startDate: l, endDate: w } = yt(6), a = (await v.getPurchaseOrders({ start: l, end: w })).filter(
|
|
736
736
|
(b) => {
|
|
737
737
|
var c, p;
|
|
738
738
|
return b.status === vt.enum.COMPLETE && ((c = b.supplier) == null ? void 0 : c.internal) !== "warehouse" && ((p = b.supplier) == null ? void 0 : p.internal) !== "restaurant";
|
|
@@ -755,7 +755,7 @@ function is() {
|
|
|
755
755
|
}, {});
|
|
756
756
|
t.value = a;
|
|
757
757
|
} catch {
|
|
758
|
-
|
|
758
|
+
n.open({
|
|
759
759
|
title: "Something went wrong",
|
|
760
760
|
message: "Cannot retrieve supplier purchase history. Please try again."
|
|
761
761
|
}), u.value = !1;
|
|
@@ -775,7 +775,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
775
775
|
comparePriceBySku: {},
|
|
776
776
|
showComparePrice: { type: Boolean }
|
|
777
777
|
},
|
|
778
|
-
setup(
|
|
778
|
+
setup(n) {
|
|
779
779
|
function v(u) {
|
|
780
780
|
return u.column.columnDef.meta;
|
|
781
781
|
}
|
|
@@ -787,24 +787,24 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
787
787
|
"bg-fm-color-neutral-gray-100": u.row.getIsSelected()
|
|
788
788
|
}])
|
|
789
789
|
}, [
|
|
790
|
-
(F(!0), I(ae, null, Pe(u.row.getVisibleCells(), (
|
|
790
|
+
(F(!0), I(ae, null, Pe(u.row.getVisibleCells(), (l) => {
|
|
791
791
|
var w, m, s, a;
|
|
792
792
|
return F(), I("td", {
|
|
793
|
-
key:
|
|
793
|
+
key: l.id,
|
|
794
794
|
class: Y([
|
|
795
795
|
"h-[52px] px-16 text-fm-color-typo-primary",
|
|
796
|
-
((w = v(
|
|
796
|
+
((w = v(l)) == null ? void 0 : w.cellClass) ?? "px-16"
|
|
797
797
|
]),
|
|
798
798
|
style: et({
|
|
799
|
-
width: (m = v(
|
|
800
|
-
maxWidth: (s = v(
|
|
801
|
-
textAlign: ((a = v(
|
|
799
|
+
width: (m = v(l)) == null ? void 0 : m.width,
|
|
800
|
+
maxWidth: (s = v(l)) == null ? void 0 : s.maxWidth,
|
|
801
|
+
textAlign: ((a = v(l)) == null ? void 0 : a.textAlign) ?? "left"
|
|
802
802
|
})
|
|
803
803
|
}, [
|
|
804
804
|
r("span", us, [
|
|
805
805
|
k(e(pe), {
|
|
806
|
-
render:
|
|
807
|
-
props:
|
|
806
|
+
render: l.column.columnDef.cell,
|
|
807
|
+
props: l.getContext()
|
|
808
808
|
}, null, 8, ["render", "props"])
|
|
809
809
|
])
|
|
810
810
|
], 6);
|
|
@@ -842,15 +842,17 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
842
842
|
lastClosingDate: {}
|
|
843
843
|
},
|
|
844
844
|
emits: ["validation-success", "form:ready"],
|
|
845
|
-
setup(
|
|
846
|
-
const i =
|
|
847
|
-
() => c.templates.value.find((
|
|
845
|
+
setup(n, { expose: v, emit: u }) {
|
|
846
|
+
const i = n, d = u, t = wt(), { t: l } = me(), w = De(), m = Re(), s = kt(), a = xe(), b = He(), c = nt(), { breakpoints: p } = qe(), g = P(() => p.value.xs || p.value.sm), f = P(
|
|
847
|
+
() => c.templates.value.find((o) => o._id === t.template)
|
|
848
848
|
), S = P(() => t.status === "DRAFT" || !t._rev);
|
|
849
|
-
|
|
850
|
-
|
|
849
|
+
$e(f, (o) => {
|
|
850
|
+
o && (t.supplier = (o == null ? void 0 : o.purchaseOrder.supplier) ?? t.supplier);
|
|
851
|
+
}), Le(async () => {
|
|
852
|
+
var o;
|
|
851
853
|
try {
|
|
852
854
|
if (!t.template) return;
|
|
853
|
-
await c.loadTemplate(t.template), t.items.length || (t.items = ((
|
|
855
|
+
await c.loadTemplate(t.template), t.items.length || (t.items = ((o = f.value) == null ? void 0 : o.purchaseOrder.items) ?? []);
|
|
854
856
|
} finally {
|
|
855
857
|
d("form:ready");
|
|
856
858
|
}
|
|
@@ -859,52 +861,52 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
859
861
|
() => w.currentLocation.type === Qe.restaurant
|
|
860
862
|
);
|
|
861
863
|
w.watchLocation(async () => {
|
|
862
|
-
location && (t.supplier || (t.supplier = a.suppliers.find((
|
|
864
|
+
location && (t.supplier || (t.supplier = a.suppliers.find((o) => o) ?? t.supplier));
|
|
863
865
|
});
|
|
864
866
|
const E = st(), $ = jt(
|
|
865
867
|
() => t,
|
|
866
|
-
(
|
|
867
|
-
Object.assign(t,
|
|
868
|
+
(o) => {
|
|
869
|
+
Object.assign(t, o);
|
|
868
870
|
},
|
|
869
871
|
!0
|
|
870
872
|
), U = P({
|
|
871
873
|
get() {
|
|
872
|
-
var
|
|
873
|
-
return typeof ((
|
|
874
|
+
var o;
|
|
875
|
+
return typeof ((o = t == null ? void 0 : t.supplier) == null ? void 0 : o.internal) == "string" ? A.TRANSFER : A.PURCHASE;
|
|
874
876
|
},
|
|
875
|
-
set(
|
|
877
|
+
set(o) {
|
|
876
878
|
var q;
|
|
877
879
|
const y = typeof ((q = t == null ? void 0 : t.supplier) == null ? void 0 : q.internal) == "string" ? A.TRANSFER : A.PURCHASE;
|
|
878
|
-
|
|
880
|
+
o !== y && (t.supplier = o === A.PURCHASE ? $.locationOptionsTypePurchase.value[0] : $.locationOptionsTypeTransfer.value[0]);
|
|
879
881
|
}
|
|
880
882
|
}), L = P(() => $.transferLocationOptions.value), G = P({
|
|
881
883
|
get() {
|
|
882
884
|
return t.supplier._id;
|
|
883
885
|
},
|
|
884
|
-
set(
|
|
885
|
-
$.transferLocationModel.value =
|
|
886
|
+
set(o) {
|
|
887
|
+
$.transferLocationModel.value = o;
|
|
886
888
|
}
|
|
887
889
|
}), ee = P({
|
|
888
890
|
get() {
|
|
889
891
|
return t.remark ?? void 0;
|
|
890
892
|
},
|
|
891
|
-
set(
|
|
892
|
-
t.remark =
|
|
893
|
+
set(o) {
|
|
894
|
+
t.remark = o;
|
|
893
895
|
}
|
|
894
896
|
}), K = P({
|
|
895
897
|
get() {
|
|
896
|
-
var
|
|
897
|
-
return ((
|
|
898
|
+
var o;
|
|
899
|
+
return ((o = t.netSuite) == null ? void 0 : o.subsidiary) || {
|
|
898
900
|
subsidiary: {
|
|
899
901
|
id: "",
|
|
900
902
|
name: ""
|
|
901
903
|
}
|
|
902
904
|
};
|
|
903
905
|
},
|
|
904
|
-
set(
|
|
906
|
+
set(o) {
|
|
905
907
|
t.netSuite = {
|
|
906
908
|
...t.netSuite,
|
|
907
|
-
subsidiary:
|
|
909
|
+
subsidiary: o
|
|
908
910
|
}, t.items = t.items.filter(
|
|
909
911
|
(y) => {
|
|
910
912
|
var q;
|
|
@@ -916,30 +918,30 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
916
918
|
getEffectiveAt() {
|
|
917
919
|
return t.effectiveAt;
|
|
918
920
|
},
|
|
919
|
-
setEffectiveAt(
|
|
920
|
-
t.effectiveAt =
|
|
921
|
+
setEffectiveAt(o) {
|
|
922
|
+
t.effectiveAt = o;
|
|
921
923
|
}
|
|
922
924
|
}), { comparePricesToggle: D, comparePriceFetching: te, comparePriceBySku: Q } = is(), se = N();
|
|
923
925
|
v({
|
|
924
926
|
validateInputs: () => {
|
|
925
|
-
var
|
|
926
|
-
(y = (
|
|
927
|
+
var o, y;
|
|
928
|
+
(y = (o = se.value) == null ? void 0 : o.validateInputs) == null || y.call(o);
|
|
927
929
|
},
|
|
928
930
|
resetInputsValidation: () => {
|
|
929
|
-
var
|
|
930
|
-
(y = (
|
|
931
|
+
var o, y;
|
|
932
|
+
(y = (o = se.value) == null ? void 0 : o.resetInputsValidation) == null || y.call(o);
|
|
931
933
|
},
|
|
932
934
|
resetInputs: () => {
|
|
933
|
-
var
|
|
934
|
-
(y = (
|
|
935
|
+
var o, y;
|
|
936
|
+
(y = (o = se.value) == null ? void 0 : o.resetInputs) == null || y.call(o);
|
|
935
937
|
}
|
|
936
938
|
});
|
|
937
939
|
const Ze = Pt({
|
|
938
|
-
updateItem: (
|
|
939
|
-
t.items = t.items.map((y) => y.sku._id !==
|
|
940
|
+
updateItem: (o) => {
|
|
941
|
+
t.items = t.items.map((y) => y.sku._id !== o.sku._id ? y : o);
|
|
940
942
|
},
|
|
941
|
-
deleteItem: (
|
|
942
|
-
t.items = t.items.filter((y) => y.sku._id !==
|
|
943
|
+
deleteItem: (o) => {
|
|
944
|
+
t.items = t.items.filter((y) => y.sku._id !== o.sku._id);
|
|
943
945
|
},
|
|
944
946
|
get supplier() {
|
|
945
947
|
return t.supplier;
|
|
@@ -959,7 +961,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
959
961
|
}), Ke = P(() => Ze.columnDefs.value);
|
|
960
962
|
function Je() {
|
|
961
963
|
var fe, ie, ke;
|
|
962
|
-
const
|
|
964
|
+
const o = new Set((ke = (ie = (fe = f.value) == null ? void 0 : fe.purchaseOrder) == null ? void 0 : ie.items) == null ? void 0 : ke.map((R) => R.sku._id)), q = (o.size ? m.skus.filter((R) => o.has(R._id)) : m.skus).filter((R) => {
|
|
963
965
|
var W;
|
|
964
966
|
return !s.getAvailableItems((W = t.netSuite) == null ? void 0 : W.subsidiary.id).includes(R._id);
|
|
965
967
|
}).map(
|
|
@@ -973,7 +975,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
973
975
|
return (W = t.items) == null ? void 0 : W.find((ue) => ue.sku._id === R.value._id);
|
|
974
976
|
}).map((R) => R.value);
|
|
975
977
|
E.open({
|
|
976
|
-
title:
|
|
978
|
+
title: l("inventory.transfer.form.items.selectItem"),
|
|
977
979
|
closeButton: !0,
|
|
978
980
|
contentComponent: Ct,
|
|
979
981
|
contentComponentProps: {
|
|
@@ -982,11 +984,11 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
982
984
|
virtualScroll: !0
|
|
983
985
|
},
|
|
984
986
|
primaryActions: {
|
|
985
|
-
text:
|
|
987
|
+
text: l("common.confirm"),
|
|
986
988
|
close: !0
|
|
987
989
|
},
|
|
988
990
|
secondaryActions: {
|
|
989
|
-
text:
|
|
991
|
+
text: l("common.close"),
|
|
990
992
|
close: !0,
|
|
991
993
|
variant: "tertiary"
|
|
992
994
|
}
|
|
@@ -1019,18 +1021,18 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1019
1021
|
ue.sort((X, oe) => X.sku.code.localeCompare(oe.sku.code)), t.items = ue;
|
|
1020
1022
|
});
|
|
1021
1023
|
}
|
|
1022
|
-
function Os(
|
|
1023
|
-
return
|
|
1024
|
+
function Os(o) {
|
|
1025
|
+
return o;
|
|
1024
1026
|
}
|
|
1025
|
-
return (
|
|
1026
|
-
var
|
|
1027
|
+
return (o, y) => {
|
|
1028
|
+
var Oe, Ue;
|
|
1027
1029
|
const q = T("FmChip"), ge = T("FmLabel"), fe = T("FmField"), ie = T("FmSelect"), ke = T("FmTextField"), R = T("FmTextarea"), W = T("FmSwitch"), ue = T("FmDatePicker"), X = T("FmTimePicker"), oe = T("FmFormGroup"), ne = T("FmIcon"), Ce = T("FmButton"), he = T("FmTooltip"), ye = T("FmTable"), Xe = T("FmForm");
|
|
1028
1030
|
return F(), I("div", ms, [
|
|
1029
1031
|
r("div", fs, [
|
|
1030
|
-
(
|
|
1032
|
+
(Oe = i.modelValue) != null && Oe.template ? (F(), z(q, {
|
|
1031
1033
|
key: 0,
|
|
1032
|
-
variant:
|
|
1033
|
-
label: `${e(
|
|
1034
|
+
variant: o.disabled ? "warning" : void 0,
|
|
1035
|
+
label: `${e(l)("inventory.transfer.template.title")}: ${((Ue = f.value) == null ? void 0 : Ue.name) ?? e(l)("inventory.transfer.form.loading")}`,
|
|
1034
1036
|
icon: "summarize",
|
|
1035
1037
|
compact: ""
|
|
1036
1038
|
}, null, 8, ["variant", "label"])) : H("", !0),
|
|
@@ -1039,9 +1041,9 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1039
1041
|
icon: "storefront",
|
|
1040
1042
|
compact: ""
|
|
1041
1043
|
}, null, 8, ["label"]),
|
|
1042
|
-
|
|
1044
|
+
o.lastClosingDate ? (F(), z(q, {
|
|
1043
1045
|
key: 1,
|
|
1044
|
-
label: `${e(
|
|
1046
|
+
label: `${e(l)("inventory.transfer.form.lastClosing")}: ${e(Ve)(o.lastClosingDate)} ${e(_t)(o.lastClosingDate)}`,
|
|
1045
1047
|
icon: "calendar_month",
|
|
1046
1048
|
compact: ""
|
|
1047
1049
|
}, null, 8, ["label"])) : H("", !0)
|
|
@@ -1050,40 +1052,40 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1050
1052
|
ref_key: "formRef",
|
|
1051
1053
|
ref: se,
|
|
1052
1054
|
class: "flex flex-col gap-32",
|
|
1053
|
-
disabled:
|
|
1055
|
+
disabled: o.disabled,
|
|
1054
1056
|
onValidationFailed: console.log,
|
|
1055
1057
|
onValidationSuccess: y[13] || (y[13] = (Fe) => d("validation-success"))
|
|
1056
1058
|
}, {
|
|
1057
1059
|
default: O(() => {
|
|
1058
|
-
var Fe,
|
|
1060
|
+
var Fe, Be;
|
|
1059
1061
|
return [
|
|
1060
1062
|
r("div", ys, [
|
|
1061
1063
|
r("div", vs, [
|
|
1062
1064
|
(Fe = i.modelValue) != null && Fe.template ? (F(), I(ae, { key: 0 }, [
|
|
1063
1065
|
r("div", bs, [
|
|
1064
1066
|
k(ge, {
|
|
1065
|
-
label: e(
|
|
1067
|
+
label: e(l)("inventory.transfer.form.type.title")
|
|
1066
1068
|
}, null, 8, ["label"]),
|
|
1067
1069
|
r("div", _s, [
|
|
1068
1070
|
k(fe, null, {
|
|
1069
1071
|
default: O(() => [
|
|
1070
1072
|
r("span", {
|
|
1071
|
-
class: Y({ "text-fm-color-typo-disabled":
|
|
1072
|
-
}, V(e(
|
|
1073
|
+
class: Y({ "text-fm-color-typo-disabled": o.disabled })
|
|
1074
|
+
}, V(e(l)(`inventory.transfer.form.type.${U.value.toLocaleLowerCase("en-us")}`)), 3)
|
|
1073
1075
|
]),
|
|
1074
1076
|
_: 1
|
|
1075
1077
|
}),
|
|
1076
1078
|
r("div", {
|
|
1077
1079
|
class: Y([
|
|
1078
1080
|
"fm-typo-en-body-sm-400",
|
|
1079
|
-
|
|
1081
|
+
o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
1080
1082
|
])
|
|
1081
1083
|
}, " This field is locked from template. ", 2)
|
|
1082
1084
|
])
|
|
1083
1085
|
]),
|
|
1084
1086
|
r("div", gs, [
|
|
1085
1087
|
k(ge, {
|
|
1086
|
-
label: U.value === e(A).PURCHASE ? e(
|
|
1088
|
+
label: U.value === e(A).PURCHASE ? e(l)("inventory.transfer.form.purchaseFrom") : e(l)("inventory.transfer.form.transferFrom")
|
|
1087
1089
|
}, null, 8, ["label"]),
|
|
1088
1090
|
r("div", ks, [
|
|
1089
1091
|
k(fe, null, {
|
|
@@ -1091,7 +1093,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1091
1093
|
var h;
|
|
1092
1094
|
return [
|
|
1093
1095
|
r("span", {
|
|
1094
|
-
class: Y({ "text-fm-color-typo-disabled":
|
|
1096
|
+
class: Y({ "text-fm-color-typo-disabled": o.disabled })
|
|
1095
1097
|
}, V((h = L.value.find((ve) => ve.value === G.value)) == null ? void 0 : h.label), 3)
|
|
1096
1098
|
];
|
|
1097
1099
|
}),
|
|
@@ -1100,58 +1102,58 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1100
1102
|
r("div", {
|
|
1101
1103
|
class: Y([
|
|
1102
1104
|
"fm-typo-en-body-sm-400",
|
|
1103
|
-
|
|
1105
|
+
o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
1104
1106
|
])
|
|
1105
1107
|
}, " This field is locked from template. ", 2)
|
|
1106
1108
|
])
|
|
1107
1109
|
])
|
|
1108
1110
|
], 64)) : (F(), I(ae, { key: 1 }, [
|
|
1109
1111
|
k(ie, {
|
|
1110
|
-
label: e(
|
|
1112
|
+
label: e(l)("inventory.transfer.form.type.title"),
|
|
1111
1113
|
"model-value": U.value,
|
|
1112
1114
|
"onUpdate:modelValue": y[0] || (y[0] = (h) => U.value = h),
|
|
1113
1115
|
items: [
|
|
1114
1116
|
{
|
|
1115
|
-
label: e(
|
|
1117
|
+
label: e(l)("inventory.transfer.form.type.purchase"),
|
|
1116
1118
|
value: e(A).PURCHASE,
|
|
1117
1119
|
disabled: !e($).locationOptionsTypePurchase.value.length,
|
|
1118
|
-
sublabel: e($).locationOptionsTypePurchase.value.length ? void 0 : e(
|
|
1120
|
+
sublabel: e($).locationOptionsTypePurchase.value.length ? void 0 : e(l)("inventory.transfer.form.noSupplierAvailable")
|
|
1119
1121
|
},
|
|
1120
1122
|
{
|
|
1121
|
-
label: e(
|
|
1123
|
+
label: e(l)("inventory.transfer.form.type.transfer"),
|
|
1122
1124
|
value: e(A).TRANSFER,
|
|
1123
1125
|
disabled: !e($).locationOptionsTypeTransfer.value.length,
|
|
1124
|
-
sublabel: e($).locationOptionsTypeTransfer.value.length ? void 0 : e(
|
|
1126
|
+
sublabel: e($).locationOptionsTypeTransfer.value.length ? void 0 : e(l)("inventory.transfer.form.noLocationAvailable")
|
|
1125
1127
|
}
|
|
1126
1128
|
],
|
|
1127
1129
|
rules: [e(Se)(1)(L.value)]
|
|
1128
1130
|
}, null, 8, ["label", "model-value", "items", "rules"]),
|
|
1129
1131
|
k(ie, {
|
|
1130
|
-
label: U.value === e(A).PURCHASE ? e(
|
|
1132
|
+
label: U.value === e(A).PURCHASE ? e(l)("inventory.transfer.form.purchaseFrom") : e(l)("inventory.transfer.form.transferFrom"),
|
|
1131
1133
|
modelValue: G.value,
|
|
1132
1134
|
"onUpdate:modelValue": y[1] || (y[1] = (h) => G.value = h),
|
|
1133
1135
|
items: L.value
|
|
1134
1136
|
}, null, 8, ["label", "modelValue", "items"])
|
|
1135
1137
|
], 64)),
|
|
1136
1138
|
k(ke, {
|
|
1137
|
-
label: e(
|
|
1139
|
+
label: e(l)("inventory.transfer.form.reference"),
|
|
1138
1140
|
"label-mark": "optional",
|
|
1139
1141
|
modelValue: e(t).ref,
|
|
1140
1142
|
"onUpdate:modelValue": y[2] || (y[2] = (h) => e(t).ref = h)
|
|
1141
1143
|
}, null, 8, ["label", "modelValue"]),
|
|
1142
1144
|
k(R, {
|
|
1143
|
-
label: e(
|
|
1145
|
+
label: e(l)("inventory.transfer.form.remark"),
|
|
1144
1146
|
"label-mark": "optional",
|
|
1145
1147
|
"max-length": 240,
|
|
1146
1148
|
modelValue: ee.value,
|
|
1147
1149
|
"onUpdate:modelValue": y[3] || (y[3] = (h) => ee.value = h),
|
|
1148
|
-
class: Y([
|
|
1150
|
+
class: Y([o.disabled ? "text-fm-color-typo-disabled " : ""])
|
|
1149
1151
|
}, null, 8, ["label", "modelValue", "class"]),
|
|
1150
1152
|
e(s).isEnabled ? (F(), z(ie, {
|
|
1151
1153
|
key: 2,
|
|
1152
1154
|
modelValue: K.value,
|
|
1153
1155
|
"onUpdate:modelValue": y[4] || (y[4] = (h) => K.value = h),
|
|
1154
|
-
label: `NetSuite ${e(
|
|
1156
|
+
label: `NetSuite ${e(l)("inventory.transfer.form.netsuite.subsidiary")}`,
|
|
1155
1157
|
items: e(s).subsidiaryOptions,
|
|
1156
1158
|
"label-mark": "required",
|
|
1157
1159
|
rules: [e(Ie)()]
|
|
@@ -1168,10 +1170,10 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1168
1170
|
k(W, {
|
|
1169
1171
|
modelValue: e(j),
|
|
1170
1172
|
"onUpdate:modelValue": y[5] || (y[5] = (h) => ce(j) ? j.value = h : null),
|
|
1171
|
-
label: e(
|
|
1172
|
-
sublabel: e(
|
|
1173
|
+
label: e(l)("inventory.transfer.form.backdate.title"),
|
|
1174
|
+
sublabel: e(l)("inventory.transfer.form.backdate.subtitle"),
|
|
1173
1175
|
"label-placement": "right",
|
|
1174
|
-
disabled: x.value && !
|
|
1176
|
+
disabled: x.value && !o.lastClosingDate || o.disabled
|
|
1175
1177
|
}, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
|
|
1176
1178
|
r("div", {
|
|
1177
1179
|
class: Y({ hidden: g.value, "w-16": !g.value })
|
|
@@ -1195,15 +1197,15 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1195
1197
|
key: 0,
|
|
1196
1198
|
modelValue: e(J),
|
|
1197
1199
|
"onUpdate:modelValue": y[8] || (y[8] = (h) => ce(J) ? J.value = h : null),
|
|
1198
|
-
rules: [e(gt)(new Date(
|
|
1200
|
+
rules: [e(gt)(new Date(o.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
1199
1201
|
}, null, 8, ["modelValue", "rules"])) : H("", !0),
|
|
1200
|
-
x.value && !
|
|
1202
|
+
x.value && !o.lastClosingDate ? (F(), I("div", xs, [
|
|
1201
1203
|
k(ne, {
|
|
1202
1204
|
name: "error",
|
|
1203
1205
|
size: "sm",
|
|
1204
1206
|
class: "text-fm-color-typo-warning"
|
|
1205
1207
|
}),
|
|
1206
|
-
r("span", Fs, V(e(
|
|
1208
|
+
r("span", Fs, V(e(l)("inventory.transfer.form.backdate.error")), 1)
|
|
1207
1209
|
])) : H("", !0)
|
|
1208
1210
|
])) : H("", !0)
|
|
1209
1211
|
])
|
|
@@ -1222,11 +1224,11 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1222
1224
|
}
|
|
1223
1225
|
])
|
|
1224
1226
|
}, [
|
|
1225
|
-
r("div", Ts, V(e(
|
|
1227
|
+
r("div", Ts, V(e(l)("inventory.transfer.form.items.title")), 1),
|
|
1226
1228
|
r("div", Is, [
|
|
1227
1229
|
k(Ce, {
|
|
1228
|
-
disabled:
|
|
1229
|
-
label: e(
|
|
1230
|
+
disabled: o.disabled,
|
|
1231
|
+
label: e(l)("inventory.transfer.form.items.addItem"),
|
|
1230
1232
|
"prepend-icon": "add",
|
|
1231
1233
|
variant: "secondary",
|
|
1232
1234
|
"text-color": "primary",
|
|
@@ -1240,30 +1242,30 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1240
1242
|
"z-index": 50
|
|
1241
1243
|
}, {
|
|
1242
1244
|
content: O(() => [
|
|
1243
|
-
r("div", null, V(e(
|
|
1245
|
+
r("div", null, V(e(l)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
|
|
1244
1246
|
]),
|
|
1245
1247
|
default: O(() => [
|
|
1246
|
-
k(
|
|
1248
|
+
k(Ee, {
|
|
1247
1249
|
"onUpdate:poItems": y[10] || (y[10] = (h) => e(t).items = h),
|
|
1248
1250
|
disabled: ""
|
|
1249
1251
|
})
|
|
1250
1252
|
]),
|
|
1251
1253
|
_: 1
|
|
1252
|
-
})) : (F(), z(
|
|
1254
|
+
})) : (F(), z(Ee, {
|
|
1253
1255
|
key: 1,
|
|
1254
1256
|
"onUpdate:poItems": y[11] || (y[11] = (h) => e(t).items = h),
|
|
1255
|
-
disabled:
|
|
1257
|
+
disabled: o.disabled || !!e(t).template
|
|
1256
1258
|
}, null, 8, ["disabled"]))
|
|
1257
1259
|
])
|
|
1258
1260
|
], 2),
|
|
1259
|
-
U.value === e(A).PURCHASE && S.value && e(b).enableTotalCost && ((
|
|
1261
|
+
U.value === e(A).PURCHASE && S.value && e(b).enableTotalCost && ((Be = o.modelValue) != null && Be.items.length) ? (F(), I("div", $s, [
|
|
1260
1262
|
k(W, {
|
|
1261
|
-
label: e(te) ? e(
|
|
1263
|
+
label: e(te) ? e(l)("inventory.transfer.form.items.fetchingData") : e(l)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1262
1264
|
"prepend-icon": "compare_arrows",
|
|
1263
1265
|
"label-placement": "right",
|
|
1264
1266
|
"model-value": e(D),
|
|
1265
1267
|
"onUpdate:modelValue": y[12] || (y[12] = (h) => ce(D) ? D.value = h : null),
|
|
1266
|
-
disabled: e(te) ||
|
|
1268
|
+
disabled: e(te) || o.disabled
|
|
1267
1269
|
}, null, 8, ["label", "model-value", "disabled"])
|
|
1268
1270
|
])) : H("", !0),
|
|
1269
1271
|
(F(), z(ye, {
|
|
@@ -1316,16 +1318,16 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1316
1318
|
lastClosingDate: {}
|
|
1317
1319
|
},
|
|
1318
1320
|
emits: ["update:show", "submitted"],
|
|
1319
|
-
setup(
|
|
1321
|
+
setup(n, { expose: v, emit: u }) {
|
|
1320
1322
|
var j;
|
|
1321
|
-
const i =
|
|
1323
|
+
const i = n, d = u, t = Ne(), l = Ae(), w = xe(), m = Re(), s = De(), { t: a } = me(), b = N(!1), c = N(!1), p = N(!1);
|
|
1322
1324
|
async function g(_) {
|
|
1323
1325
|
if (_) {
|
|
1324
1326
|
c.value = !1;
|
|
1325
1327
|
try {
|
|
1326
1328
|
await w.readSuppliers(), c.value = !0;
|
|
1327
1329
|
} catch {
|
|
1328
|
-
|
|
1330
|
+
l.open({
|
|
1329
1331
|
title: a("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
|
|
1330
1332
|
message: a("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
|
|
1331
1333
|
type: "error"
|
|
@@ -1368,7 +1370,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1368
1370
|
};
|
|
1369
1371
|
}
|
|
1370
1372
|
const S = ot(i, "show"), x = N(i.modelValue ?? f()), E = N(((j = i.modelValue) == null ? void 0 : j._id) ?? `${Math.random()}`);
|
|
1371
|
-
|
|
1373
|
+
$e(
|
|
1372
1374
|
() => i.show,
|
|
1373
1375
|
(_) => {
|
|
1374
1376
|
var C;
|
|
@@ -1404,13 +1406,13 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1404
1406
|
const _ = x.value;
|
|
1405
1407
|
b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...D }) => D));
|
|
1406
1408
|
try {
|
|
1407
|
-
await t.createPurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)),
|
|
1409
|
+
await t.createPurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)), l.open({
|
|
1408
1410
|
title: a("inventory.transfer.receiveRequest.create.success"),
|
|
1409
1411
|
message: a("inventory.transfer.receiveRequest.create.successMessage"),
|
|
1410
1412
|
type: "success"
|
|
1411
1413
|
}), d("update:show", !1), d("submitted");
|
|
1412
1414
|
} catch (C) {
|
|
1413
|
-
|
|
1415
|
+
l.open({
|
|
1414
1416
|
title: a("inventory.transfer.receiveRequest.create.error.title"),
|
|
1415
1417
|
message: a("inventory.transfer.receiveRequest.create.error.message"),
|
|
1416
1418
|
type: "error"
|
|
@@ -1423,13 +1425,13 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1423
1425
|
const _ = x.value;
|
|
1424
1426
|
b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...D }) => D));
|
|
1425
1427
|
try {
|
|
1426
|
-
await t.updatePurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)),
|
|
1428
|
+
await t.updatePurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)), l.open({
|
|
1427
1429
|
title: a("inventory.transfer.receiveRequest.update.success"),
|
|
1428
1430
|
message: a("inventory.transfer.receiveRequest.update.successMessage"),
|
|
1429
1431
|
type: "success"
|
|
1430
1432
|
}), d("update:show", !1), d("submitted");
|
|
1431
1433
|
} catch (C) {
|
|
1432
|
-
|
|
1434
|
+
l.open({
|
|
1433
1435
|
title: a("inventory.transfer.receiveRequest.update.error.title"),
|
|
1434
1436
|
message: a("inventory.transfer.receiveRequest.update.error.message"),
|
|
1435
1437
|
type: "error"
|