@tesouro/embedded-components-react 0.2.327 → 0.2.329
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/index.css +3 -0
- package/dist/index.d.ts +59 -59
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +119 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +50 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +39 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +17 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +45 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +4 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +9 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +42 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +25 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +49 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +91 -63
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +20 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +52 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +5 -35
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +67 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +46 -53
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +80 -205
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +32 -192
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +117 -62
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +54 -45
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +205 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +184 -143
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +63 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +46 -100
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +32 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +146 -182
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +38 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +102 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +10 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +200 -78
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +27 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +78 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +132 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +3 -53
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +2 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +43 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +50 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +8 -145
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +18 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +78 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +138 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +85 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +2 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +115 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +33 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +13 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +58 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +2 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +22 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +23 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +1 -262
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +15 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +23 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +2 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +41 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +271 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +2 -286
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +9 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +47 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +2 -120
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +22 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +284 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +2 -96
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +16 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +118 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +1 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +10 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +93 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +1 -138
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +12 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +56 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +2 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +53 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +137 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +2 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +7 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +42 -59
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +2 -238
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +2 -202
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +61 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +2 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +2 -91
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +16 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +67 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +248 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +204 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +6 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +6 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +93 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +1 -105
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +7 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +28 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +2 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +4 -167
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +34 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +2 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +10 -87
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +105 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +18 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +170 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +14 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +89 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js +20 -20
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +21 -21
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +142 -102
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +0 -12
|
@@ -1,68 +1,123 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import "../../../shared/ui/dist/index.js";
|
|
7
|
-
import { useUpdatePayableMutation as t } from "../../data-access/dist/index10.js";
|
|
8
|
-
import "../../data-access/dist/index.js";
|
|
9
|
-
import { counterpartFormBankAccountToCreatePayload as n, validateAchFormValues as r } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
10
|
-
import { useCreateCounterpartBankAccountMutation as i } from "../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
11
|
-
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
12
|
-
import { useCallback as a, useRef as o, useState as s } from "react";
|
|
1
|
+
import { PAY_BILL_FLOW_LABELS_EN as e, mergePayBillFlowLabels as t } from "./index7.js";
|
|
2
|
+
import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index12.js";
|
|
3
|
+
import { BILL_DETAIL_ACTIONS_LABELS_EN as r, SCHEDULED_SUMMARY_LABEL_EN as i, mergeBillDetailActionsLabels as a } from "./index24.js";
|
|
4
|
+
import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as o } from "./index25.js";
|
|
13
5
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
var s = {
|
|
7
|
+
unmappedValidationError: (e, t) => `${e}: ${t}`,
|
|
8
|
+
unknownValidationField: "(unknown field)",
|
|
9
|
+
requiredField: "This field is required.",
|
|
10
|
+
saveFailed: "We could not save this bill. Try again.",
|
|
11
|
+
finalizeFailed: "We could not submit this bill. Try again.",
|
|
12
|
+
draftSaved: "Bill saved as a draft.",
|
|
13
|
+
billFinalized: "Bill submitted for approval.",
|
|
14
|
+
unreadableMoney: "Enter a valid amount.",
|
|
15
|
+
unusableQuantity: "Enter a quantity greater than 0.",
|
|
16
|
+
lineItemsNeedAttention: "Check the highlighted line items before saving.",
|
|
17
|
+
totalsNeedAttention: "Enter valid amounts for discount, tax, and total."
|
|
18
|
+
}, c = {
|
|
19
|
+
achMethod: "via ACH bank transfer",
|
|
20
|
+
noMethod: "No payment method on file",
|
|
21
|
+
accountHolder: "Account holder",
|
|
22
|
+
routingNumber: "Routing number",
|
|
23
|
+
accountNumber: "Account number",
|
|
24
|
+
paymentMethodLoading: "Loading payment method...",
|
|
25
|
+
paymentMethodUnavailable: "We could not load payment methods. Try again.",
|
|
26
|
+
searchFailed: "We could not load vendors. Try again.",
|
|
27
|
+
vendorDetailsFailed: "We could not load this vendor. Try again."
|
|
28
|
+
}, l = {
|
|
29
|
+
attachFailed: "We could not attach that file. Try again.",
|
|
30
|
+
saveBeforeAttaching: "Save this bill before attaching a document.",
|
|
31
|
+
noDocument: "No document attached to this bill.",
|
|
32
|
+
preview: o
|
|
33
|
+
}, u = {
|
|
34
|
+
notProvided: "Not provided",
|
|
35
|
+
paymentInstructionsValue: (e) => `Account ending in ${e}`,
|
|
36
|
+
invoiceDateRow: "Invoice date",
|
|
37
|
+
dueDateRow: "Due date",
|
|
38
|
+
invoiceNumberRow: "Invoice number",
|
|
39
|
+
glCodeMissing: "GL code not specified",
|
|
40
|
+
qtyPriceValue: (e, t) => `${e} x ${t}`,
|
|
41
|
+
subtotalRow: "Subtotal",
|
|
42
|
+
taxRow: "Tax",
|
|
43
|
+
discountRow: "Discounts",
|
|
44
|
+
totalRow: "Total",
|
|
45
|
+
paymentInstructionsSaveError: "Couldn't save payment instructions. Try again."
|
|
46
|
+
}, d = {
|
|
47
|
+
dateLabel: (e) => new Date(e).toLocaleString("en-US", {
|
|
48
|
+
month: "short",
|
|
49
|
+
day: "numeric",
|
|
50
|
+
year: "numeric",
|
|
51
|
+
hour: "numeric",
|
|
52
|
+
minute: "2-digit"
|
|
53
|
+
}),
|
|
54
|
+
byActor: (e, t) => `${e} by ${t}`,
|
|
55
|
+
billAdded: "Bill added",
|
|
56
|
+
billUploaded: "Bill uploaded",
|
|
57
|
+
billUpdated: "Bill updated",
|
|
58
|
+
attachmentAdded: "Attachment added",
|
|
59
|
+
submittedForApproval: "Submitted for approval",
|
|
60
|
+
approvalRequested: "Approval requested",
|
|
61
|
+
approved: "Approved",
|
|
62
|
+
autoApproved: "Approved automatically",
|
|
63
|
+
rejected: "Rejected",
|
|
64
|
+
rejectedWithReason: (e) => `Rejected: ${e}`,
|
|
65
|
+
reopened: "Reopened",
|
|
66
|
+
markedAsPaid: "Marked as paid",
|
|
67
|
+
markedAsPartiallyPaid: "Marked as partially paid",
|
|
68
|
+
paymentReverted: "Payment reverted",
|
|
69
|
+
statusChanged: (e) => `Status changed to ${e}`
|
|
70
|
+
}, f = {
|
|
71
|
+
newTitle: "New bill",
|
|
72
|
+
extractedTitle: (e) => `Bill from ${e}`,
|
|
73
|
+
viewTitle: (e) => `Bill from ${e}`,
|
|
74
|
+
readOnlyTitle: "Bill details",
|
|
75
|
+
addedOn: (e) => `Added on ${e}`,
|
|
76
|
+
discardConfirm: "Discard your changes to this bill?",
|
|
77
|
+
scheduledSummary: i,
|
|
78
|
+
actions: r,
|
|
79
|
+
detail: u,
|
|
80
|
+
history: d,
|
|
81
|
+
payBill: e,
|
|
82
|
+
approvalPolicyCopy: n
|
|
18
83
|
};
|
|
19
|
-
function
|
|
20
|
-
let [f, p] = s(!1), [m, h] = s(c), [g, _] = s(), v = i(), y = t(), b = o(void 0), x = a(() => {
|
|
21
|
-
h(c), _(void 0), b.current = void 0, p(!0);
|
|
22
|
-
}, []), S = a(() => {
|
|
23
|
-
p(!1);
|
|
24
|
-
}, []), C = a((e) => {
|
|
25
|
-
h((t) => ({
|
|
26
|
-
...t,
|
|
27
|
-
...e
|
|
28
|
-
}));
|
|
29
|
-
}, []), w = a(async () => {
|
|
30
|
-
if (!l || !u) return !1;
|
|
31
|
-
let t = r(m);
|
|
32
|
-
if (Object.keys(t).length > 0) return _(t), !1;
|
|
33
|
-
try {
|
|
34
|
-
if (!b.current) {
|
|
35
|
-
let e = await v.mutateAsync({
|
|
36
|
-
path: { counterpart_id: u },
|
|
37
|
-
body: n(m)
|
|
38
|
-
});
|
|
39
|
-
b.current = e.id;
|
|
40
|
-
}
|
|
41
|
-
return await y.mutateAsync({
|
|
42
|
-
path: { payable_id: l },
|
|
43
|
-
body: { counterpart_bank_account_id: b.current }
|
|
44
|
-
}), b.current = void 0, p(!1), !0;
|
|
45
|
-
} catch {
|
|
46
|
-
return e.error(d), !1;
|
|
47
|
-
}
|
|
48
|
-
}, [
|
|
49
|
-
u,
|
|
50
|
-
v,
|
|
51
|
-
l,
|
|
52
|
-
d,
|
|
53
|
-
y,
|
|
54
|
-
m
|
|
55
|
-
]);
|
|
84
|
+
function p(e) {
|
|
56
85
|
return {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
86
|
+
...f,
|
|
87
|
+
...e,
|
|
88
|
+
actions: a(e?.actions),
|
|
89
|
+
detail: {
|
|
90
|
+
...f.detail,
|
|
91
|
+
...e?.detail
|
|
92
|
+
},
|
|
93
|
+
history: {
|
|
94
|
+
...f.history,
|
|
95
|
+
...e?.history
|
|
96
|
+
},
|
|
97
|
+
payBill: t(e?.payBill),
|
|
98
|
+
approvalPolicyCopy: {
|
|
99
|
+
...f.approvalPolicyCopy,
|
|
100
|
+
...e?.approvalPolicyCopy
|
|
101
|
+
}
|
|
65
102
|
};
|
|
66
103
|
}
|
|
104
|
+
var m = {
|
|
105
|
+
createTitle: "New vendor",
|
|
106
|
+
editTitle: "Edit vendor",
|
|
107
|
+
close: "Close the vendor form",
|
|
108
|
+
nameLabel: "Name",
|
|
109
|
+
addAddress: "Add address (optional)",
|
|
110
|
+
paymentMethodsHeading: "Accepted payment methods",
|
|
111
|
+
paymentMethodsDescription: "How and where will the money be sent. Don't have these yet? No problem. You can save this vendor and add their payment details later — you just won't be able to send payments until you do.",
|
|
112
|
+
achTitle: "ACH bank transfer",
|
|
113
|
+
achDescription: "Fast, direct deposit to the vendor's bank. Arrives in 1–3 business days.",
|
|
114
|
+
addBankAccount: "Add bank account",
|
|
115
|
+
accountHolderNameLabel: "Account holder name",
|
|
116
|
+
routingNumberLabel: "Routing number",
|
|
117
|
+
accountNumberLabel: "Account number",
|
|
118
|
+
achHelp: "Ask your vendor for this — it's usually on their invoice, W-9, or a payment instructions email they send you.",
|
|
119
|
+
cancel: "Cancel",
|
|
120
|
+
save: "Save vendor"
|
|
121
|
+
};
|
|
67
122
|
//#endregion
|
|
68
|
-
export { l as
|
|
123
|
+
export { s as BILL_CREATE_MESSAGE_LABELS_EN, f as BILL_CREATE_SCREEN_LABELS_EN, u as BILL_DETAIL_VIEW_LABELS_EN, d as BILL_HISTORY_LABELS_EN, l as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, m as VENDOR_INLINE_FORM_LABELS_EN, c as VENDOR_SECTION_PROPS_LABELS_EN, p as mergeBillCreateScreenCopy };
|
|
@@ -1,50 +1,59 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { SourceDocumentPanel as e } from "../../ui/dist/index73.js";
|
|
6
|
+
import "../../ui/dist/index.js";
|
|
7
|
+
import { useAttachPayableFileMutation as t, useDeletePayableFileMutation as n } from "../../data-access/dist/index10.js";
|
|
2
8
|
import "../../data-access/dist/index.js";
|
|
9
|
+
import { createSourceDocumentPreview as r } from "./index25.js";
|
|
10
|
+
import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as i } from "./index26.js";
|
|
11
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
12
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return (e
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
13
|
+
function o({ payableId: o, file: s, isDocumentPending: c, pendingFileName: l, readOnly: u, labels: d }) {
|
|
14
|
+
let f = {
|
|
15
|
+
...i,
|
|
16
|
+
...d,
|
|
17
|
+
preview: {
|
|
18
|
+
...i.preview,
|
|
19
|
+
...d?.preview
|
|
20
|
+
}
|
|
21
|
+
}, p = t(), m = n();
|
|
22
|
+
if (!s && (c || p.isPending)) return /* @__PURE__ */ a(e, {
|
|
23
|
+
mode: "loading",
|
|
24
|
+
fileName: l
|
|
25
|
+
});
|
|
26
|
+
if (!s && u) return /* @__PURE__ */ a("div", {
|
|
27
|
+
className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
|
|
28
|
+
children: f.noDocument
|
|
29
|
+
});
|
|
30
|
+
if (!s && !o) return /* @__PURE__ */ a("div", {
|
|
31
|
+
className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
|
|
32
|
+
children: f.saveBeforeAttaching
|
|
33
|
+
});
|
|
34
|
+
if (!s) return /* @__PURE__ */ a(e, {
|
|
35
|
+
mode: "upload",
|
|
36
|
+
uploadStatus: p.isPending ? "uploading" : "idle",
|
|
37
|
+
uploadErrorMessage: p.isError ? f.attachFailed : void 0,
|
|
38
|
+
onFilesSelected: (e) => {
|
|
39
|
+
let [t] = e;
|
|
40
|
+
!t || !o || p.mutate({
|
|
41
|
+
path: { payable_id: o },
|
|
42
|
+
file: t
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
let h = r(s, f.preview);
|
|
47
|
+
return /* @__PURE__ */ a(e, {
|
|
48
|
+
mode: "document",
|
|
49
|
+
fileName: s.name,
|
|
50
|
+
preview: h,
|
|
51
|
+
onDownload: () => window.open(s.url, "_blank", "noopener,noreferrer"),
|
|
52
|
+
onDelete: o && !u ? () => m.mutate({
|
|
53
|
+
path: { file_id: s.id },
|
|
54
|
+
payableId: o
|
|
55
|
+
}) : void 0
|
|
41
56
|
});
|
|
42
|
-
}
|
|
43
|
-
function u(e, t) {
|
|
44
|
-
return s(Math.round(o(e) * a(t)));
|
|
45
|
-
}
|
|
46
|
-
function d(e, t, n) {
|
|
47
|
-
return s(e.reduce((e, t) => e + a(t.amount), 0) + a(t) - a(n));
|
|
48
57
|
}
|
|
49
58
|
//#endregion
|
|
50
|
-
export {
|
|
59
|
+
export { o as SourceDocumentContainer, o as default };
|
|
@@ -1,34 +1,208 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { getStateOptions as t } from "../../../shared/util/dist/lib/usStates.js";
|
|
7
|
+
import { AchFieldGroup as n } from "../../../shared/counterpart-management/ui/dist/index5.js";
|
|
8
|
+
import { CounterpartFormFields as r, useFocusFirstInvalidField as i } from "../../../shared/counterpart-management/ui/dist/index9.js";
|
|
9
|
+
import { VENDOR_INLINE_FORM_LABELS_EN as a } from "./index26.js";
|
|
10
|
+
import { COUNTERPART_MESSAGE_LABELS_EN as o } from "../../../shared/counterpart-management/feature/dist/lib/labels.js";
|
|
11
|
+
import { useCounterpartForm as s } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
|
|
12
|
+
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
13
|
+
import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
14
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
15
|
+
import { Landmark as g, Plus as _, X as v } from "lucide-react";
|
|
3
16
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
function y({ mode: y, counterpart: b, primaryAddress: x, bankAccounts: S, isBankAccountsLoading: C, isBankAccountsError: w, initialName: T, onSaved: E, onCancel: D, onDirtyChange: O, labels: k }) {
|
|
18
|
+
let A = {
|
|
19
|
+
...a,
|
|
20
|
+
...k
|
|
21
|
+
}, [j, M] = f("none"), [N, P] = f(b?.id), [F, I] = f(!1), [L, R] = f(!1);
|
|
22
|
+
l(() => {
|
|
23
|
+
O?.(L);
|
|
24
|
+
}, [L, O]);
|
|
25
|
+
let z = u(() => t(), []), B = d(j), V = d(!1), H = s({
|
|
26
|
+
view: j,
|
|
27
|
+
setView: M,
|
|
28
|
+
selectedId: N,
|
|
29
|
+
setSelectedId: P,
|
|
30
|
+
messages: o,
|
|
31
|
+
counterpartType: "vendor",
|
|
32
|
+
counterpart: b,
|
|
33
|
+
primaryAddress: x,
|
|
34
|
+
bankAccounts: S,
|
|
35
|
+
isBankAccountsLoading: C,
|
|
36
|
+
isBankAccountsError: w
|
|
37
|
+
}), { openCreate: U, openEdit: W, setValues: G } = H, K = i(H.errors);
|
|
38
|
+
l(() => {
|
|
39
|
+
y === "edit" ? W() : U();
|
|
40
|
+
}, [
|
|
41
|
+
y,
|
|
42
|
+
U,
|
|
43
|
+
W
|
|
44
|
+
]), l(() => {
|
|
45
|
+
B.current !== "none" && j === "none" && N && E(N), B.current = j;
|
|
46
|
+
}, [
|
|
47
|
+
j,
|
|
48
|
+
N,
|
|
49
|
+
E
|
|
50
|
+
]), l(() => {
|
|
51
|
+
y !== "create" || V.current || (V.current = !0, G((e) => ({
|
|
52
|
+
...e,
|
|
53
|
+
entityType: "organization",
|
|
54
|
+
legalName: T?.trim() || e.legalName
|
|
55
|
+
})));
|
|
56
|
+
}, [
|
|
57
|
+
y,
|
|
58
|
+
T,
|
|
59
|
+
G
|
|
60
|
+
]), l(() => {
|
|
61
|
+
y === "edit" && (H.values.bankAccount.routingNumber || H.values.bankAccount.accountNumber) && I(!0);
|
|
62
|
+
}, [
|
|
63
|
+
y,
|
|
64
|
+
H.values.bankAccount.accountNumber,
|
|
65
|
+
H.values.bankAccount.routingNumber
|
|
66
|
+
]), l(() => {
|
|
67
|
+
H.sectionsToExpand.bankAccount && I(!0);
|
|
68
|
+
}, [H.sectionsToExpand.bankAccount]);
|
|
69
|
+
let q = c((e) => {
|
|
70
|
+
R(!0), G((t) => e.entityType === "individual" && t.entityType !== "individual" ? {
|
|
71
|
+
...t,
|
|
72
|
+
...e,
|
|
73
|
+
firstName: t.firstName || t.legalName,
|
|
74
|
+
legalName: t.legalName
|
|
75
|
+
} : e.entityType === "organization" && t.entityType !== "organization" ? {
|
|
76
|
+
...t,
|
|
77
|
+
...e,
|
|
78
|
+
legalName: t.legalName || [t.firstName, t.lastName].filter(Boolean).join(" ")
|
|
79
|
+
} : {
|
|
80
|
+
...t,
|
|
81
|
+
...e
|
|
82
|
+
});
|
|
83
|
+
}, [G]);
|
|
84
|
+
return /* @__PURE__ */ h("div", {
|
|
85
|
+
ref: K,
|
|
86
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ h("div", {
|
|
89
|
+
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-2",
|
|
90
|
+
children: [/* @__PURE__ */ m("p", {
|
|
91
|
+
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
92
|
+
children: y === "edit" ? A.editTitle : A.createTitle
|
|
93
|
+
}), /* @__PURE__ */ m(e, {
|
|
94
|
+
type: "button",
|
|
95
|
+
variant: "ghost",
|
|
96
|
+
size: "icon",
|
|
97
|
+
"aria-label": A.close,
|
|
98
|
+
onClick: D,
|
|
99
|
+
children: /* @__PURE__ */ m(v, { className: "ttw:size-4" })
|
|
100
|
+
})]
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ m(r, {
|
|
103
|
+
mode: y,
|
|
104
|
+
counterpartMode: "vendor",
|
|
105
|
+
values: H.values,
|
|
106
|
+
errors: H.errors,
|
|
107
|
+
stateOptions: z,
|
|
108
|
+
onChange: q,
|
|
109
|
+
onAddressChange: (e) => {
|
|
110
|
+
R(!0), G((t) => ({
|
|
111
|
+
...t,
|
|
112
|
+
address: {
|
|
113
|
+
...t.address,
|
|
114
|
+
...e
|
|
115
|
+
}
|
|
116
|
+
}));
|
|
117
|
+
},
|
|
118
|
+
sections: {
|
|
119
|
+
entityType: !0,
|
|
120
|
+
profileHeading: !1,
|
|
121
|
+
title: !1,
|
|
122
|
+
taxId: !1,
|
|
123
|
+
address: "collapsible",
|
|
124
|
+
bankAccount: !1
|
|
125
|
+
},
|
|
126
|
+
sectionsToExpand: H.sectionsToExpand,
|
|
127
|
+
onAddressExpand: H.expandAddress,
|
|
128
|
+
labels: { businessNameLabel: A.nameLabel }
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ h("div", {
|
|
131
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
132
|
+
children: [/* @__PURE__ */ m("p", {
|
|
133
|
+
className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
|
|
134
|
+
children: A.paymentMethodsHeading
|
|
135
|
+
}), /* @__PURE__ */ m("p", {
|
|
136
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
137
|
+
children: A.paymentMethodsDescription
|
|
138
|
+
})]
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ h("div", {
|
|
141
|
+
className: "ttw:flex ttw:gap-3 ttw:rounded-lg ttw:border ttw:border-border ttw:p-3",
|
|
142
|
+
children: [/* @__PURE__ */ m("span", {
|
|
143
|
+
className: "ttw:flex ttw:size-8 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-md ttw:bg-primary",
|
|
144
|
+
children: /* @__PURE__ */ m(g, {
|
|
145
|
+
"aria-hidden": !0,
|
|
146
|
+
className: "ttw:size-4 ttw:text-white"
|
|
147
|
+
})
|
|
148
|
+
}), /* @__PURE__ */ h("div", {
|
|
149
|
+
className: "ttw:flex ttw:flex-1 ttw:flex-col ttw:gap-3",
|
|
150
|
+
children: [/* @__PURE__ */ h("div", {
|
|
151
|
+
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
152
|
+
children: [/* @__PURE__ */ m("p", {
|
|
153
|
+
className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
|
|
154
|
+
children: A.achTitle
|
|
155
|
+
}), /* @__PURE__ */ m("p", {
|
|
156
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
157
|
+
children: A.achDescription
|
|
158
|
+
})]
|
|
159
|
+
}), F ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(n, {
|
|
160
|
+
idPrefix: "vendor-inline-ach",
|
|
161
|
+
values: H.values.bankAccount,
|
|
162
|
+
errors: H.errors?.bankAccount,
|
|
163
|
+
onChange: (e) => {
|
|
164
|
+
R(!0), G((t) => ({
|
|
165
|
+
...t,
|
|
166
|
+
bankAccount: {
|
|
167
|
+
...t.bankAccount,
|
|
168
|
+
...e
|
|
169
|
+
}
|
|
170
|
+
}));
|
|
171
|
+
},
|
|
172
|
+
labels: {
|
|
173
|
+
accountHolderName: A.accountHolderNameLabel,
|
|
174
|
+
routingNumber: A.routingNumberLabel,
|
|
175
|
+
accountNumber: A.accountNumberLabel
|
|
176
|
+
}
|
|
177
|
+
}), /* @__PURE__ */ m("p", {
|
|
178
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
179
|
+
children: A.achHelp
|
|
180
|
+
})] }) : /* @__PURE__ */ h(e, {
|
|
181
|
+
type: "button",
|
|
182
|
+
variant: "link",
|
|
183
|
+
className: "ttw:w-fit ttw:px-0",
|
|
184
|
+
onClick: () => I(!0),
|
|
185
|
+
children: [/* @__PURE__ */ m(_, { className: "ttw:size-4" }), A.addBankAccount]
|
|
186
|
+
})]
|
|
187
|
+
})]
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ h("div", {
|
|
190
|
+
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
191
|
+
children: [/* @__PURE__ */ m(e, {
|
|
192
|
+
type: "button",
|
|
193
|
+
variant: "outline",
|
|
194
|
+
onClick: D,
|
|
195
|
+
children: A.cancel
|
|
196
|
+
}), /* @__PURE__ */ m(e, {
|
|
197
|
+
type: "button",
|
|
198
|
+
onClick: H.submit,
|
|
199
|
+
loading: H.isSubmitting,
|
|
200
|
+
disabled: H.isSubmitting,
|
|
201
|
+
children: A.save
|
|
202
|
+
})]
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
});
|
|
32
206
|
}
|
|
33
207
|
//#endregion
|
|
34
|
-
export {
|
|
208
|
+
export { y as VendorInlineForm, y as default };
|