@tesouro/embedded-components-react 0.5.17 → 0.5.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/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +8 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +34 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +85 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +186 -179
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js
CHANGED
|
@@ -15,29 +15,23 @@ import { useMutation as s } from "@tanstack/react-query";
|
|
|
15
15
|
function c() {
|
|
16
16
|
let { client: c, organizationId: l } = t();
|
|
17
17
|
return s({
|
|
18
|
-
mutationFn: async ({ path:
|
|
19
|
-
let { data:
|
|
18
|
+
mutationFn: async ({ path: e, body: t, makeDefault: a }) => {
|
|
19
|
+
let { data: o } = await r({
|
|
20
20
|
client: c,
|
|
21
21
|
headers: n(l),
|
|
22
|
-
path:
|
|
23
|
-
body:
|
|
22
|
+
path: e,
|
|
23
|
+
body: t,
|
|
24
24
|
throwOnError: !0
|
|
25
25
|
});
|
|
26
|
-
if (
|
|
26
|
+
if (a) try {
|
|
27
27
|
await i({
|
|
28
28
|
client: c,
|
|
29
29
|
headers: n(l),
|
|
30
|
-
path:
|
|
30
|
+
path: e,
|
|
31
31
|
throwOnError: !0
|
|
32
32
|
});
|
|
33
|
-
} catch
|
|
34
|
-
|
|
35
|
-
client: c,
|
|
36
|
-
organizationId: l,
|
|
37
|
-
counterpartId: t.counterpart_id
|
|
38
|
-
})), n;
|
|
39
|
-
}
|
|
40
|
-
return u;
|
|
33
|
+
} catch {}
|
|
34
|
+
return o;
|
|
41
35
|
},
|
|
42
36
|
onSuccess: async (t, n) => {
|
|
43
37
|
await Promise.all([e(o({
|
|
@@ -21,6 +21,7 @@ function p({ ref: p, payable: m, onMissingAchInstructions: h, poweredByBankName:
|
|
|
21
21
|
let v = t(m), { initResponse: y } = e(), b = i(y?.scopes), { achInstructions: x, isLoading: S, isError: C } = c({
|
|
22
22
|
counterpartId: m.counterpart_id,
|
|
23
23
|
currency: m.currency,
|
|
24
|
+
currentBankAccountId: m.counterpart_bank_account_id,
|
|
24
25
|
enabled: b
|
|
25
26
|
}), w = s({
|
|
26
27
|
payableId: m.id,
|
|
@@ -4,49 +4,49 @@ import { resolveVendor as n, resolveVendorName as r } from "./index8.js";
|
|
|
4
4
|
import { formatBillMoney as i } from "./index2.js";
|
|
5
5
|
import { resolveLineItemAmountMinorUnits as a } from "./index40.js";
|
|
6
6
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js
|
|
7
|
-
function o({ payable: o, lineItems: c, ledgerAccounts: l, labels: u, hasScheduledPayment: d, now: f, rejection: p }) {
|
|
8
|
-
let
|
|
7
|
+
function o({ payable: o, lineItems: c, ledgerAccounts: l, labels: u, hasScheduledPayment: d, now: f, rejection: p, achInstructions: m, achInstructionsReadable: h = !1 }) {
|
|
8
|
+
let g = o.currency, _ = (e) => i(e, g), v = t({
|
|
9
9
|
apiStatus: o.status,
|
|
10
10
|
dueDate: o.due_date,
|
|
11
11
|
scheduledPaymentDate: o.scheduled_payment_date,
|
|
12
12
|
hasScheduledPayment: d,
|
|
13
13
|
now: f
|
|
14
|
-
}),
|
|
14
|
+
}), y = n(o), b = r(o), x = e(o.issued_at) || u.notProvided, S = e(o.due_date) || u.notProvided, C = [{
|
|
15
15
|
label: u.vendorRow,
|
|
16
|
-
value:
|
|
17
|
-
secondaryValue:
|
|
18
|
-
}],
|
|
19
|
-
|
|
16
|
+
value: b || u.notProvided,
|
|
17
|
+
secondaryValue: y?.email ?? void 0
|
|
18
|
+
}], w = h ? m?.account_number : void 0;
|
|
19
|
+
w && C.push({
|
|
20
20
|
label: u.bankAccountRow,
|
|
21
|
-
value: u.bankAccountValue(
|
|
21
|
+
value: u.bankAccountValue(w.slice(-4))
|
|
22
22
|
});
|
|
23
|
-
let
|
|
23
|
+
let T = [
|
|
24
24
|
{
|
|
25
25
|
label: u.invoiceNumberRow,
|
|
26
26
|
value: o.document_id || u.notProvided
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
label: u.issueDateRow,
|
|
30
|
-
value:
|
|
30
|
+
value: x
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
label: u.dueDateRow,
|
|
34
|
-
value:
|
|
34
|
+
value: S
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
label: u.poNumberRow,
|
|
38
38
|
value: u.notProvided
|
|
39
39
|
}
|
|
40
|
-
],
|
|
41
|
-
let t =
|
|
40
|
+
], E = new Map(l.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), D = c.map((e) => {
|
|
41
|
+
let t = _(e.unit_price);
|
|
42
42
|
return {
|
|
43
43
|
id: e.id,
|
|
44
44
|
description: e.name ?? e.description ?? "",
|
|
45
|
-
glCodeLabel: (e.ledger_account_id ?
|
|
45
|
+
glCodeLabel: (e.ledger_account_id ? E.get(e.ledger_account_id) : void 0) || u.glCodeMissing,
|
|
46
46
|
quantityLabel: e.quantity != null && t ? u.quantityValue(String(e.quantity), t) : "",
|
|
47
|
-
amountLabel:
|
|
47
|
+
amountLabel: _(a(e)) ?? ""
|
|
48
48
|
};
|
|
49
|
-
}),
|
|
49
|
+
}), O = [
|
|
50
50
|
{
|
|
51
51
|
label: u.subtotalRow,
|
|
52
52
|
value: o.subtotal
|
|
@@ -61,29 +61,29 @@ function o({ payable: o, lineItems: c, ledgerAccounts: l, labels: u, hasSchedule
|
|
|
61
61
|
}
|
|
62
62
|
].map(({ label: e, value: t }) => ({
|
|
63
63
|
label: e,
|
|
64
|
-
value:
|
|
65
|
-
})).filter((e) => !!e.value),
|
|
66
|
-
|
|
64
|
+
value: _(t)
|
|
65
|
+
})).filter((e) => !!e.value), k = _(o.total_amount);
|
|
66
|
+
k && O.push({
|
|
67
67
|
label: u.totalRow,
|
|
68
|
-
value:
|
|
68
|
+
value: k,
|
|
69
69
|
emphasis: !0
|
|
70
70
|
});
|
|
71
|
-
let
|
|
71
|
+
let A = s(o);
|
|
72
72
|
return {
|
|
73
|
-
title:
|
|
73
|
+
title: b,
|
|
74
74
|
subtitle: u.subtitle,
|
|
75
|
-
status:
|
|
76
|
-
statusTone:
|
|
77
|
-
amountDueLabel:
|
|
78
|
-
amountPaidLabel:
|
|
79
|
-
paidOnLabel:
|
|
80
|
-
invoiceDateLabel:
|
|
81
|
-
dueDateLabel:
|
|
82
|
-
dueDateTone:
|
|
83
|
-
payToItems:
|
|
84
|
-
invoiceItems:
|
|
85
|
-
lineItems:
|
|
86
|
-
totals:
|
|
75
|
+
status: v.status,
|
|
76
|
+
statusTone: v.tone,
|
|
77
|
+
amountDueLabel: _(o.amount_due) ?? _(o.total_amount) ?? "",
|
|
78
|
+
amountPaidLabel: A ? _(o.amount_paid) : void 0,
|
|
79
|
+
paidOnLabel: A ? u.paidOnLabel(A) : void 0,
|
|
80
|
+
invoiceDateLabel: x,
|
|
81
|
+
dueDateLabel: S,
|
|
82
|
+
dueDateTone: v.isOverdue ? "danger" : "default",
|
|
83
|
+
payToItems: C,
|
|
84
|
+
invoiceItems: T,
|
|
85
|
+
lineItems: D,
|
|
86
|
+
totals: O,
|
|
87
87
|
rejection: p
|
|
88
88
|
};
|
|
89
89
|
}
|
|
@@ -13,7 +13,7 @@ function c({ payable: c, lineItems: l, glCodeOptions: u, glCodeRosterAvailable:
|
|
|
13
13
|
dueDate: c.due_date,
|
|
14
14
|
scheduledPaymentDate: c.scheduled_payment_date,
|
|
15
15
|
hasScheduledPayment: g
|
|
16
|
-
}), S = n(c), C = y ? v :
|
|
16
|
+
}), S = n(c), C = y ? v : void 0, w = C?.account_number, T = !!(C?.account_holder_name && C.routing_number && C.account_number), E = e(c.issued_at) || h.notProvided, D = e(c.due_date) || h.notProvided, O = new Map(u.map((e) => [e.value, e.label])), k = [
|
|
17
17
|
{
|
|
18
18
|
label: h.subtotalRow,
|
|
19
19
|
minorUnits: c.subtotal
|
|
@@ -4,121 +4,126 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import "../../../shared/ui/dist/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { extractApiErrorMessage as t } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
8
|
+
import { useUpdatePayableMutation as n } from "../../data-access/dist/index13.js";
|
|
9
|
+
import { useCounterpartBankAccountsQuery as r, useCreateCounterpartBankAccountMutation as i } from "../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
10
|
+
import { useUpdatePayableCounterpartBankAccountMutation as a } from "../../data-access/dist/index14.js";
|
|
10
11
|
import "../../data-access/dist/index.js";
|
|
11
|
-
import { counterpartFormBankAccountToCreatePayload as
|
|
12
|
+
import { counterpartFormBankAccountToCreatePayload as o, counterpartFormBankAccountToUpdatePayload as s, getAchInstructions as c, isAchCompatibleBankAccount as l, resolveCounterpartBankAccountWrite as u, validateAchFormValues as d } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
12
13
|
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
13
|
-
import { useCallback as
|
|
14
|
+
import { useCallback as f, useEffect as p, useRef as m, useState as h } from "react";
|
|
14
15
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js
|
|
15
|
-
|
|
16
|
+
function g(e, n) {
|
|
17
|
+
let r = t(n);
|
|
18
|
+
return r ? `${e} ${r}` : e;
|
|
19
|
+
}
|
|
20
|
+
var _ = {
|
|
16
21
|
accountHolderName: "",
|
|
17
22
|
routingNumber: "",
|
|
18
23
|
accountNumber: ""
|
|
19
24
|
};
|
|
20
|
-
function
|
|
21
|
-
return e?.find((e) => e.id === t &&
|
|
25
|
+
function v(e, t) {
|
|
26
|
+
return e?.find((e) => e.id === t && l(e)) ?? c(e);
|
|
22
27
|
}
|
|
23
|
-
function
|
|
24
|
-
let [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
let
|
|
29
|
-
if (
|
|
30
|
-
let e =
|
|
31
|
-
|
|
28
|
+
function y({ payableId: t, counterpartId: l, currentBankAccountId: y, canReadCounterpartBankAccounts: b = !0, saveErrorMessage: x, linkErrorMessage: S }) {
|
|
29
|
+
let [C, w] = h(!1), [T, E] = h(_), [D, O] = h(), k = r(l, { enabled: b }), A = k.data?.data, j = i(), M = a(), N = n(), P = m(void 0), F = m(!1);
|
|
30
|
+
p(() => {
|
|
31
|
+
P.current = void 0;
|
|
32
|
+
}, [l, t]);
|
|
33
|
+
let I = f(() => {
|
|
34
|
+
if (C) return;
|
|
35
|
+
let e = k.isFetching ? void 0 : v(A, y);
|
|
36
|
+
E(e ? {
|
|
32
37
|
accountHolderName: e.account_holder_name ?? "",
|
|
33
38
|
routingNumber: e.routing_number ?? "",
|
|
34
39
|
accountNumber: e.account_number ?? ""
|
|
35
|
-
} :
|
|
40
|
+
} : _), P.current = e?.id ?? P.current, F.current = !k.isFetching, O(void 0), w(!0);
|
|
36
41
|
}, [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
A,
|
|
43
|
+
k.isFetching,
|
|
44
|
+
y,
|
|
45
|
+
C
|
|
41
46
|
]);
|
|
42
|
-
|
|
43
|
-
if (!
|
|
44
|
-
|
|
45
|
-
let e =
|
|
46
|
-
e && (
|
|
47
|
+
p(() => {
|
|
48
|
+
if (!C || F.current || k.isFetching) return;
|
|
49
|
+
F.current = !0;
|
|
50
|
+
let e = v(A, y);
|
|
51
|
+
e && (E((t) => t.accountHolderName === "" && t.routingNumber === "" && t.accountNumber === "" ? {
|
|
47
52
|
accountHolderName: e.account_holder_name ?? "",
|
|
48
53
|
routingNumber: e.routing_number ?? "",
|
|
49
54
|
accountNumber: e.account_number ?? ""
|
|
50
|
-
} : t),
|
|
55
|
+
} : t), P.current = e.id);
|
|
51
56
|
}, [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
C,
|
|
58
|
+
k.isFetching,
|
|
59
|
+
A,
|
|
60
|
+
y,
|
|
61
|
+
b
|
|
57
62
|
]);
|
|
58
|
-
let
|
|
59
|
-
|
|
60
|
-
}, []),
|
|
61
|
-
|
|
63
|
+
let L = f(() => {
|
|
64
|
+
w(!1);
|
|
65
|
+
}, []), R = f((e) => {
|
|
66
|
+
E((t) => ({
|
|
62
67
|
...t,
|
|
63
68
|
...e
|
|
64
69
|
}));
|
|
65
|
-
}, []),
|
|
66
|
-
if (!
|
|
67
|
-
let
|
|
68
|
-
if (Object.keys(
|
|
69
|
-
if (
|
|
70
|
-
let
|
|
70
|
+
}, []), z = f(async () => {
|
|
71
|
+
if (!t || !l) return !1;
|
|
72
|
+
let n = d(T);
|
|
73
|
+
if (Object.keys(n).length > 0) return O(n), !1;
|
|
74
|
+
if (O(void 0), !b || k.isFetching || k.isError) return e.error(x), !1;
|
|
75
|
+
let r = P.current;
|
|
71
76
|
try {
|
|
72
|
-
let e =
|
|
73
|
-
e.kind === "update" ? (await
|
|
77
|
+
let e = u(A, r ?? c(A)?.id);
|
|
78
|
+
e.kind === "update" ? (await M.mutateAsync({
|
|
74
79
|
path: {
|
|
75
|
-
counterpart_id:
|
|
80
|
+
counterpart_id: l,
|
|
76
81
|
bank_account_id: e.bankAccountId
|
|
77
82
|
},
|
|
78
|
-
body:
|
|
79
|
-
payableId:
|
|
80
|
-
makeDefault: e.includeAchDefaults || !
|
|
81
|
-
}),
|
|
82
|
-
path: { counterpart_id:
|
|
83
|
-
body:
|
|
84
|
-
}))?.id,
|
|
85
|
-
} catch {
|
|
86
|
-
return e.error(
|
|
83
|
+
body: s(T, { includeAchDefaults: e.includeAchDefaults }),
|
|
84
|
+
payableId: t,
|
|
85
|
+
makeDefault: e.includeAchDefaults || !A?.find((t) => t.id === e.bankAccountId)?.is_default_for_currency
|
|
86
|
+
}), r = e.bankAccountId) : r = (await j.mutateAsync({
|
|
87
|
+
path: { counterpart_id: l },
|
|
88
|
+
body: o(T, { isDefaultForCurrency: e.isDefaultForCurrency })
|
|
89
|
+
}))?.id, P.current = r;
|
|
90
|
+
} catch (t) {
|
|
91
|
+
return e.error(g(x, t)), !1;
|
|
87
92
|
}
|
|
88
|
-
if (
|
|
89
|
-
await
|
|
90
|
-
path: { payable_id:
|
|
91
|
-
body: { counterpart_bank_account_id:
|
|
93
|
+
if (r !== y) try {
|
|
94
|
+
await N.mutateAsync({
|
|
95
|
+
path: { payable_id: t },
|
|
96
|
+
body: { counterpart_bank_account_id: r }
|
|
92
97
|
});
|
|
93
|
-
} catch {
|
|
94
|
-
return e.error(
|
|
98
|
+
} catch (t) {
|
|
99
|
+
return e.error(g(S, t)), !1;
|
|
95
100
|
}
|
|
96
|
-
return
|
|
101
|
+
return w(!1), !0;
|
|
97
102
|
}, [
|
|
98
|
-
k,
|
|
99
|
-
O.isError,
|
|
100
|
-
O.isFetching,
|
|
101
|
-
y,
|
|
102
|
-
_,
|
|
103
103
|
A,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
c,
|
|
104
|
+
k.isError,
|
|
105
|
+
k.isFetching,
|
|
107
106
|
b,
|
|
107
|
+
l,
|
|
108
108
|
j,
|
|
109
|
+
y,
|
|
110
|
+
S,
|
|
111
|
+
t,
|
|
112
|
+
x,
|
|
109
113
|
M,
|
|
110
|
-
|
|
114
|
+
N,
|
|
115
|
+
T
|
|
111
116
|
]);
|
|
112
117
|
return {
|
|
113
|
-
isOpen:
|
|
114
|
-
values:
|
|
115
|
-
errors:
|
|
116
|
-
isSaving:
|
|
117
|
-
open:
|
|
118
|
-
close:
|
|
119
|
-
onChange:
|
|
120
|
-
save:
|
|
118
|
+
isOpen: C,
|
|
119
|
+
values: T,
|
|
120
|
+
errors: D,
|
|
121
|
+
isSaving: j.isPending || M.isPending || N.isPending,
|
|
122
|
+
open: I,
|
|
123
|
+
close: L,
|
|
124
|
+
onChange: R,
|
|
125
|
+
save: z
|
|
121
126
|
};
|
|
122
127
|
}
|
|
123
128
|
//#endregion
|
|
124
|
-
export {
|
|
129
|
+
export { y as usePaymentInstructionsForm };
|
|
@@ -10,219 +10,226 @@ import "../../../shared/data-access/dist/index.js";
|
|
|
10
10
|
import { useWidgetConfig as ne } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
11
|
import "../../../shared/feature/dist/index.js";
|
|
12
12
|
import { usePayableApprovalRequestsQuery as re } from "../../data-access/dist/index8.js";
|
|
13
|
-
import { usePayableHistoryQuery as
|
|
14
|
-
import { useAllPayableLineItemsQuery as
|
|
15
|
-
import { usePayableQuery as
|
|
13
|
+
import { usePayableHistoryQuery as ie } from "../../data-access/dist/index9.js";
|
|
14
|
+
import { useAllPayableLineItemsQuery as ae } from "../../data-access/dist/index10.js";
|
|
15
|
+
import { usePayableQuery as n } from "../../data-access/dist/index17.js";
|
|
16
16
|
import "../../data-access/dist/index.js";
|
|
17
|
-
import { BillDecisionDialog as
|
|
18
|
-
import { BillDetailsSheet as
|
|
19
|
-
import { BillDuplicateNotice as
|
|
20
|
-
import { MarkAsPaidDialog as
|
|
17
|
+
import { BillDecisionDialog as r } from "../../ui/dist/index56.js";
|
|
18
|
+
import { BillDetailsSheet as i } from "../../ui/dist/index65.js";
|
|
19
|
+
import { BillDuplicateNotice as a } from "../../ui/dist/index69.js";
|
|
20
|
+
import { MarkAsPaidDialog as o } from "../../ui/dist/index99.js";
|
|
21
21
|
import "../../ui/dist/index.js";
|
|
22
|
-
import { usePayableDuplicateReview as
|
|
22
|
+
import { usePayableDuplicateReview as s } from "./index13.js";
|
|
23
23
|
import "./index14.js";
|
|
24
|
-
import { canOverrideApprovalPolicy as
|
|
25
|
-
import { resolveAmountDueMinorUnits as
|
|
26
|
-
import { usePayableAchInstructions as
|
|
24
|
+
import { canOverrideApprovalPolicy as c, canReadCounterpartBankAccounts as l } from "./index20.js";
|
|
25
|
+
import { resolveAmountDueMinorUnits as u } from "./index21.js";
|
|
26
|
+
import { usePayableAchInstructions as d } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
|
|
27
27
|
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
28
|
-
import { PayBillFlow as
|
|
28
|
+
import { PayBillFlow as f } from "./index27.js";
|
|
29
29
|
import "./index28.js";
|
|
30
|
-
import { mapPayableToBillDetails as
|
|
31
|
-
import { mergeMarkAsPaidFlowLabels as
|
|
32
|
-
import { useMarkAsPaidFlow as
|
|
30
|
+
import { mapPayableToBillDetails as p } from "./index41.js";
|
|
31
|
+
import { mergeMarkAsPaidFlowLabels as m } from "./index15.js";
|
|
32
|
+
import { useMarkAsPaidFlow as oe } from "./index17.js";
|
|
33
33
|
import "./index18.js";
|
|
34
|
-
import { mergeDecisionDialogCopy as
|
|
35
|
-
import { buildPaymentHistory as
|
|
36
|
-
import { currentApprovalRound as
|
|
37
|
-
import { usePayableApprovalRoundStart as
|
|
38
|
-
import { useApprovalPolicyCardView as
|
|
39
|
-
import { resolveBillRejectionNotice as
|
|
40
|
-
import { useCurrentApprovalRequestId as
|
|
41
|
-
import { usePayableDetailActions as
|
|
42
|
-
import { useScheduledPayment as
|
|
43
|
-
import { BILL_DETAILS_LABELS_EN as
|
|
44
|
-
import { useMemo as
|
|
45
|
-
import { Fragment as
|
|
34
|
+
import { mergeDecisionDialogCopy as se, mergePaymentHistoryMethodLabels as ce } from "./index45.js";
|
|
35
|
+
import { buildPaymentHistory as le } from "./index3.js";
|
|
36
|
+
import { currentApprovalRound as ue } from "./index4.js";
|
|
37
|
+
import { usePayableApprovalRoundStart as de } from "./index32.js";
|
|
38
|
+
import { useApprovalPolicyCardView as fe } from "./index33.js";
|
|
39
|
+
import { resolveBillRejectionNotice as pe } from "./index34.js";
|
|
40
|
+
import { useCurrentApprovalRequestId as me } from "./index35.js";
|
|
41
|
+
import { usePayableDetailActions as he } from "./index36.js";
|
|
42
|
+
import { useScheduledPayment as ge } from "./index37.js";
|
|
43
|
+
import { BILL_DETAILS_LABELS_EN as h } from "./index62.js";
|
|
44
|
+
import { useMemo as g, useRef as _e } from "react";
|
|
45
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
46
46
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js
|
|
47
|
-
function
|
|
48
|
-
let
|
|
49
|
-
...
|
|
50
|
-
...
|
|
47
|
+
function b({ open: b, onOpenChange: x, payableId: S, onClose: C, onExpand: w, onEdit: T, testId: E, labels: D, poweredByBankName: O }) {
|
|
48
|
+
let k = g(() => ({
|
|
49
|
+
...h,
|
|
50
|
+
...D,
|
|
51
51
|
sheet: {
|
|
52
|
-
...
|
|
53
|
-
...
|
|
52
|
+
...h.sheet,
|
|
53
|
+
...D?.sheet,
|
|
54
54
|
statusBadge: {
|
|
55
|
-
...
|
|
56
|
-
...
|
|
55
|
+
...h.sheet.statusBadge,
|
|
56
|
+
...D?.sheet?.statusBadge
|
|
57
57
|
},
|
|
58
58
|
approvalPolicy: {
|
|
59
|
-
...
|
|
60
|
-
...
|
|
59
|
+
...h.sheet.approvalPolicy,
|
|
60
|
+
...D?.sheet?.approvalPolicy
|
|
61
61
|
},
|
|
62
62
|
dueDate: {
|
|
63
|
-
...
|
|
64
|
-
...
|
|
63
|
+
...h.sheet.dueDate,
|
|
64
|
+
...D?.sheet?.dueDate
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
decisionDialog:
|
|
67
|
+
decisionDialog: se(h.decisionDialog, D?.decisionDialog),
|
|
68
68
|
approvalPolicyCopy: {
|
|
69
|
-
...
|
|
70
|
-
...
|
|
69
|
+
...h.approvalPolicyCopy,
|
|
70
|
+
...D?.approvalPolicyCopy
|
|
71
71
|
},
|
|
72
|
-
markAsPaid:
|
|
72
|
+
markAsPaid: m(D?.markAsPaid),
|
|
73
73
|
actionSuccess: {
|
|
74
|
-
...
|
|
75
|
-
...
|
|
74
|
+
...h.actionSuccess,
|
|
75
|
+
...D?.actionSuccess
|
|
76
76
|
},
|
|
77
|
-
paymentHistoryMethodLabels:
|
|
78
|
-
}), [
|
|
79
|
-
payableId:
|
|
80
|
-
status:
|
|
81
|
-
}),
|
|
82
|
-
payableId:
|
|
83
|
-
enabled:
|
|
84
|
-
}),
|
|
85
|
-
payableStatus:
|
|
86
|
-
approvalRequests:
|
|
87
|
-
users:
|
|
88
|
-
payableUpdatedAt:
|
|
89
|
-
labels:
|
|
77
|
+
paymentHistoryMethodLabels: ce(D?.paymentHistoryMethodLabels)
|
|
78
|
+
}), [D]), A = n(S), j = ae(S), M = ee(), { initResponse: N } = ne(), P = A.data, F = _e(null), I = me({
|
|
79
|
+
payableId: S,
|
|
80
|
+
status: P?.status
|
|
81
|
+
}), L = P?.status === "rejected", ve = e(N?.scopes, [t.ApprovalRequestReadOrg]), R = L && ve, z = de({
|
|
82
|
+
payableId: S,
|
|
83
|
+
enabled: R
|
|
84
|
+
}), B = re(S, { enabled: R }), ye = e(N?.scopes, [t.UserReadOrg]), V = te({ enabled: L && ye }), H = g(() => ue(B.data?.data, z.roundStartedAt), [B.data, z.roundStartedAt]), U = g(() => pe({
|
|
85
|
+
payableStatus: P?.status,
|
|
86
|
+
approvalRequests: H,
|
|
87
|
+
users: V.data?.data ?? [],
|
|
88
|
+
payableUpdatedAt: P?.updated_at,
|
|
89
|
+
labels: k
|
|
90
90
|
}), [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
]),
|
|
97
|
-
payableId:
|
|
98
|
-
approvalPolicyId:
|
|
99
|
-
copy:
|
|
100
|
-
}),
|
|
101
|
-
status:
|
|
102
|
-
scopes:
|
|
103
|
-
arePendingApproversUnknown:
|
|
104
|
-
hasApprovalPolicy: !!
|
|
105
|
-
hasWaitingRequest:
|
|
106
|
-
}),
|
|
107
|
-
payableId:
|
|
108
|
-
scheduledPaymentDate:
|
|
109
|
-
}),
|
|
110
|
-
counterpartId:
|
|
111
|
-
currency:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
91
|
+
P?.status,
|
|
92
|
+
P?.updated_at,
|
|
93
|
+
H,
|
|
94
|
+
V.data,
|
|
95
|
+
k
|
|
96
|
+
]), W = fe({
|
|
97
|
+
payableId: S,
|
|
98
|
+
approvalPolicyId: P?.approval_policy_id,
|
|
99
|
+
copy: k.approvalPolicyCopy
|
|
100
|
+
}), be = c({
|
|
101
|
+
status: P?.status,
|
|
102
|
+
scopes: N?.scopes,
|
|
103
|
+
arePendingApproversUnknown: W.isLoading,
|
|
104
|
+
hasApprovalPolicy: !!P?.approval_policy_id,
|
|
105
|
+
hasWaitingRequest: I.hasWaitingRequest
|
|
106
|
+
}), G = ge({
|
|
107
|
+
payableId: S,
|
|
108
|
+
scheduledPaymentDate: P?.scheduled_payment_date
|
|
109
|
+
}), K = l(N?.scopes), q = d({
|
|
110
|
+
counterpartId: P?.counterpart_id,
|
|
111
|
+
currency: P?.currency,
|
|
112
|
+
currentBankAccountId: P?.counterpart_bank_account_id,
|
|
113
|
+
enabled: K
|
|
114
|
+
}), J = oe({
|
|
115
|
+
payableId: S,
|
|
116
|
+
amountDueMinorUnits: u(P) ?? 0,
|
|
117
|
+
amountToPayMinorUnits: P?.amount_to_pay ?? void 0,
|
|
118
|
+
currencyCode: P?.currency ?? void 0,
|
|
119
|
+
dueDate: P?.due_date,
|
|
120
|
+
hasScheduledPayment: G.hasScheduledPayment,
|
|
121
|
+
testId: E,
|
|
122
|
+
labels: k.markAsPaid
|
|
123
|
+
}), { actions: xe, decisionDialog: Se } = he({
|
|
124
|
+
payableId: P ? S : void 0,
|
|
125
|
+
status: P?.status,
|
|
126
|
+
currentApprovalRequestId: I.id,
|
|
127
|
+
hasScheduledPayment: G.hasScheduledPayment,
|
|
128
|
+
scheduledPaymentIntentId: G.scheduledPaymentIntentId,
|
|
129
|
+
isScheduledPaymentUnknown: G.isResolving,
|
|
130
|
+
isPayabilityUnknown: q.isLoading,
|
|
131
|
+
hasApprovalPolicy: !!P?.approval_policy_id,
|
|
132
|
+
hasWaitingRequest: I.hasWaitingRequest,
|
|
133
|
+
pendingApprovers: W.pendingApprovers,
|
|
134
|
+
arePendingApproversUnknown: W.isLoading,
|
|
134
135
|
labels: {
|
|
135
|
-
edit:
|
|
136
|
-
payBill:
|
|
137
|
-
markAsPaid:
|
|
138
|
-
reject:
|
|
139
|
-
approve:
|
|
140
|
-
cancel:
|
|
141
|
-
cancelScheduledPayment:
|
|
142
|
-
reopen:
|
|
143
|
-
forceApprove:
|
|
144
|
-
forceReject:
|
|
145
|
-
policyOverridesHeading:
|
|
146
|
-
decisionDialog:
|
|
147
|
-
actionError:
|
|
148
|
-
actionSuccess:
|
|
136
|
+
edit: k.sheet.editButton,
|
|
137
|
+
payBill: k.sheet.payButton,
|
|
138
|
+
markAsPaid: k.sheet.markAsPaidButton,
|
|
139
|
+
reject: k.sheet.rejectButton,
|
|
140
|
+
approve: k.sheet.approveButton,
|
|
141
|
+
cancel: k.sheet.cancelButton,
|
|
142
|
+
cancelScheduledPayment: k.sheet.cancelScheduledPaymentButton,
|
|
143
|
+
reopen: k.sheet.reopenButton,
|
|
144
|
+
forceApprove: k.sheet.forceApproveButton,
|
|
145
|
+
forceReject: k.sheet.forceRejectButton,
|
|
146
|
+
policyOverridesHeading: k.sheet.policyOverridesGroup,
|
|
147
|
+
decisionDialog: k.decisionDialog,
|
|
148
|
+
actionError: k.actionError,
|
|
149
|
+
actionSuccess: k.actionSuccess
|
|
149
150
|
},
|
|
150
151
|
isMarkAsPaidPending: J.isPending,
|
|
151
152
|
onMarkAsPaidSelect: J.open,
|
|
152
|
-
onPayBillSelect: () =>
|
|
153
|
-
onEditSelect:
|
|
153
|
+
onPayBillSelect: () => F.current?.open(),
|
|
154
|
+
onEditSelect: T,
|
|
154
155
|
onActionSucceeded: (e) => {
|
|
155
|
-
e === "reopen" &&
|
|
156
|
+
e === "reopen" && T?.();
|
|
156
157
|
}
|
|
157
|
-
}), Y =
|
|
158
|
+
}), Y = G.hasScheduledPayment && G.scheduledDateLabel ? /* @__PURE__ */ v("p", {
|
|
158
159
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
159
|
-
children:
|
|
160
|
-
}) : void 0, X =
|
|
161
|
-
payable:
|
|
162
|
-
canManage: e(
|
|
163
|
-
}), Z = X.isPossibleDuplicate ? /* @__PURE__ */
|
|
160
|
+
children: k.scheduledSummary(G.scheduledDateLabel)
|
|
161
|
+
}) : void 0, X = s({
|
|
162
|
+
payable: P,
|
|
163
|
+
canManage: e(N?.scopes, [t.PayableWriteOrg])
|
|
164
|
+
}), Z = X.isPossibleDuplicate ? /* @__PURE__ */ v(a, {
|
|
164
165
|
onNotADuplicate: X.onNotADuplicate,
|
|
165
166
|
isActionDisabled: X.isBusy
|
|
166
|
-
}) : void 0,
|
|
167
|
-
records:
|
|
168
|
-
events:
|
|
169
|
-
currencyCode:
|
|
170
|
-
labels:
|
|
167
|
+
}) : void 0, Ce = Z || Y ? /* @__PURE__ */ y(_, { children: [Z, Y] }) : void 0, Q = ie(S), $ = g(() => le({
|
|
168
|
+
records: G.paymentRecords,
|
|
169
|
+
events: Q.data?.data ?? [],
|
|
170
|
+
currencyCode: P?.currency,
|
|
171
|
+
labels: k
|
|
171
172
|
}), [
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
]),
|
|
177
|
-
payable:
|
|
178
|
-
lineItems:
|
|
179
|
-
ledgerAccounts:
|
|
180
|
-
labels:
|
|
181
|
-
hasScheduledPayment:
|
|
182
|
-
rejection:
|
|
173
|
+
G.paymentRecords,
|
|
174
|
+
Q.data,
|
|
175
|
+
P?.currency,
|
|
176
|
+
k
|
|
177
|
+
]), we = g(() => P ? p({
|
|
178
|
+
payable: P,
|
|
179
|
+
lineItems: j.lineItems,
|
|
180
|
+
ledgerAccounts: M.data?.data ?? [],
|
|
181
|
+
labels: k,
|
|
182
|
+
hasScheduledPayment: G.hasScheduledPayment,
|
|
183
|
+
rejection: U,
|
|
184
|
+
achInstructions: q.achInstructions,
|
|
185
|
+
achInstructionsReadable: K && !q.isLoading && !q.isError
|
|
183
186
|
}) : void 0, [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
187
|
+
P,
|
|
188
|
+
j.lineItems,
|
|
189
|
+
M.data,
|
|
190
|
+
k,
|
|
191
|
+
G.hasScheduledPayment,
|
|
192
|
+
U,
|
|
193
|
+
q.achInstructions,
|
|
194
|
+
q.isError,
|
|
195
|
+
q.isLoading,
|
|
196
|
+
K
|
|
197
|
+
]), Te = A.isLoading || j.isResolving || M.isResolving || q.isLoading, Ee = A.isError || j.isError || M.isError;
|
|
198
|
+
return /* @__PURE__ */ y(_, { children: [
|
|
199
|
+
/* @__PURE__ */ v(i, {
|
|
200
|
+
open: b,
|
|
201
|
+
onOpenChange: x,
|
|
202
|
+
details: we,
|
|
203
|
+
actions: xe,
|
|
204
|
+
approvalPolicy: W.view,
|
|
205
|
+
showApprovalOverrideNotice: be && !!P?.approval_policy_id,
|
|
206
|
+
paymentHistory: $,
|
|
207
|
+
paymentHistoryError: G.isError || Q.isError,
|
|
208
|
+
paymentHistoryLoading: G.isResolving || Q.isLoading,
|
|
209
|
+
isLoading: Te,
|
|
210
|
+
isError: Ee,
|
|
211
|
+
notice: Ce,
|
|
212
|
+
onClose: C,
|
|
213
|
+
onExpand: w,
|
|
214
|
+
testId: E,
|
|
215
|
+
labels: k.sheet
|
|
209
216
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
...
|
|
212
|
-
labels: { cancelButton:
|
|
213
|
-
testId:
|
|
214
|
-
confirmTestId:
|
|
215
|
-
reasonTestId:
|
|
216
|
-
reasonFieldId:
|
|
217
|
+
/* @__PURE__ */ v(r, {
|
|
218
|
+
...Se,
|
|
219
|
+
labels: { cancelButton: k.decisionDialog.cancelButton },
|
|
220
|
+
testId: E ? `${E}-decision-dialog` : void 0,
|
|
221
|
+
confirmTestId: E ? `${E}-decision-confirm` : void 0,
|
|
222
|
+
reasonTestId: E ? `${E}-decision-reason` : void 0,
|
|
223
|
+
reasonFieldId: E ? `${E}-decision-reason-field` : void 0
|
|
217
224
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
|
|
220
|
-
ref:
|
|
221
|
-
payable:
|
|
222
|
-
onMissingAchInstructions:
|
|
223
|
-
poweredByBankName:
|
|
225
|
+
/* @__PURE__ */ v(o, { ...J.dialogProps }),
|
|
226
|
+
P ? /* @__PURE__ */ v(f, {
|
|
227
|
+
ref: F,
|
|
228
|
+
payable: P,
|
|
229
|
+
onMissingAchInstructions: w,
|
|
230
|
+
poweredByBankName: O
|
|
224
231
|
}) : null
|
|
225
232
|
] });
|
|
226
233
|
}
|
|
227
234
|
//#endregion
|
|
228
|
-
export {
|
|
235
|
+
export { b as BillDetailsContainer, b as default };
|
|
@@ -130,7 +130,10 @@ function b(e) {
|
|
|
130
130
|
return t.find((e) => e.is_default_for_currency) ?? t[0];
|
|
131
131
|
}
|
|
132
132
|
function x(e, t = "USD", n) {
|
|
133
|
-
|
|
133
|
+
let r = n && (e ?? []).find((e) => e.id === n && R(e));
|
|
134
|
+
if (r) return r;
|
|
135
|
+
let i = (e ?? []).filter((e) => e.currency === t && !!e.account_holder_name && !!e.routing_number && !!e.account_number);
|
|
136
|
+
return i.find((e) => e.is_default_for_currency) ?? i[0];
|
|
134
137
|
}
|
|
135
138
|
function S(e, t = {}) {
|
|
136
139
|
let n = e.line2.trim();
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.18", n = "6b276da3edb2bc3615d3cdad6a25d552880d25ec", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|