@tesouro/embedded-components-react 0.5.17 → 0.5.19
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/README.md +22 -21
- package/dist/index.css +18 -0
- package/dist/index.d.ts +29 -6
- package/dist/lib/CardDetailsWidget.d.ts +20 -2
- package/dist/lib/CreditCardsWidget.d.ts +29 -6
- package/dist/lib/DebitCardsWidget.d.ts +29 -6
- package/dist/lib/WidgetSuite.d.ts +29 -6
- 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/card-details-widget/feature/dist/index13.js +152 -149
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +8 -11
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index7.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index9.js +81 -79
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +39 -38
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/AddressLine.js +23 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +142 -118
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +24 -14
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/PerTransactionMaximumControl.js +17 -16
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/SpendLimitControl.js +25 -24
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/limitDecimalPlaces.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/SetupView.js +1 -1
- 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/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/card/cardPresentation.js +1 -1
- package/package.json +1 -1
|
@@ -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 };
|