@tesouro/embedded-components-react 0.3.55 → 0.3.57
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/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +65 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +4 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +3 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +30 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +37 -158
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +165 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +48 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +1 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +47 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +4 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +13 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +7 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +54 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +24 -60
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +98 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +51 -53
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +131 -140
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js +18 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -4,88 +4,88 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { usePayableSuggestionsQuery as e } from "../../data-access/dist/index16.js";
|
|
6
6
|
import "../../data-access/dist/index.js";
|
|
7
|
-
import { maskAccountNumber as t } from "./
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { useCreateCounterpartBankAccountMutation as ie, useUpdateCounterpartBankAccountMutation as ae } from "../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
13
|
-
import { useCounterpartDetails as oe } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
|
|
7
|
+
import { maskAccountNumber as t } from "./index19.js";
|
|
8
|
+
import { counterpartFormBankAccountToCreatePayload as n, counterpartFormBankAccountToUpdatePayload as ee, getAchInstructions as r, getCounterpartEmail as i, getCounterpartName as a, getPayableAchInstructions as o, hasAchFormValues as s, resolveCounterpartBankAccountWrite as c, validateAchFormValues as te } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
9
|
+
import { useCounterpartsQuery as ne } from "../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
10
|
+
import { useCreateCounterpartBankAccountMutation as re, useUpdateCounterpartBankAccountMutation as ie } from "../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
11
|
+
import { useCounterpartDetails as ae } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
|
|
14
12
|
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
13
|
+
import { VENDOR_SECTION_PROPS_LABELS_EN as oe } from "./index40.js";
|
|
14
|
+
import { buildVendorPrefill as se } from "./index42.js";
|
|
15
|
+
import { VendorInlineForm as ce } from "./index43.js";
|
|
16
|
+
import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
17
|
+
import { jsx as le } from "react/jsx-runtime";
|
|
18
18
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js
|
|
19
|
-
var
|
|
19
|
+
var m = 10, ue = 300, h = {
|
|
20
20
|
accountHolderName: "",
|
|
21
21
|
routingNumber: "",
|
|
22
22
|
accountNumber: ""
|
|
23
23
|
};
|
|
24
|
-
function
|
|
25
|
-
let
|
|
26
|
-
...
|
|
27
|
-
...
|
|
28
|
-
}, [
|
|
29
|
-
|
|
30
|
-
let [
|
|
31
|
-
|
|
32
|
-
}, []), U =
|
|
33
|
-
me(!0),
|
|
34
|
-
}, [
|
|
35
|
-
|
|
36
|
-
!V && !
|
|
24
|
+
function g({ payableId: g, counterpartId: _, payableCounterpartId: v, payableCounterpartBankAccountId: y, onCounterpartChange: b, requiredError: de, extractedVendor: x, labels: fe }) {
|
|
25
|
+
let S = {
|
|
26
|
+
...oe,
|
|
27
|
+
...fe
|
|
28
|
+
}, [C, w] = p(""), [T, E] = p(""), [D, O] = p(), [pe, k] = p(!1), [A, j] = p(h), M = f(A);
|
|
29
|
+
M.current = A;
|
|
30
|
+
let [N, P] = p(!1), F = s(A) || N, [I, L] = p(), [R, z] = p(), B = f(_), [V, me] = p(!1), H = l(() => {
|
|
31
|
+
k(!1), j(h), L(void 0), z(void 0);
|
|
32
|
+
}, []), U = l((e) => {
|
|
33
|
+
me(!0), b(e);
|
|
34
|
+
}, [b]), W = e(g, { enabled: !!g && !_ && !v }).data?.suggested_counterpart?.id;
|
|
35
|
+
u(() => {
|
|
36
|
+
!V && !_ && !v && W && U(W);
|
|
37
37
|
}, [
|
|
38
|
+
_,
|
|
38
39
|
v,
|
|
39
|
-
y,
|
|
40
40
|
V,
|
|
41
41
|
W,
|
|
42
42
|
U
|
|
43
|
-
]),
|
|
44
|
-
B.current !==
|
|
45
|
-
}, [
|
|
43
|
+
]), u(() => {
|
|
44
|
+
B.current !== _ && (B.current = _, H());
|
|
45
|
+
}, [_, H]), u(() => {
|
|
46
46
|
let e = setTimeout(() => {
|
|
47
|
-
|
|
48
|
-
},
|
|
47
|
+
E(C.trim());
|
|
48
|
+
}, ue);
|
|
49
49
|
return () => clearTimeout(e);
|
|
50
|
-
}, [
|
|
51
|
-
let G =
|
|
50
|
+
}, [C]);
|
|
51
|
+
let G = ne({
|
|
52
52
|
sort: "counterpart_name",
|
|
53
53
|
order: "asc",
|
|
54
|
-
limit:
|
|
55
|
-
counterpart_name__icontains:
|
|
54
|
+
limit: m,
|
|
55
|
+
counterpart_name__icontains: T || void 0,
|
|
56
56
|
is_vendor: !0,
|
|
57
|
-
enabled: !!
|
|
58
|
-
}), K =
|
|
57
|
+
enabled: !!T
|
|
58
|
+
}), K = ae({ selectedId: _ }), q = re(), J = ie(), Y = d(() => {
|
|
59
59
|
let e = K.counterpart;
|
|
60
60
|
if (!e) return;
|
|
61
61
|
if (K.isBankAccountsLoading) return {
|
|
62
|
-
name:
|
|
63
|
-
email:
|
|
64
|
-
methodLabel:
|
|
62
|
+
name: a(e),
|
|
63
|
+
email: i(e),
|
|
64
|
+
methodLabel: S.paymentMethodLoading,
|
|
65
65
|
fields: []
|
|
66
66
|
};
|
|
67
67
|
if (K.isBankAccountsError) return {
|
|
68
|
-
name:
|
|
69
|
-
email:
|
|
70
|
-
methodLabel:
|
|
68
|
+
name: a(e),
|
|
69
|
+
email: i(e),
|
|
70
|
+
methodLabel: S.paymentMethodUnavailable,
|
|
71
71
|
fields: []
|
|
72
72
|
};
|
|
73
|
-
let n =
|
|
73
|
+
let n = o(K.bankAccounts);
|
|
74
74
|
return {
|
|
75
|
-
name:
|
|
76
|
-
email:
|
|
77
|
-
methodLabel: n ?
|
|
75
|
+
name: a(e),
|
|
76
|
+
email: i(e),
|
|
77
|
+
methodLabel: n ? S.achMethod : S.noMethod,
|
|
78
78
|
fields: n ? [
|
|
79
79
|
{
|
|
80
|
-
label:
|
|
80
|
+
label: S.accountHolder,
|
|
81
81
|
value: n.account_holder_name ?? ""
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
|
-
label:
|
|
84
|
+
label: S.routingNumber,
|
|
85
85
|
value: n.routing_number ?? ""
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
|
-
label:
|
|
88
|
+
label: S.accountNumber,
|
|
89
89
|
value: n.account_number ?? "",
|
|
90
90
|
maskedValue: n.account_number ? t(n.account_number) : ""
|
|
91
91
|
}
|
|
@@ -96,43 +96,43 @@ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCou
|
|
|
96
96
|
K.counterpart,
|
|
97
97
|
K.isBankAccountsError,
|
|
98
98
|
K.isBankAccountsLoading,
|
|
99
|
-
|
|
100
|
-
]), X =
|
|
101
|
-
let e =
|
|
102
|
-
if (!
|
|
103
|
-
if (!
|
|
99
|
+
S
|
|
100
|
+
]), X = d(() => r(K.bankAccounts), [K.bankAccounts]), Z = d(() => o(K.bankAccounts)?.id, [K.bankAccounts]), Q = l(async () => {
|
|
101
|
+
let e = M.current;
|
|
102
|
+
if (!_) return { ok: !0 };
|
|
103
|
+
if (!s(e)) return y && _ === v ? {
|
|
104
104
|
ok: !0,
|
|
105
|
-
counterpartBankAccountId:
|
|
105
|
+
counterpartBankAccountId: y
|
|
106
106
|
} : K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError ? { ok: !1 } : {
|
|
107
107
|
ok: !0,
|
|
108
108
|
counterpartBankAccountId: Z
|
|
109
109
|
};
|
|
110
110
|
if (K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError) return { ok: !1 };
|
|
111
|
-
let t =
|
|
112
|
-
if (Object.keys(t).length > 0) return L(t),
|
|
111
|
+
let t = te(e);
|
|
112
|
+
if (Object.keys(t).length > 0) return L(t), k(!0), { ok: !1 };
|
|
113
113
|
L(void 0);
|
|
114
|
-
let
|
|
115
|
-
if (
|
|
114
|
+
let r = c(K.bankAccounts, R ?? X?.id);
|
|
115
|
+
if (r.kind === "update") return await J.mutateAsync({
|
|
116
116
|
path: {
|
|
117
|
-
counterpart_id:
|
|
118
|
-
bank_account_id:
|
|
117
|
+
counterpart_id: _,
|
|
118
|
+
bank_account_id: r.bankAccountId
|
|
119
119
|
},
|
|
120
|
-
body:
|
|
121
|
-
}), z(
|
|
120
|
+
body: ee(e, { includeAchDefaults: r.includeAchDefaults })
|
|
121
|
+
}), z(r.bankAccountId), {
|
|
122
122
|
ok: !0,
|
|
123
|
-
counterpartBankAccountId:
|
|
123
|
+
counterpartBankAccountId: r.bankAccountId
|
|
124
124
|
};
|
|
125
|
-
let
|
|
126
|
-
path: { counterpart_id:
|
|
127
|
-
body:
|
|
125
|
+
let i = await q.mutateAsync({
|
|
126
|
+
path: { counterpart_id: _ },
|
|
127
|
+
body: n(e, { isDefaultForCurrency: r.isDefaultForCurrency })
|
|
128
128
|
});
|
|
129
|
-
return z(
|
|
129
|
+
return z(i?.id), {
|
|
130
130
|
ok: !0,
|
|
131
|
-
counterpartBankAccountId:
|
|
131
|
+
counterpartBankAccountId: i?.id
|
|
132
132
|
};
|
|
133
133
|
}, [
|
|
134
134
|
X,
|
|
135
|
-
|
|
135
|
+
_,
|
|
136
136
|
q,
|
|
137
137
|
K.bankAccounts,
|
|
138
138
|
K.isBankAccountsError,
|
|
@@ -140,29 +140,29 @@ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCou
|
|
|
140
140
|
K.isBankAccountsLoading,
|
|
141
141
|
R,
|
|
142
142
|
Z,
|
|
143
|
-
b,
|
|
144
143
|
y,
|
|
144
|
+
v,
|
|
145
145
|
J
|
|
146
|
-
]), he =
|
|
147
|
-
name:
|
|
148
|
-
email:
|
|
146
|
+
]), he = d(() => (G.data?.data ?? []).map((e) => ({
|
|
147
|
+
name: a(e),
|
|
148
|
+
email: i(e),
|
|
149
149
|
onSelect: () => U(e.id)
|
|
150
|
-
})), [G.data, U]), ge =
|
|
151
|
-
|
|
152
|
-
}, []), _e =
|
|
153
|
-
|
|
150
|
+
})), [G.data, U]), ge = d(() => se(x), [x]), $ = l(() => {
|
|
151
|
+
O(void 0), P(!1);
|
|
152
|
+
}, []), _e = l((e) => {
|
|
153
|
+
O(void 0), P(!1), U(e);
|
|
154
154
|
}, [U]);
|
|
155
|
-
if (
|
|
155
|
+
if (D) return {
|
|
156
156
|
mode: "creating",
|
|
157
|
-
newVendorForm: /* @__PURE__ */ ce
|
|
158
|
-
mode:
|
|
159
|
-
counterpart:
|
|
160
|
-
primaryAddress:
|
|
161
|
-
bankAccounts:
|
|
162
|
-
isBankAccountsLoading:
|
|
163
|
-
isBankAccountsError:
|
|
164
|
-
initialName:
|
|
165
|
-
initialValues:
|
|
157
|
+
newVendorForm: /* @__PURE__ */ le(ce, {
|
|
158
|
+
mode: D,
|
|
159
|
+
counterpart: D === "edit" ? K.counterpart : void 0,
|
|
160
|
+
primaryAddress: D === "edit" ? K.primaryAddress : void 0,
|
|
161
|
+
bankAccounts: D === "edit" ? K.bankAccounts : void 0,
|
|
162
|
+
isBankAccountsLoading: D === "edit" ? K.isBankAccountsLoading : void 0,
|
|
163
|
+
isBankAccountsError: D === "edit" ? K.isBankAccountsError : void 0,
|
|
164
|
+
initialName: D === "create" ? C : void 0,
|
|
165
|
+
initialValues: D === "create" ? ge : void 0,
|
|
166
166
|
onSaved: _e,
|
|
167
167
|
onCancel: $,
|
|
168
168
|
onDirtyChange: P
|
|
@@ -175,21 +175,21 @@ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCou
|
|
|
175
175
|
return {
|
|
176
176
|
mode: "resolved",
|
|
177
177
|
summary: Y,
|
|
178
|
-
onEdit: e ? void 0 : () =>
|
|
178
|
+
onEdit: e ? void 0 : () => O("edit"),
|
|
179
179
|
onClear: () => U(void 0),
|
|
180
180
|
paymentInstructions: e ? void 0 : {
|
|
181
|
-
isOpen:
|
|
182
|
-
values:
|
|
181
|
+
isOpen: pe,
|
|
182
|
+
values: A,
|
|
183
183
|
errors: I,
|
|
184
184
|
onOpen: () => {
|
|
185
|
-
|
|
185
|
+
k(!0), X && (j({
|
|
186
186
|
accountHolderName: X.account_holder_name ?? "",
|
|
187
187
|
routingNumber: X.routing_number ?? "",
|
|
188
188
|
accountNumber: X.account_number ?? ""
|
|
189
189
|
}), z(X.id));
|
|
190
190
|
},
|
|
191
191
|
onChange: (e) => {
|
|
192
|
-
|
|
192
|
+
j((t) => ({
|
|
193
193
|
...t,
|
|
194
194
|
...e
|
|
195
195
|
})), L(void 0);
|
|
@@ -201,12 +201,12 @@ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCou
|
|
|
201
201
|
}
|
|
202
202
|
return {
|
|
203
203
|
mode: "selecting",
|
|
204
|
-
error: G.isError ?
|
|
204
|
+
error: G.isError ? S.searchFailed : K.isError ? S.vendorDetailsFailed : de,
|
|
205
205
|
search: {
|
|
206
|
-
query:
|
|
207
|
-
onQueryChange:
|
|
206
|
+
query: C,
|
|
207
|
+
onQueryChange: w,
|
|
208
208
|
isLoading: G.isLoading,
|
|
209
|
-
onAddVendor: () =>
|
|
209
|
+
onAddVendor: () => O("create"),
|
|
210
210
|
results: he
|
|
211
211
|
},
|
|
212
212
|
savePaymentInstructions: Q,
|
|
@@ -214,4 +214,4 @@ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCou
|
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
//#endregion
|
|
217
|
-
export {
|
|
217
|
+
export { g as useVendorSectionProps };
|
|
@@ -24,16 +24,16 @@ import { UnsavedBillDialog as fe } from "../../ui/dist/index97.js";
|
|
|
24
24
|
import "../../ui/dist/index.js";
|
|
25
25
|
import { usePayableDuplicateReview as pe } from "./index10.js";
|
|
26
26
|
import "./index11.js";
|
|
27
|
-
import { resolveAmountDueMinorUnits as me } from "./
|
|
28
|
-
import { PayBillFlow as he } from "./
|
|
29
|
-
import "./
|
|
27
|
+
import { resolveAmountDueMinorUnits as me } from "./index17.js";
|
|
28
|
+
import { PayBillFlow as he } from "./index23.js";
|
|
29
|
+
import "./index24.js";
|
|
30
30
|
import { useMarkAsPaidFlow as ge } from "./index14.js";
|
|
31
31
|
import "./index15.js";
|
|
32
32
|
import { BILL_CREATE_MESSAGE_LABELS_EN as _e, mergeBillCreateScreenCopy as ve } from "./index40.js";
|
|
33
33
|
import { useBillCreateController as ye } from "./index49.js";
|
|
34
34
|
import { useBillForm as be } from "./index51.js";
|
|
35
|
-
import { useApprovalPolicyCardView as xe } from "./
|
|
36
|
-
import { useCurrentApprovalRequestId as Se } from "./
|
|
35
|
+
import { useApprovalPolicyCardView as xe } from "./index29.js";
|
|
36
|
+
import { useCurrentApprovalRequestId as Se } from "./index30.js";
|
|
37
37
|
import { usePayableDetailActions as Ce } from "./index31.js";
|
|
38
38
|
import { useScheduledPayment as we } from "./index32.js";
|
|
39
39
|
import { isEditablePayableStatus as Te } from "./index33.js";
|
|
@@ -48,55 +48,52 @@ import { useCallback as i, useEffect as Me, useMemo as a, useRef as Ne, useState
|
|
|
48
48
|
import { Fragment as Pe, jsx as s, jsxs as Fe } from "react/jsx-runtime";
|
|
49
49
|
import { Trash2Icon as Ie } from "lucide-react";
|
|
50
50
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js
|
|
51
|
-
function Le
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f, onCollapse: Re, poweredByBankName: ze }) {
|
|
55
|
-
let p = a(() => ve(f), [f]), [m, h] = o(), [g, _] = o(!1), [Be, Ve] = o(!1), [He, v] = o(!1), [Ue, y] = o(), b = u ?? Ue, x = oe(b, { pollWhileOcrProcessing: !0 }), S = ae(b), { initResponse: C } = re(), w = !!C, T = e(C?.scopes, [t.AccountingConfigReadOrg]), E = ee({ enabled: T }), D = x.data, O = !b || !!D, k = !d && O && !!b && D?.status !== "draft", We = !d && !!D && !Te(D?.status), A = d || We, j = be({
|
|
51
|
+
function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f, onCollapse: Le, poweredByBankName: Re }) {
|
|
52
|
+
let p = a(() => ve(f), [f]), [m, h] = o(), [g, _] = o(!1), [ze, Be] = o(!1), [Ve, v] = o(!1), [He, y] = o(), b = u ?? He, x = oe(b, { pollWhileOcrProcessing: !0 }), S = ae(b), { initResponse: C } = re(), w = !!C, T = e(C?.scopes, [t.AccountingConfigReadOrg]), E = ee({ enabled: T }), D = x.data, O = !b || !!D, k = !d && O && !!b && D?.status !== "draft", Ue = !d && !!D && !Te(D?.status), A = d || Ue, j = be({
|
|
56
53
|
payable: D,
|
|
57
54
|
lineItems: S.lineItems
|
|
58
55
|
}), M = D?.counterpart_id;
|
|
59
56
|
Me(() => {
|
|
60
57
|
g || M && (h(M), _(!0));
|
|
61
58
|
}, [g, M]);
|
|
62
|
-
let
|
|
59
|
+
let We = i((e) => {
|
|
63
60
|
_(!0), h(e);
|
|
64
61
|
}, []), N = Ae({
|
|
65
62
|
payableId: d ? void 0 : b,
|
|
66
63
|
counterpartId: d ? void 0 : m,
|
|
67
64
|
payableCounterpartId: M,
|
|
68
|
-
onCounterpartChange:
|
|
65
|
+
onCounterpartChange: We,
|
|
69
66
|
requiredError: j.errors?.vendor,
|
|
70
67
|
payableCounterpartBankAccountId: D?.counterpart_bank_account_id ?? void 0,
|
|
71
68
|
extractedVendor: D?.counterpart_raw_data ?? void 0
|
|
72
|
-
}),
|
|
69
|
+
}), Ge = !!(b && g) && !m, Ke = a(() => k ? { saveDraftButton: p.submittedSaveButton } : void 0, [p.submittedSaveButton, k]), qe = a(() => k ? { draftSaved: _e.submittedSaved } : void 0, [k]), P = x.refetch, Je = i(async () => {
|
|
73
70
|
let { data: e } = await P();
|
|
74
71
|
return e?.status ?? void 0;
|
|
75
72
|
}, [P]), F = ye({
|
|
76
73
|
payableId: u,
|
|
77
74
|
form: j,
|
|
78
|
-
labels:
|
|
75
|
+
labels: qe,
|
|
79
76
|
counterpartId: m,
|
|
80
|
-
clearCounterpart:
|
|
77
|
+
clearCounterpart: Ge,
|
|
81
78
|
prepareVendorForSave: N.savePaymentInstructions,
|
|
82
79
|
onPayableCreated: y,
|
|
83
80
|
onSaved: y,
|
|
84
81
|
onDraftSaved: () => l(!1),
|
|
85
82
|
onFinalized: () => l(!1),
|
|
86
|
-
readSavedStatus: k ?
|
|
83
|
+
readSavedStatus: k ? Je : void 0
|
|
87
84
|
}), I = !!(F.isSavingDraft || F.isFinalizing), L = d ? b : void 0, R = Se({
|
|
88
85
|
payableId: L,
|
|
89
86
|
status: D?.status
|
|
90
|
-
}),
|
|
87
|
+
}), Ye = Ne(null), z = we({
|
|
91
88
|
payableId: b,
|
|
92
89
|
scheduledPaymentDate: D?.scheduled_payment_date,
|
|
93
90
|
enabled: d || k
|
|
94
|
-
}),
|
|
91
|
+
}), Xe = se(D), B = je({
|
|
95
92
|
payableId: L,
|
|
96
93
|
counterpartId: d ? M : void 0,
|
|
97
94
|
saveErrorMessage: p.detail.paymentInstructionsSaveError,
|
|
98
95
|
linkErrorMessage: p.detail.paymentInstructionsLinkError
|
|
99
|
-
}),
|
|
96
|
+
}), Ze = e(C?.scopes, [t.PayableWriteOrg]), Qe = e(C?.scopes, [t.CounterpartWriteOrg]) && Ze, V = ge({
|
|
100
97
|
payableId: L,
|
|
101
98
|
amountDueMinorUnits: me(D) ?? 0,
|
|
102
99
|
amountToPayMinorUnits: D?.amount_to_pay ?? void 0,
|
|
@@ -109,7 +106,7 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
|
|
|
109
106
|
approvalPolicyId: D?.approval_policy_id,
|
|
110
107
|
enabled: d,
|
|
111
108
|
copy: p.approvalPolicyCopy
|
|
112
|
-
}), { actions: U, decisionDialog:
|
|
109
|
+
}), { actions: U, decisionDialog: $e, isActionPending: et } = Ce({
|
|
113
110
|
payableId: d || k ? b : void 0,
|
|
114
111
|
status: D?.status,
|
|
115
112
|
currentApprovalRequestId: R.id,
|
|
@@ -123,7 +120,7 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
|
|
|
123
120
|
labels: p.actions,
|
|
124
121
|
isMarkAsPaidPending: V.isPending,
|
|
125
122
|
onMarkAsPaidSelect: V.open,
|
|
126
|
-
onPayBillSelect: () =>
|
|
123
|
+
onPayBillSelect: () => Ye.current?.open(),
|
|
127
124
|
onActionSucceeded: k ? () => l(!1) : void 0
|
|
128
125
|
}), W = Ee({
|
|
129
126
|
payableId: b,
|
|
@@ -131,7 +128,7 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
|
|
|
131
128
|
enabled: !d,
|
|
132
129
|
labels: p.deleteDraft,
|
|
133
130
|
onDeleted: () => l(!1)
|
|
134
|
-
}), G = I ||
|
|
131
|
+
}), G = I || et, tt = a(() => [...W.menuItems, ...k ? U.menu.map((e) => ({
|
|
135
132
|
id: e.id,
|
|
136
133
|
label: e.label,
|
|
137
134
|
onSelect: e.onSelect,
|
|
@@ -145,16 +142,16 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
|
|
|
145
142
|
label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
|
|
146
143
|
})), [E.data]), q;
|
|
147
144
|
w && (T ? E.isError ? q = p.lineItemsGlCodeUnavailable.loadError : !E.isResolving && K.length === 0 && (q = p.lineItemsGlCodeUnavailable.empty) : q = p.lineItemsGlCodeUnavailable.noAccess);
|
|
148
|
-
let
|
|
149
|
-
|
|
150
|
-
|
|
145
|
+
let nt = !w || !!q || E.isResolving, rt = T && !E.isResolving && !E.isError, it = ie(L), at = e(C?.scopes, [t.UserReadOrg]), ot = te({ enabled: d && at }), J = a(() => Oe(it.data?.data ?? [], ot.data?.data ?? [], p.history), [
|
|
146
|
+
it.data,
|
|
147
|
+
ot.data,
|
|
151
148
|
p.history
|
|
152
|
-
]),
|
|
149
|
+
]), st = a(() => d && D ? De({
|
|
153
150
|
payable: D,
|
|
154
151
|
lineItems: S.lineItems,
|
|
155
152
|
glCodeOptions: K,
|
|
156
|
-
glCodeRosterAvailable:
|
|
157
|
-
history:
|
|
153
|
+
glCodeRosterAvailable: rt,
|
|
154
|
+
history: J,
|
|
158
155
|
approvalPolicy: H.view,
|
|
159
156
|
labels: p.detail,
|
|
160
157
|
hasScheduledPayment: z.hasScheduledPayment
|
|
@@ -163,12 +160,12 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
|
|
|
163
160
|
H.view,
|
|
164
161
|
p.detail,
|
|
165
162
|
K,
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
rt,
|
|
164
|
+
J,
|
|
168
165
|
S.lineItems,
|
|
169
166
|
D,
|
|
170
167
|
d
|
|
171
|
-
]),
|
|
168
|
+
]), ct = D?.source_of_payable_data === "ocr", Y = Xe?.name, lt = d ? Y ? p.viewTitle(Y) : p.readOnlyTitle : Y && (ct || k) ? p.extractedTitle(Y) : p.newTitle, ut = d && D?.created_at ? p.addedOn(ne(D.created_at.slice(0, 10))) : void 0, X = i(() => {
|
|
172
169
|
let e = j.isDirty || N.hasUnsavedVendorChanges || !!F.stagedFile || F.isFileDeletionPending;
|
|
173
170
|
if (!A && e) {
|
|
174
171
|
v(!0);
|
|
@@ -182,9 +179,9 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
|
|
|
182
179
|
A,
|
|
183
180
|
l,
|
|
184
181
|
N.hasUnsavedVendorChanges
|
|
185
|
-
]),
|
|
182
|
+
]), dt = i(() => {
|
|
186
183
|
v(!1), l(!1);
|
|
187
|
-
}, [l]), Z = S.isResolving || N.mode === "creating",
|
|
184
|
+
}, [l]), Z = S.isResolving || N.mode === "creating", ft = i(async () => {
|
|
188
185
|
if (Z) return;
|
|
189
186
|
let e = await F.saveDraft();
|
|
190
187
|
v(!1), e && l(!1);
|
|
@@ -195,28 +192,28 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
|
|
|
195
192
|
]), Q = pe({
|
|
196
193
|
payable: D,
|
|
197
194
|
onRemoved: () => l(!1),
|
|
198
|
-
canManage:
|
|
199
|
-
}),
|
|
195
|
+
canManage: Ze
|
|
196
|
+
}), pt = i((e) => {
|
|
200
197
|
if (!(G || Q.isBusy)) return e ? l(!0) : X();
|
|
201
198
|
}, [
|
|
202
199
|
Q.isBusy,
|
|
203
200
|
G,
|
|
204
201
|
X,
|
|
205
202
|
l
|
|
206
|
-
]),
|
|
203
|
+
]), mt = Q.isPossibleDuplicate, $ = !d && ct && !ze, ht = mt || $ ? /* @__PURE__ */ Fe(Pe, { children: [mt ? /* @__PURE__ */ s(le, {
|
|
207
204
|
onNotADuplicate: Q.onNotADuplicate,
|
|
208
205
|
onRemoveBill: Q.onRemoveBill,
|
|
209
206
|
isActionDisabled: Q.isBusy,
|
|
210
207
|
labels: Q.removeBillLabel ? { removeBillButton: Q.removeBillLabel } : void 0,
|
|
211
208
|
testId: r.duplicateNotice
|
|
212
|
-
}) : null, $ ? /* @__PURE__ */ s(ue, { onDismiss: () =>
|
|
209
|
+
}) : null, $ ? /* @__PURE__ */ s(ue, { onDismiss: () => Be(!0) }) : null] }) : void 0;
|
|
213
210
|
return /* @__PURE__ */ Fe(Pe, { children: [
|
|
214
211
|
/* @__PURE__ */ s(ce, {
|
|
215
212
|
open: c,
|
|
216
|
-
onOpenChange:
|
|
217
|
-
title:
|
|
218
|
-
subtitle:
|
|
219
|
-
notice:
|
|
213
|
+
onOpenChange: pt,
|
|
214
|
+
title: lt,
|
|
215
|
+
subtitle: ut,
|
|
216
|
+
notice: ht,
|
|
220
217
|
vendor: {
|
|
221
218
|
...N,
|
|
222
219
|
testId: r.vendorSection
|
|
@@ -227,7 +224,7 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
|
|
|
227
224
|
lineItems: {
|
|
228
225
|
items: j.lineItemRows,
|
|
229
226
|
glCodeOptions: K,
|
|
230
|
-
glCodeDisabled:
|
|
227
|
+
glCodeDisabled: nt,
|
|
231
228
|
glCodeUnavailableMessage: q,
|
|
232
229
|
discount: j.discount,
|
|
233
230
|
onDiscountChange: j.onDiscountChange,
|
|
@@ -263,13 +260,13 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
|
|
|
263
260
|
hasFailed: F.hasFileDeletionFailed
|
|
264
261
|
}
|
|
265
262
|
}),
|
|
266
|
-
menuItems:
|
|
263
|
+
menuItems: tt,
|
|
267
264
|
readOnly: A,
|
|
268
265
|
detail: d ? {
|
|
269
|
-
view:
|
|
266
|
+
view: st,
|
|
270
267
|
actions: U,
|
|
271
268
|
scheduledSummary: z.hasScheduledPayment && z.scheduledDateLabel ? p.scheduledSummary(z.scheduledDateLabel) : void 0,
|
|
272
|
-
paymentInstructionsForm: M &&
|
|
269
|
+
paymentInstructionsForm: M && Qe ? {
|
|
273
270
|
isOpen: B.isOpen,
|
|
274
271
|
values: B.values,
|
|
275
272
|
errors: B.errors,
|
|
@@ -287,17 +284,17 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
|
|
|
287
284
|
isSavingDraft: F.isSavingDraft,
|
|
288
285
|
isFinalizing: F.isFinalizing,
|
|
289
286
|
onCancel: X,
|
|
290
|
-
onCollapse: d ?
|
|
287
|
+
onCollapse: d ? Le : void 0,
|
|
291
288
|
onSaveDraft: F.saveDraft,
|
|
292
289
|
onFinalize: F.finalize,
|
|
293
290
|
showFinalize: !k && O,
|
|
294
|
-
labels:
|
|
291
|
+
labels: Ke,
|
|
295
292
|
testId: r.dialog
|
|
296
293
|
}),
|
|
297
294
|
/* @__PURE__ */ s(fe, {
|
|
298
|
-
open:
|
|
299
|
-
onSaveDraft:
|
|
300
|
-
onDiscard:
|
|
295
|
+
open: Ve,
|
|
296
|
+
onSaveDraft: ft,
|
|
297
|
+
onDiscard: dt,
|
|
301
298
|
onCancel: () => v(!1),
|
|
302
299
|
isSaving: F.isSavingDraft,
|
|
303
300
|
isSaveDraftDisabled: Z,
|
|
@@ -307,7 +304,7 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
|
|
|
307
304
|
discardTestId: r.unsavedDiscard
|
|
308
305
|
}),
|
|
309
306
|
/* @__PURE__ */ s(n, {
|
|
310
|
-
|
|
307
|
+
...$e,
|
|
311
308
|
labels: { cancelButton: p.actions.decisionDialog.cancelButton },
|
|
312
309
|
testId: r.decisionDialog,
|
|
313
310
|
confirmTestId: r.decisionConfirm,
|
|
@@ -332,9 +329,10 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
|
|
|
332
329
|
}),
|
|
333
330
|
/* @__PURE__ */ s(de, { ...V.dialogProps }),
|
|
334
331
|
d && D ? /* @__PURE__ */ s(he, {
|
|
335
|
-
ref:
|
|
332
|
+
ref: Ye,
|
|
336
333
|
payable: D,
|
|
337
|
-
|
|
334
|
+
onMissingAchInstructions: Qe ? B.open : void 0,
|
|
335
|
+
poweredByBankName: Re,
|
|
338
336
|
labels: p.payBill
|
|
339
337
|
}) : null
|
|
340
338
|
] });
|
|
@@ -2,7 +2,7 @@ import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index55.js";
|
|
|
2
2
|
import "../../ui/dist/index.js";
|
|
3
3
|
import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index12.js";
|
|
4
4
|
import "./index15.js";
|
|
5
|
-
import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./
|
|
5
|
+
import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index25.js";
|
|
6
6
|
import { BILL_DETAIL_ACTIONS_LABELS_EN as r, SCHEDULED_SUMMARY_LABEL_EN as i } from "./index38.js";
|
|
7
7
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js
|
|
8
8
|
var a = {
|