@tesouro/embedded-components-react 0.5.303 → 0.5.305
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/bill-detail/feature/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +8 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +7 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +8 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +24 -157
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +20 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +13 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +153 -89
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +17 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +23 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +42 -55
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +93 -107
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +77 -185
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +3 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +55 -72
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +111 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +184 -463
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js +14 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +78 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +61 -74
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +115 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +449 -216
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +116 -42
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +11 -249
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +85 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +80 -648
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +240 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +44 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +38 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +242 -240
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +25 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +538 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +3 -66
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +42 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +239 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +67 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +227 -38
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index6.js +82 -224
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index7.js +45 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index8.js +4 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index29.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidgetNative/BillsTab.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -1,473 +1,194 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
10
|
-
import
|
|
11
|
-
import "../../../../shared/feature/dist/index.js";
|
|
12
|
-
import { VENDOR_SECTION_PROPS_LABELS_EN as r } from "./index25.js";
|
|
13
|
-
import { usePayableSuggestionsQuery as i } from "../../data-access/dist/index19.js";
|
|
14
|
-
import "../../data-access/dist/index.js";
|
|
15
|
-
import { resolvePaymentInstructionsGestures as a } from "./index14.js";
|
|
16
|
-
import { COUNTERPART_MESSAGE_LABELS_EN as o } from "../../../../shared/counterpart-management/feature/dist/lib/labels.js";
|
|
17
|
-
import { counterpartFormBankAccountToCreatePayload as te, counterpartFormBankAccountToUpdatePayload as ne, getAchInstructions as s, getCounterpartEmail as c, getCounterpartName as re, getPayableAchInstructions as ie, hasCounterpartFormErrors as ae, isAchCompatibleBankAccount as l, resolveCounterpartBankAccountWrite as oe, validateAchFormValues as se, validateCounterpartForm as ce } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
18
|
-
import { useCounterpartsQuery as le } from "../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
19
|
-
import { useCreateCounterpartBankAccountMutation as ue, useUpdateCounterpartBankAccountMutation as de } from "../../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
20
|
-
import { useCounterpartDetails as fe } from "../../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
|
|
21
|
-
import { useCounterpartForm as pe } from "../../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
|
|
22
|
-
import "../../../../shared/counterpart-management/feature/dist/index.js";
|
|
23
|
-
import { buildVendorPrefill as me, canAutoCreateVendor as he, toCounterpartRawData as ge } from "./index27.js";
|
|
24
|
-
import { VendorInlineForm as _e } from "./index28.js";
|
|
25
|
-
import { useCallback as u, useEffect as d, useLayoutEffect as ve, useMemo as f, useRef as p, useState as m } from "react";
|
|
26
|
-
import { jsx as ye } from "react/jsx-runtime";
|
|
1
|
+
import { AWAITING_APPROVAL_LABEL_EN as e, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as t, BILL_DETAIL_ACTIONS_LABELS_EN as n, PAYMENT_HISTORY_LABELS_EN as r, SCHEDULED_RELATIVE_DAY_LABELS_EN as i, SCHEDULED_STATUS_BADGE_LABEL_EN as a, SCHEDULED_SUMMARY_LABEL_EN as o, mergeBillDetailActionsLabels as s, mergePaymentHistoryMethodLabels as c } from "../../../util/dist/lib/billDetailLabels.js";
|
|
2
|
+
import { APPROVAL_POLICY_RULE_COPY_EN as l } from "./index7.js";
|
|
3
|
+
import { PAYABLE_AUDIT_HISTORY_LABELS_EN as u } from "./index27.js";
|
|
4
|
+
import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as d } from "./index28.js";
|
|
5
|
+
import { ACH_FIELD_GROUP_LABELS_EN as f } from "../../../../shared/counterpart-management/ui/dist/index2.js";
|
|
6
|
+
import "../../../../shared/counterpart-management/ui/dist/index.js";
|
|
7
|
+
import { BILL_REJECTED_BANNER_LABELS_EN as p } from "../../ui/dist/index39.js";
|
|
8
|
+
import { DISCARD_CHANGES_DIALOG_LABELS_EN as m } from "../../ui/dist/index42.js";
|
|
9
|
+
import { UNSAVED_BILL_DIALOG_LABELS_EN as h } from "../../ui/dist/index51.js";
|
|
10
|
+
import "../../ui/dist/index.js";
|
|
27
11
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
12
|
+
var g = {
|
|
13
|
+
unmappedValidationError: (e, t) => `${e}: ${t}`,
|
|
14
|
+
unknownValidationField: "(unknown field)",
|
|
15
|
+
requiredField: "This field is required.",
|
|
16
|
+
saveFailed: "We could not save this bill. Try again.",
|
|
17
|
+
discountTaxBlockedByLineItems: "Discount and Tax can't be saved on a bill with line items. Remove them, then save again.",
|
|
18
|
+
vendorResolutionFailed: "We couldn't create this vendor automatically. Select or add a vendor before submitting.",
|
|
19
|
+
finalizeFailed: "We could not submit this bill. Try again.",
|
|
20
|
+
draftSaved: "Bill saved as a draft.",
|
|
21
|
+
submittedSaved: "Bill updated.",
|
|
22
|
+
submittedDemoted: "Bill updated. It moved back to Drafts because some required details are missing.",
|
|
23
|
+
billFinalized: "Bill submitted for approval.",
|
|
24
|
+
numbersOnly: "Enter numbers only.",
|
|
25
|
+
unreadableMoney: "Enter a valid amount.",
|
|
26
|
+
unusableQuantity: "Enter a quantity greater than 0.",
|
|
27
|
+
lineItemsNeedAttention: "Check the highlighted line items before saving.",
|
|
28
|
+
unreadableDiscount: "Enter a valid discount amount.",
|
|
29
|
+
unreadableTax: "Enter a valid tax amount.",
|
|
30
|
+
unreadableTotal: "Enter a valid total amount.",
|
|
31
|
+
totalNotGreaterThanZero: "Total amount must be greater than $0.",
|
|
32
|
+
poNumberTooLong: "PO number must be 255 characters or fewer.",
|
|
33
|
+
implausibleInvoiceDate: "Enter an invoice date within the last 10 years, no more than 30 days from today.",
|
|
34
|
+
implausibleDueDate: "Enter a due date within the last 10 years and next 5 years.",
|
|
35
|
+
dueBeforeInvoiceDate: "Due date must be on or after the invoice date."
|
|
36
|
+
}, _ = {
|
|
37
|
+
paymentInstructionsValue: (e) => `Account ending in ${e}`,
|
|
38
|
+
noMethod: "No payment method on file",
|
|
39
|
+
paymentMethodLoading: "Loading payment method...",
|
|
40
|
+
paymentMethodUnavailable: "We could not load payment methods. Try again.",
|
|
41
|
+
searchFailed: "We could not load vendors. Try again.",
|
|
42
|
+
vendorDetailsFailed: "We could not load this vendor. Try again.",
|
|
43
|
+
pendingVendorDescription: "Will be created when submitted",
|
|
44
|
+
pendingVendorIncompleteDescription: "Add the missing vendor details before submitting",
|
|
45
|
+
bankAccountSaveFailed: "We could not save these payment instructions. Try again."
|
|
46
|
+
}, v = {
|
|
47
|
+
attachFailed: "We could not attach that file. Try again.",
|
|
48
|
+
deleteFailed: "We could not remove that document. Try again.",
|
|
49
|
+
noDocument: "No document attached to this bill.",
|
|
50
|
+
pendingDeletionNotice: "This document will be removed when you save this bill.",
|
|
51
|
+
preview: d
|
|
52
|
+
}, y = {
|
|
53
|
+
...r,
|
|
54
|
+
notProvided: "Not provided",
|
|
55
|
+
paymentInstructionsValue: (e) => `Account ending in ${e}`,
|
|
56
|
+
paymentInstructionsNotSet: "Not set",
|
|
57
|
+
invoiceDateRow: "Invoice date",
|
|
58
|
+
dueDateRow: "Due date",
|
|
59
|
+
invoiceNumberRow: "Invoice number",
|
|
60
|
+
glCodeMissing: "GL code not specified",
|
|
61
|
+
glCodeUnavailable: "GL code unavailable",
|
|
62
|
+
qtyPriceValue: (e, t) => `${e} x ${t}`,
|
|
63
|
+
qtyOnlyValue: (e) => e,
|
|
64
|
+
subtotalRow: "Subtotal",
|
|
65
|
+
taxRow: "Tax",
|
|
66
|
+
discountRow: "Discounts",
|
|
67
|
+
totalRow: "Total",
|
|
68
|
+
paidOnLabel: (e) => `Paid on ${e}`,
|
|
69
|
+
paymentInstructionsSaveError: "Couldn't save payment instructions. Try again.",
|
|
70
|
+
paymentInstructionsLinkError: "Payment instructions were saved to the vendor, but couldn't be added to this bill. Try again.",
|
|
71
|
+
rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
|
|
72
|
+
rejectedOn: (e) => `Rejected on ${e}`,
|
|
73
|
+
rejectionMessage: (e) => `"${e}"`
|
|
74
|
+
}, b = {
|
|
75
|
+
newTitle: "New bill",
|
|
76
|
+
extractedTitle: (e) => `Bill from ${e}`,
|
|
77
|
+
viewTitle: (e) => `Bill from ${e}`,
|
|
78
|
+
readOnlyTitle: "Bill details",
|
|
79
|
+
addedOn: (e) => `Added on ${e}`,
|
|
80
|
+
unsavedChanges: h,
|
|
81
|
+
discardChanges: m,
|
|
82
|
+
scheduledRelativeDay: i,
|
|
83
|
+
scheduledSummary: o,
|
|
84
|
+
scheduledStatusBadge: a,
|
|
85
|
+
awaitingApprovalNotice: e,
|
|
86
|
+
awaitingApprovalUnknownNotice: t,
|
|
87
|
+
actions: n,
|
|
88
|
+
detail: y,
|
|
89
|
+
history: u,
|
|
90
|
+
approvalPolicyCopy: l,
|
|
91
|
+
deleteDraft: {
|
|
92
|
+
menuItem: "Delete draft",
|
|
93
|
+
dialog: {
|
|
94
|
+
title: "Delete this draft?",
|
|
95
|
+
description: "The draft and anything entered on it are removed. This can't be undone.",
|
|
96
|
+
confirmButton: "Delete draft"
|
|
97
|
+
},
|
|
98
|
+
error: "Couldn't delete this draft. Try again."
|
|
99
|
+
},
|
|
100
|
+
lineItemsGlCodeUnavailable: {
|
|
101
|
+
loadError: "Couldn't load GL codes",
|
|
102
|
+
noAccess: "You don't have access to GL codes",
|
|
103
|
+
empty: "No GL codes set up yet"
|
|
104
|
+
},
|
|
105
|
+
rejectedBanner: p
|
|
32
106
|
};
|
|
33
|
-
function
|
|
107
|
+
function x(e) {
|
|
34
108
|
return {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
109
|
+
...b,
|
|
110
|
+
...e,
|
|
111
|
+
actions: s(e?.actions),
|
|
112
|
+
detail: {
|
|
113
|
+
...b.detail,
|
|
114
|
+
...e?.detail,
|
|
115
|
+
paymentHistoryMethodLabels: c(e?.detail?.paymentHistoryMethodLabels)
|
|
116
|
+
},
|
|
117
|
+
history: {
|
|
118
|
+
...b.history,
|
|
119
|
+
...e?.history
|
|
120
|
+
},
|
|
121
|
+
lineItemsGlCodeUnavailable: {
|
|
122
|
+
...b.lineItemsGlCodeUnavailable,
|
|
123
|
+
...e?.lineItemsGlCodeUnavailable
|
|
124
|
+
},
|
|
125
|
+
unsavedChanges: {
|
|
126
|
+
...b.unsavedChanges,
|
|
127
|
+
...e?.unsavedChanges
|
|
128
|
+
},
|
|
129
|
+
discardChanges: {
|
|
130
|
+
...b.discardChanges,
|
|
131
|
+
...e?.discardChanges
|
|
132
|
+
},
|
|
133
|
+
rejectedBanner: {
|
|
134
|
+
...b.rejectedBanner,
|
|
135
|
+
...e?.rejectedBanner
|
|
136
|
+
},
|
|
137
|
+
approvalPolicyCopy: {
|
|
138
|
+
...b.approvalPolicyCopy,
|
|
139
|
+
...e?.approvalPolicyCopy
|
|
140
|
+
},
|
|
141
|
+
scheduledRelativeDay: {
|
|
142
|
+
...b.scheduledRelativeDay,
|
|
143
|
+
...e?.scheduledRelativeDay
|
|
144
|
+
},
|
|
145
|
+
deleteDraft: {
|
|
146
|
+
...b.deleteDraft,
|
|
147
|
+
...e?.deleteDraft,
|
|
148
|
+
dialog: (() => {
|
|
149
|
+
let t = {
|
|
150
|
+
...b.deleteDraft.dialog,
|
|
151
|
+
...e?.deleteDraft?.dialog
|
|
152
|
+
};
|
|
153
|
+
return delete t.reason, t;
|
|
154
|
+
})()
|
|
155
|
+
}
|
|
38
156
|
};
|
|
39
157
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}, [l, I]), d(() => {
|
|
72
|
-
let e = setTimeout(() => {
|
|
73
|
-
Fe(w.trim());
|
|
74
|
-
}, xe);
|
|
75
|
-
return () => clearTimeout(e);
|
|
76
|
-
}, [w]);
|
|
77
|
-
let z = f(() => me(v), [v]), B = z?.bankAccount, tt = f(() => he(v), [v]), nt = E === "create" ? !g(A, B ?? h) : O && !g(A, M.current), rt = !y && (E === "edit" || E === "create" && !!z), V = le({
|
|
78
|
-
sort: "counterpart_name",
|
|
79
|
-
order: "asc",
|
|
80
|
-
limit: be,
|
|
81
|
-
counterpart_name__icontains: T || void 0,
|
|
82
|
-
is_vendor: !0,
|
|
83
|
-
enabled: (rt || !y && !E && !l) && Te && Ne
|
|
84
|
-
});
|
|
85
|
-
d(() => {
|
|
86
|
-
V.isPlaceholderData || (Ie.current = T);
|
|
87
|
-
}, [T, V.isPlaceholderData]);
|
|
88
|
-
let it = V.isPlaceholderData && Ie.current !== T, H = fe({
|
|
89
|
-
selectedId: l,
|
|
90
|
-
enabled: Ne
|
|
91
|
-
}), at = ue(), ot = de(), U = pe({
|
|
92
|
-
view: Re,
|
|
93
|
-
setView: ze,
|
|
94
|
-
selectedId: Be,
|
|
95
|
-
setSelectedId: Ve,
|
|
96
|
-
messages: C,
|
|
97
|
-
counterpartType: "vendor",
|
|
98
|
-
counterpart: H.counterpart,
|
|
99
|
-
primaryAddress: H.primaryAddress,
|
|
100
|
-
includeBankAccount: !1
|
|
101
|
-
}), { openCreate: st, openEdit: ct, close: lt, setValues: W, submit: ut, values: dt } = U, G = f(() => {
|
|
102
|
-
let e = H.counterpart;
|
|
103
|
-
if (!e) return;
|
|
104
|
-
if (H.isBankAccountsLoading) return {
|
|
105
|
-
name: re(e),
|
|
106
|
-
email: c(e),
|
|
107
|
-
methodLabel: S.paymentMethodLoading,
|
|
108
|
-
hasPaymentInstructions: !1
|
|
109
|
-
};
|
|
110
|
-
if (H.isBankAccountsError) return {
|
|
111
|
-
name: re(e),
|
|
112
|
-
email: c(e),
|
|
113
|
-
methodLabel: S.paymentMethodUnavailable,
|
|
114
|
-
hasPaymentInstructions: !1
|
|
115
|
-
};
|
|
116
|
-
let t = ie(H.bankAccounts);
|
|
117
|
-
return {
|
|
118
|
-
name: re(e),
|
|
119
|
-
email: c(e),
|
|
120
|
-
methodLabel: t ? S.paymentInstructionsValue(t.account_number?.slice(-4) ?? "") : S.noMethod,
|
|
121
|
-
hasPaymentInstructions: !!t
|
|
122
|
-
};
|
|
123
|
-
}, [
|
|
124
|
-
H.bankAccounts,
|
|
125
|
-
H.counterpart,
|
|
126
|
-
H.isBankAccountsError,
|
|
127
|
-
H.isBankAccountsLoading,
|
|
128
|
-
S
|
|
129
|
-
]), K = f(() => {
|
|
130
|
-
let e = et?.trim();
|
|
131
|
-
if (!e || l || E) return;
|
|
132
|
-
let t = B?.accountNumber;
|
|
133
|
-
return {
|
|
134
|
-
name: e,
|
|
135
|
-
email: v?.email ?? "",
|
|
136
|
-
description: tt ? S.pendingVendorDescription : S.pendingVendorIncompleteDescription,
|
|
137
|
-
methodLabel: t ? S.paymentInstructionsValue(t.slice(-4)) : "",
|
|
138
|
-
hasPaymentInstructions: !!t
|
|
139
|
-
};
|
|
140
|
-
}, [
|
|
141
|
-
l,
|
|
142
|
-
B?.accountNumber,
|
|
143
|
-
v?.email,
|
|
144
|
-
et,
|
|
145
|
-
E,
|
|
146
|
-
tt,
|
|
147
|
-
S.paymentInstructionsValue,
|
|
148
|
-
S.pendingVendorDescription,
|
|
149
|
-
S.pendingVendorIncompleteDescription
|
|
150
|
-
]), ft = !!K && !tt, q = l === _ ? we : void 0, J = f(() => Ce(H.bankAccounts, q), [H.bankAccounts, q]), pt = f(() => ie(H.bankAccounts)?.id, [H.bankAccounts]), mt = !H.counterpart || H.isLoading || H.isFetching || H.isError || H.isBankAccountsLoading || H.isBankAccountsFetching || H.isBankAccountsError, ht = mt || H.isAddressesLoading || H.isAddressesFetching || H.isAddressesError, gt = b && !mt && H.isAddressesError ? { onRetry: H.refetchAddresses } : void 0, Y = u(() => {
|
|
151
|
-
lt(), Le(void 0), D(!1), P.current = void 0;
|
|
152
|
-
}, [lt]), X = u((e) => {
|
|
153
|
-
if (D(!1), P.current = void 0, e === "edit") Ve(l), ct();
|
|
154
|
-
else {
|
|
155
|
-
st();
|
|
156
|
-
let e = w.trim();
|
|
157
|
-
W((t) => ({
|
|
158
|
-
...t,
|
|
159
|
-
entityType: "organization",
|
|
160
|
-
legalName: e || z?.legalName || t.legalName,
|
|
161
|
-
email: z?.email || t.email,
|
|
162
|
-
phone: z?.phone || t.phone,
|
|
163
|
-
address: z?.address ?? t.address
|
|
164
|
-
})), Ue(B ?? h), N(void 0), M.current = h;
|
|
165
|
-
}
|
|
166
|
-
Le(e);
|
|
167
|
-
}, [
|
|
168
|
-
l,
|
|
169
|
-
B,
|
|
170
|
-
st,
|
|
171
|
-
ct,
|
|
172
|
-
w,
|
|
173
|
-
W,
|
|
174
|
-
z
|
|
175
|
-
]), _t = U.revealErrors, vt = u(() => {
|
|
176
|
-
Xe(!0), X("create"), _t();
|
|
177
|
-
let e = B ? se(B, C) : {};
|
|
178
|
-
Object.keys(e).length && N(e);
|
|
179
|
-
}, [
|
|
180
|
-
B,
|
|
181
|
-
C,
|
|
182
|
-
X,
|
|
183
|
-
_t
|
|
184
|
-
]), yt = p(!1), bt = !yt.current && !y && b && Te && !_ && !R && !Ye && ft, xt = bt && !$e.isLoading;
|
|
185
|
-
ve(() => {
|
|
186
|
-
xt && (yt.current = !0, vt());
|
|
187
|
-
}, [vt, xt]);
|
|
188
|
-
let St = u(() => {
|
|
189
|
-
let e = J ? Se(J) : h;
|
|
190
|
-
M.current = e, Ue(e), N(void 0), k(!0);
|
|
191
|
-
}, [J]), Ct = u((e) => {
|
|
192
|
-
let t = {
|
|
193
|
-
...j.current,
|
|
194
|
-
...e
|
|
195
|
-
};
|
|
196
|
-
j.current = t, Ue(t);
|
|
197
|
-
let ee = se(t, C);
|
|
198
|
-
N((e) => {
|
|
199
|
-
if (!e) return e;
|
|
200
|
-
let t = { ...e };
|
|
201
|
-
for (let e of Object.keys(t)) ee[e] || delete t[e];
|
|
202
|
-
return Object.keys(t).length ? t : void 0;
|
|
203
|
-
});
|
|
204
|
-
}, [C]), wt = u(() => {
|
|
205
|
-
nt ? x(I) : I();
|
|
206
|
-
}, [
|
|
207
|
-
I,
|
|
208
|
-
x,
|
|
209
|
-
nt
|
|
210
|
-
]), Z = u(() => {
|
|
211
|
-
Y(), I();
|
|
212
|
-
}, [I, Y]), Q = He || nt, $ = u((e) => {
|
|
213
|
-
let t = () => {
|
|
214
|
-
Z(), e();
|
|
215
|
-
};
|
|
216
|
-
Q ? x(t) : t();
|
|
217
|
-
}, [
|
|
218
|
-
x,
|
|
219
|
-
Z,
|
|
220
|
-
Q
|
|
221
|
-
]), Tt = u(() => {
|
|
222
|
-
Q ? x(Z) : Z();
|
|
223
|
-
}, [
|
|
224
|
-
x,
|
|
225
|
-
Z,
|
|
226
|
-
Q
|
|
227
|
-
]), Et = u(async ({ closeOnSuccess: t = !0, allowIncompleteVendor: ee = !1 } = {}) => {
|
|
228
|
-
if (ee && E === "create" && !P.current) {
|
|
229
|
-
let e = j.current, t = ce({
|
|
230
|
-
...dt,
|
|
231
|
-
bankAccount: e
|
|
232
|
-
}, "create", C, "vendor");
|
|
233
|
-
if (ae(t)) return He || !g(e, B ?? h) ? {
|
|
234
|
-
ok: !0,
|
|
235
|
-
counterpartRawData: ge(dt, e, v)
|
|
236
|
-
} : { ok: !0 };
|
|
237
|
-
}
|
|
238
|
-
let n = l, r = !1, i = j.current;
|
|
239
|
-
if (!g(i, M.current)) {
|
|
240
|
-
let e = se(i, C);
|
|
241
|
-
if (Object.keys(e).length > 0) return N(e), E !== "create" && k(!0), { ok: !1 };
|
|
242
|
-
}
|
|
243
|
-
if (E === "edit" && ht) return { ok: !1 };
|
|
244
|
-
if (E) {
|
|
245
|
-
if (E === "create" && P.current) n = P.current;
|
|
246
|
-
else {
|
|
247
|
-
let e = await ut();
|
|
248
|
-
if (!e.ok) return { ok: !1 };
|
|
249
|
-
E === "create" ? (n = e.counterpartId, P.current = n) : n = e.counterpartId ?? n;
|
|
250
|
-
}
|
|
251
|
-
E === "create" && (r = !0);
|
|
252
|
-
}
|
|
253
|
-
if (!n) return { ok: !0 };
|
|
254
|
-
let a = H.isBankAccountsLoading || H.isBankAccountsFetching || H.isBankAccountsError;
|
|
255
|
-
if (g(i, M.current)) {
|
|
256
|
-
let e = qe ?? q;
|
|
257
|
-
return e ? (t && (k(!1), E && Y()), r && L(n), {
|
|
258
|
-
ok: !0,
|
|
259
|
-
counterpartId: n,
|
|
260
|
-
counterpartBankAccountId: e
|
|
261
|
-
}) : r ? (t && Y(), L(n), {
|
|
262
|
-
ok: !0,
|
|
263
|
-
counterpartId: n
|
|
264
|
-
}) : a ? { ok: !1 } : (t && (k(!1), E && Y()), {
|
|
265
|
-
ok: !0,
|
|
266
|
-
counterpartId: n,
|
|
267
|
-
counterpartBankAccountId: pt
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
if (a) return { ok: !1 };
|
|
271
|
-
N(void 0);
|
|
272
|
-
let o = oe(H.bankAccounts, qe ?? J?.id), s;
|
|
273
|
-
try {
|
|
274
|
-
o.kind === "update" ? (await ot.mutateAsync({
|
|
275
|
-
path: {
|
|
276
|
-
counterpart_id: n,
|
|
277
|
-
bank_account_id: o.bankAccountId
|
|
278
|
-
},
|
|
279
|
-
body: ne(i, { includeAchDefaults: o.includeAchDefaults })
|
|
280
|
-
}), s = o.bankAccountId) : s = (await at.mutateAsync({
|
|
281
|
-
path: { counterpart_id: n },
|
|
282
|
-
body: te(i, { isDefaultForCurrency: o.isDefaultForCurrency })
|
|
283
|
-
}))?.id;
|
|
284
|
-
} catch {
|
|
285
|
-
return e.error(S.bankAccountSaveFailed), {
|
|
286
|
-
ok: !1,
|
|
287
|
-
counterpartId: n
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
return M.current = i, Ke(s ? {
|
|
291
|
-
counterpartId: n,
|
|
292
|
-
bankAccountId: s
|
|
293
|
-
} : void 0), t && (k(!1), E && Y()), r && L(n), {
|
|
294
|
-
ok: !0,
|
|
295
|
-
counterpartId: n,
|
|
296
|
-
counterpartBankAccountId: s
|
|
297
|
-
};
|
|
298
|
-
}, [
|
|
299
|
-
Y,
|
|
300
|
-
l,
|
|
301
|
-
at,
|
|
302
|
-
H.bankAccounts,
|
|
303
|
-
H.isBankAccountsError,
|
|
304
|
-
H.isBankAccountsFetching,
|
|
305
|
-
H.isBankAccountsLoading,
|
|
306
|
-
B,
|
|
307
|
-
v,
|
|
308
|
-
E,
|
|
309
|
-
dt,
|
|
310
|
-
He,
|
|
311
|
-
ht,
|
|
312
|
-
q,
|
|
313
|
-
C,
|
|
314
|
-
pt,
|
|
315
|
-
L,
|
|
316
|
-
J,
|
|
317
|
-
ut,
|
|
318
|
-
ot,
|
|
319
|
-
qe
|
|
320
|
-
]), Dt = u((e) => {
|
|
321
|
-
if (F.current) return F.current;
|
|
322
|
-
let t = (async () => {
|
|
323
|
-
Qe(!0);
|
|
324
|
-
try {
|
|
325
|
-
return await Et(e);
|
|
326
|
-
} finally {
|
|
327
|
-
F.current = void 0, Qe(!1);
|
|
158
|
+
var S = {
|
|
159
|
+
createTitle: "New vendor details",
|
|
160
|
+
editTitle: "Edit vendor",
|
|
161
|
+
switchVendorFieldLabel: "Switch to a different vendor",
|
|
162
|
+
vendorFieldLabel: "Vendor",
|
|
163
|
+
newVendorBadge: "New vendor",
|
|
164
|
+
unmatchedVendorHelper: "We couldn't match this vendor to your list. Search to choose an existing vendor, or finish adding a new one below.",
|
|
165
|
+
resultsHeading: "Your vendors",
|
|
166
|
+
addAsNewVendor: (e) => `Add "${e}" as a new vendor`,
|
|
167
|
+
addAsNewVendorDescription: "Uses the details extracted from this bill",
|
|
168
|
+
fieldsNeedAttention: (e) => `${e} ${e === 1 ? "field needs" : "fields need"} attention`,
|
|
169
|
+
nameLabel: "Business name",
|
|
170
|
+
cancel: "Cancel",
|
|
171
|
+
save: "Save",
|
|
172
|
+
cancelAriaLabel: "Cancel vendor",
|
|
173
|
+
saveAriaLabel: "Save vendor",
|
|
174
|
+
paymentInstructionsHeading: "Payment instructions",
|
|
175
|
+
paymentInstructionsDescription: "How and where will the money be sent. This information is required to send a payment.",
|
|
176
|
+
paymentInstructionsExtracted: "We read these from the bill. Check them before saving.",
|
|
177
|
+
ach: f
|
|
178
|
+
};
|
|
179
|
+
function C(e) {
|
|
180
|
+
return {
|
|
181
|
+
...S,
|
|
182
|
+
...e,
|
|
183
|
+
ach: {
|
|
184
|
+
...S.ach,
|
|
185
|
+
...e?.ach,
|
|
186
|
+
fieldMarkers: {
|
|
187
|
+
...S.ach.fieldMarkers,
|
|
188
|
+
...e?.ach?.fieldMarkers
|
|
328
189
|
}
|
|
329
|
-
})();
|
|
330
|
-
return F.current = t, t;
|
|
331
|
-
}, [Et]), Ot = u(() => {
|
|
332
|
-
k(!1), E && Y();
|
|
333
|
-
}, [E, Y]), kt = f(() => (V.data?.data ?? []).map((e) => ({
|
|
334
|
-
name: re(e),
|
|
335
|
-
email: c(e),
|
|
336
|
-
onSelect: () => {
|
|
337
|
-
$(() => L(e.id));
|
|
338
190
|
}
|
|
339
|
-
})), [
|
|
340
|
-
V.data,
|
|
341
|
-
$,
|
|
342
|
-
L
|
|
343
|
-
]), At = u((e) => {
|
|
344
|
-
D(!0), W((t) => e.entityType === "individual" && t.entityType !== "individual" ? {
|
|
345
|
-
...t,
|
|
346
|
-
...e,
|
|
347
|
-
firstName: t.firstName || t.legalName,
|
|
348
|
-
legalName: t.legalName
|
|
349
|
-
} : e.entityType === "organization" && t.entityType !== "organization" ? {
|
|
350
|
-
...t,
|
|
351
|
-
...e,
|
|
352
|
-
legalName: t.legalName || [t.firstName, t.lastName].filter(Boolean).join(" ")
|
|
353
|
-
} : {
|
|
354
|
-
...t,
|
|
355
|
-
...e
|
|
356
|
-
});
|
|
357
|
-
}, [W]), jt = u((e) => {
|
|
358
|
-
D(!0), W((t) => ({
|
|
359
|
-
...t,
|
|
360
|
-
address: {
|
|
361
|
-
...t.address,
|
|
362
|
-
...e
|
|
363
|
-
}
|
|
364
|
-
}));
|
|
365
|
-
}, [W]), Mt = {
|
|
366
|
-
query: w,
|
|
367
|
-
onQueryChange: Pe,
|
|
368
|
-
isLoading: bt || !Te || !Me || !!l && H.isLoading || V.isLoading || V.isFetching && it,
|
|
369
|
-
onAddVendor: () => {
|
|
370
|
-
if (E === "create") {
|
|
371
|
-
let e = w.trim(), [t, ...ee] = e.split(/\s+/);
|
|
372
|
-
W((n) => n.entityType === "individual" ? {
|
|
373
|
-
...n,
|
|
374
|
-
firstName: t,
|
|
375
|
-
lastName: ee.join(" ")
|
|
376
|
-
} : {
|
|
377
|
-
...n,
|
|
378
|
-
legalName: e
|
|
379
|
-
}), D(!0);
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
$(() => X("create"));
|
|
383
|
-
},
|
|
384
|
-
results: kt
|
|
385
|
-
}, Nt = ke && (E === "create" || !mt) ? {
|
|
386
|
-
isOpen: O,
|
|
387
|
-
values: A,
|
|
388
|
-
errors: We,
|
|
389
|
-
onOpen: St,
|
|
390
|
-
onCancel: wt,
|
|
391
|
-
onChange: Ct
|
|
392
|
-
} : void 0, Pt = E !== "create" && Nt ? {
|
|
393
|
-
...Nt,
|
|
394
|
-
onOpen: E === "edit" ? () => $(St) : Nt.onOpen,
|
|
395
|
-
canEditExisting: Oe
|
|
396
|
-
} : void 0, Ft = U.isSubmitting || at.isPending || ot.isPending, It = {
|
|
397
|
-
prepareVendorForSave: Dt,
|
|
398
|
-
isVendorSavePending: Ze || Ft,
|
|
399
|
-
hasUnsavedVendorChanges: Q,
|
|
400
|
-
isPendingVendor: !!K && !ft,
|
|
401
|
-
revealIncompleteVendor: ft ? vt : void 0,
|
|
402
|
-
isEditingPayTo: !!E || O,
|
|
403
|
-
activePayToOperation: E ? "vendor" : O ? G?.hasPaymentInstructions ? "existingInstructions" : "missingInstructions" : void 0,
|
|
404
|
-
discardPayToEdits: Z,
|
|
405
|
-
finalizePayToSave: Ot,
|
|
406
|
-
openPaymentInstructions: St,
|
|
407
|
-
paymentInstructions: a(Pt, !!G?.hasPaymentInstructions),
|
|
408
|
-
paymentInstructionsEditor: Pt,
|
|
409
|
-
detailsWarning: gt
|
|
410
|
-
}, Lt = E === "create" && ke ? {
|
|
411
|
-
values: A,
|
|
412
|
-
errors: We,
|
|
413
|
-
onChange: Ct,
|
|
414
|
-
isExtracted: !!(B && g(A, B))
|
|
415
|
-
} : void 0;
|
|
416
|
-
if (E) return {
|
|
417
|
-
mode: "creating",
|
|
418
|
-
summary: G,
|
|
419
|
-
newVendorForm: /* @__PURE__ */ ye(_e, {
|
|
420
|
-
mode: E,
|
|
421
|
-
values: U.values,
|
|
422
|
-
errors: U.errors,
|
|
423
|
-
onChange: At,
|
|
424
|
-
onAddressChange: jt,
|
|
425
|
-
sectionsToExpand: U.sectionsToExpand,
|
|
426
|
-
onAddressExpand: U.expandAddress,
|
|
427
|
-
onCancel: Tt,
|
|
428
|
-
onSave: Dt,
|
|
429
|
-
isSaving: Ft,
|
|
430
|
-
search: rt ? Mt : void 0,
|
|
431
|
-
paymentInstructions: Lt,
|
|
432
|
-
labels: Ae?.inlineForm
|
|
433
|
-
}),
|
|
434
|
-
...It
|
|
435
|
-
};
|
|
436
|
-
if (G) return {
|
|
437
|
-
mode: "resolved",
|
|
438
|
-
summary: G,
|
|
439
|
-
onEdit: b && !ht ? () => $(() => X("edit")) : void 0,
|
|
440
|
-
...It
|
|
441
|
-
};
|
|
442
|
-
if (K && !bt) {
|
|
443
|
-
let e = () => $(() => {
|
|
444
|
-
Xe(!0), X("create");
|
|
445
|
-
}), t = b && ke ? {
|
|
446
|
-
isOpen: !1,
|
|
447
|
-
values: A,
|
|
448
|
-
errors: We,
|
|
449
|
-
onOpen: e,
|
|
450
|
-
onChange: Ct,
|
|
451
|
-
onCancel: wt,
|
|
452
|
-
canEditExisting: !0
|
|
453
|
-
} : void 0;
|
|
454
|
-
return {
|
|
455
|
-
mode: "resolved",
|
|
456
|
-
summary: K,
|
|
457
|
-
onEdit: b ? e : void 0,
|
|
458
|
-
error: De,
|
|
459
|
-
...It,
|
|
460
|
-
showPaymentInstructions: !0,
|
|
461
|
-
paymentInstructions: a(t, K.hasPaymentInstructions),
|
|
462
|
-
paymentInstructionsEditor: t
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
return {
|
|
466
|
-
mode: "selecting",
|
|
467
|
-
error: V.isError ? S.searchFailed : H.isError ? S.vendorDetailsFailed : De,
|
|
468
|
-
search: Mt,
|
|
469
|
-
...It
|
|
470
191
|
};
|
|
471
192
|
}
|
|
472
193
|
//#endregion
|
|
473
|
-
export { _ as
|
|
194
|
+
export { g as BILL_CREATE_MESSAGE_LABELS_EN, y as BILL_DETAIL_VIEW_LABELS_EN, b as BILL_DIALOG_COPY_EN, v as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, S as VENDOR_INLINE_FORM_LABELS_EN, _ as VENDOR_SECTION_PROPS_LABELS_EN, x as mergeBillDialogCopy, C as mergeVendorInlineFormLabels };
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
import { BanIcon as e, Trash2Icon as t } from "lucide-react";
|
|
1
2
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
function n(n, r) {
|
|
4
|
+
return {
|
|
5
|
+
title: n.title,
|
|
6
|
+
description: n.description,
|
|
7
|
+
confirmButton: n.confirmButton,
|
|
8
|
+
presentation: {
|
|
9
|
+
alignment: "center",
|
|
10
|
+
icon: r === "delete" ? t : e,
|
|
11
|
+
tone: r === "confirm" ? "default" : "destructive",
|
|
12
|
+
actionWidth: "equal"
|
|
13
|
+
}
|
|
14
|
+
};
|
|
5
15
|
}
|
|
6
16
|
//#endregion
|
|
7
|
-
export {
|
|
17
|
+
export { n as duplicateRemovalPrompt };
|