@tesouro/embedded-components-react 0.5.210 → 0.5.212
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.d.ts +16 -0
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +16 -0
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +113 -109
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +416 -132
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +113 -211
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +154 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +193 -135
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +32 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +150 -58
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +35 -89
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +58 -116
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +96 -47
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +103 -347
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +364 -64
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +66 -106
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +105 -275
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +288 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +76 -61
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +48 -422
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +38 -62
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +61 -391
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +457 -89
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +91 -234
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +234 -78
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +80 -331
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +344 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js
CHANGED
|
@@ -2,100 +2,46 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "../../../shared/ui/dist/index.js";
|
|
8
|
-
import { useWidgetConfig as n } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
9
|
-
import "../../../shared/feature/dist/index.js";
|
|
10
|
-
import { useCreateEntityBankAccountMutation as r, usePaymentAccountsQuery as i } from "../../data-access/dist/index3.js";
|
|
5
|
+
import { usePaymentTermsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
|
|
6
|
+
import { buildCustomDateCalendar as t, buildPaymentTermsView as n, closeCustomDatePickerFields as r, selectPaymentTermsFields as i, toCustomDateValue as a } from "./index8.js";
|
|
11
7
|
import "../../data-access/dist/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
8
|
+
import { useCallback as o, useMemo as s, useState as c } from "react";
|
|
14
9
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js
|
|
15
|
-
function
|
|
16
|
-
let
|
|
17
|
-
enabled: g,
|
|
18
|
-
canReadEmbedded: S.canReadEmbedded,
|
|
19
|
-
canReadExternal: S.canReadExternal
|
|
20
|
-
}), E = r(), [D, O] = h(!1), [k, A] = h(a), [j, M] = h({}), N = m(!1), P = d(() => {
|
|
21
|
-
N.current = !1, O(!1), A(a), M({});
|
|
22
|
-
}, []);
|
|
23
|
-
f(() => {
|
|
24
|
-
if (!g || T || N.current || C.length !== 1) return;
|
|
25
|
-
let [e] = C;
|
|
26
|
-
N.current = !0, b({
|
|
27
|
-
bankAccountId: e.id,
|
|
28
|
-
bankAccountType: e.type
|
|
29
|
-
});
|
|
30
|
-
}, [
|
|
31
|
-
T,
|
|
32
|
-
b,
|
|
33
|
-
g,
|
|
34
|
-
C
|
|
35
|
-
]);
|
|
36
|
-
let F = d((e) => {
|
|
37
|
-
let t = C.find((t) => t.id === e);
|
|
38
|
-
t && b({
|
|
39
|
-
bankAccountId: t.id,
|
|
40
|
-
bankAccountType: t.type
|
|
41
|
-
});
|
|
42
|
-
}, [b, C]), I = d(() => O(!0), []), L = d(() => {
|
|
43
|
-
O(!1), A(a), M({});
|
|
44
|
-
}, []), R = d((e) => A((t) => ({
|
|
45
|
-
...t,
|
|
46
|
-
...e
|
|
47
|
-
})), []), z = d(async () => {
|
|
48
|
-
let n = u(k, y);
|
|
49
|
-
if (M(n), !(Object.keys(n).length > 0)) try {
|
|
50
|
-
let t = await E.mutateAsync({ body: o(k) });
|
|
51
|
-
O(!1), A(a), b({
|
|
52
|
-
bankAccountId: t.id,
|
|
53
|
-
bankAccountType: "BANK_DETAILS"
|
|
54
|
-
}), e.success(y.bankAccountCreated.replace("{name}", t.display_name ?? ""));
|
|
55
|
-
} catch (n) {
|
|
56
|
-
e.error(t(n) ?? y.bankAccountCreateFailed);
|
|
57
|
-
}
|
|
58
|
-
}, [
|
|
59
|
-
E,
|
|
60
|
-
k,
|
|
61
|
-
y,
|
|
62
|
-
b
|
|
63
|
-
]), B = p(() => c({
|
|
64
|
-
accounts: C,
|
|
65
|
-
embeddedBankName: v,
|
|
66
|
-
messages: y
|
|
67
|
-
}), [
|
|
68
|
-
v,
|
|
69
|
-
y,
|
|
70
|
-
C
|
|
71
|
-
]);
|
|
10
|
+
function l({ paymentTermsId: l, paymentTermsCustomDate: u, messages: d, onChange: f }) {
|
|
11
|
+
let p = e(), [m, h] = c(!1);
|
|
72
12
|
return {
|
|
73
|
-
view:
|
|
74
|
-
|
|
75
|
-
isLoading:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
13
|
+
view: s(() => n({
|
|
14
|
+
terms: p.data?.data,
|
|
15
|
+
isLoading: p.isLoading,
|
|
16
|
+
fields: {
|
|
17
|
+
paymentTermsId: l,
|
|
18
|
+
paymentTermsCustomDate: u
|
|
19
|
+
},
|
|
20
|
+
customDatePickerOpen: m,
|
|
21
|
+
messages: d
|
|
82
22
|
}), [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
B,
|
|
90
|
-
S.canAddAccount
|
|
23
|
+
m,
|
|
24
|
+
d,
|
|
25
|
+
u,
|
|
26
|
+
l,
|
|
27
|
+
p.data?.data,
|
|
28
|
+
p.isLoading
|
|
91
29
|
]),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
30
|
+
calendar: s(() => t(u), [u]),
|
|
31
|
+
select: o((e) => {
|
|
32
|
+
f((t) => i(t, e)), h(!1);
|
|
33
|
+
}, [f]),
|
|
34
|
+
changeCustomDatePickerOpen: o((e) => {
|
|
35
|
+
h(e), e || f(r);
|
|
36
|
+
}, [f]),
|
|
37
|
+
selectCustomDate: o((e) => {
|
|
38
|
+
f((t) => r({
|
|
39
|
+
...t,
|
|
40
|
+
paymentTermsCustomDate: a(e)
|
|
41
|
+
})), h(!1);
|
|
42
|
+
}, [f]),
|
|
43
|
+
reset: o(() => h(!1), [])
|
|
98
44
|
};
|
|
99
45
|
}
|
|
100
46
|
//#endregion
|
|
101
|
-
export {
|
|
47
|
+
export { l as useReceivablePaymentTerms };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js
CHANGED
|
@@ -1,121 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"use client";
|
|
5
|
-
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import { extractApiErrorMessage as t } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
7
|
-
import { usePaymentTermsQuery as n } from "../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
|
|
8
|
-
import "../../../shared/ui/dist/index.js";
|
|
9
|
-
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
|
-
import "../../../shared/feature/dist/index.js";
|
|
11
|
-
import { areOverdueTermsValid as i, buildOverdueReminderPayload as a, buildPaymentReminderPayload as o, buildRemindersView as s, canCreateReminders as c, getImpliedDueDate as l, isBeforeDueDaysValid as u, sanitizeReminderDays as d } from "./index11.js";
|
|
12
|
-
import { useCreateOverdueReminderMutation as f, useCreatePaymentReminderMutation as p, useOverdueRemindersQuery as m, usePaymentRemindersQuery as h } from "../../data-access/dist/index10.js";
|
|
13
|
-
import "../../data-access/dist/index.js";
|
|
14
|
-
import { useCallback as g, useMemo as _, useState as v } from "react";
|
|
1
|
+
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
2
|
+
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
3
|
+
import "../../../shared/data-access/dist/index.js";
|
|
15
4
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}), F(""), L(y)), N(e);
|
|
25
|
-
}, [O]), G = g((e) => O({ paymentReminderId: e }), [O]), K = g((e) => O({ overdueReminderId: e }), [O]), q = g((e) => F(d(e)), []), J = g((e, t) => {
|
|
26
|
-
let n = d(t);
|
|
27
|
-
L((t) => t.map((t, r) => r === e ? n : t));
|
|
28
|
-
}, []), Y = g(() => {
|
|
29
|
-
L((e) => e.length < 3 ? [...e, ""] : e);
|
|
30
|
-
}, []), X = g(() => L(y), []), Z = g(() => l({
|
|
31
|
-
paymentTermsId: C,
|
|
32
|
-
paymentTermsCustomDate: w,
|
|
33
|
-
paymentTerms: A,
|
|
34
|
-
today: /* @__PURE__ */ new Date()
|
|
35
|
-
}), [
|
|
36
|
-
A,
|
|
37
|
-
w,
|
|
38
|
-
C
|
|
39
|
-
]), Q = g(async () => {
|
|
40
|
-
if (u(P)) try {
|
|
41
|
-
let t = await V.mutateAsync({ body: o({
|
|
42
|
-
daysBefore: Number(P),
|
|
43
|
-
dueDate: Z(),
|
|
44
|
-
messages: D
|
|
45
|
-
}) });
|
|
46
|
-
F(""), O({ paymentReminderId: t.id }), e.success(D.reminderAdded);
|
|
47
|
-
} catch (n) {
|
|
48
|
-
e.error(t(n) ?? D.genericError);
|
|
49
|
-
}
|
|
50
|
-
}, [
|
|
51
|
-
P,
|
|
52
|
-
V,
|
|
53
|
-
Z,
|
|
54
|
-
D,
|
|
55
|
-
O
|
|
56
|
-
]), $ = g(async () => {
|
|
57
|
-
if (i(I)) try {
|
|
58
|
-
let t = await H.mutateAsync({ body: a({
|
|
59
|
-
terms: I,
|
|
60
|
-
dueDate: Z(),
|
|
61
|
-
messages: D
|
|
62
|
-
}) });
|
|
63
|
-
L(y), O({ overdueReminderId: t.id }), e.success(D.reminderAdded);
|
|
64
|
-
} catch (n) {
|
|
65
|
-
e.error(t(n) ?? D.genericError);
|
|
66
|
-
}
|
|
67
|
-
}, [
|
|
68
|
-
H,
|
|
69
|
-
Z,
|
|
70
|
-
D,
|
|
71
|
-
O,
|
|
72
|
-
I
|
|
73
|
-
]);
|
|
5
|
+
var n = {
|
|
6
|
+
routingNumber: "",
|
|
7
|
+
accountNumber: "",
|
|
8
|
+
accountHolderName: "",
|
|
9
|
+
displayName: ""
|
|
10
|
+
};
|
|
11
|
+
function r(n) {
|
|
12
|
+
let r = new Set(n ?? []);
|
|
74
13
|
return {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
14
|
+
canReadEmbedded: e(r, [t.BankAccountReadOrg]),
|
|
15
|
+
canReadExternal: e(r, [t.ExternalBankAccountReadOrg]),
|
|
16
|
+
canAddAccount: e(r, [t.BankAccountWriteOrg])
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function i(e, t) {
|
|
20
|
+
return [e.displayName || t.bankAccountFallbackName, e.accountNumberLast4].filter(Boolean).join(" - ");
|
|
21
|
+
}
|
|
22
|
+
function a(e, t, n) {
|
|
23
|
+
switch (e) {
|
|
24
|
+
case "INTERNAL": return t ? n.bankAccountPoweredBy.replace("{embeddedBankName}", t) : void 0;
|
|
25
|
+
case "EXTERNAL": return n.bankAccountLinked;
|
|
26
|
+
default: return;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function o({ accounts: e, embeddedBankName: t, messages: n }) {
|
|
30
|
+
return e.map((e) => ({
|
|
31
|
+
value: e.id,
|
|
32
|
+
label: i(e, n),
|
|
33
|
+
sourceLabel: a(e.type, t, n)
|
|
34
|
+
})).sort((e, t) => e.label.localeCompare(t.label));
|
|
35
|
+
}
|
|
36
|
+
function s({ options: e, isLoading: t, selectedId: n, isAddingAccount: r, canAddAccount: i, formValues: a, formErrors: o, isSaving: s }) {
|
|
37
|
+
return t ? { kind: "loading" } : e.length > 0 && !r ? {
|
|
38
|
+
kind: "picker",
|
|
39
|
+
options: e,
|
|
40
|
+
selected: e.find((e) => e.value === n),
|
|
41
|
+
canAddAccount: i
|
|
42
|
+
} : i ? {
|
|
43
|
+
kind: "form",
|
|
44
|
+
values: a,
|
|
45
|
+
errors: o,
|
|
46
|
+
canCancel: e.length > 0,
|
|
47
|
+
isSaving: s
|
|
48
|
+
} : { kind: "restricted" };
|
|
49
|
+
}
|
|
50
|
+
function c(e, t) {
|
|
51
|
+
let n = {}, r = e.accountHolderName.trim(), i = e.accountNumber.trim(), a = e.routingNumber.trim();
|
|
52
|
+
return r ? r.length > 255 && (n.accountHolderName = t.bankAccountHolderNameTooLong) : n.accountHolderName = t.bankAccountHolderNameRequired, i ? /^\d+$/.test(i) ? i.length < 4 ? n.accountNumber = t.bankAccountNumberTooShort : i.length > 17 && (n.accountNumber = t.bankAccountNumberTooLong) : n.accountNumber = t.bankAccountNumberDigitsOnly : n.accountNumber = t.bankAccountNumberRequired, a ? /^\d{9}$/.test(a) || (n.routingNumber = t.bankAccountRoutingNumberInvalid) : n.routingNumber = t.bankAccountRoutingNumberRequired, e.displayName.length > 200 && (n.displayName = t.bankAccountNicknameTooLong), n;
|
|
53
|
+
}
|
|
54
|
+
function l(e) {
|
|
55
|
+
return {
|
|
56
|
+
display_name: e.displayName || void 0,
|
|
57
|
+
account_holder_name: e.accountHolderName.trim() || void 0,
|
|
58
|
+
account_number: e.accountNumber.trim() || void 0,
|
|
59
|
+
routing_number: e.routingNumber.trim() || void 0
|
|
118
60
|
};
|
|
119
61
|
}
|
|
120
62
|
//#endregion
|
|
121
|
-
export {
|
|
63
|
+
export { n as EMPTY_BANK_ACCOUNT_FORM_VALUES, l as bankAccountFormToPayload, s as buildBankAccountSectionView, o as buildPaymentAccountOptions, r as getBankAccountPermissions, i as getPaymentAccountLineLabel, a as getPaymentAccountSourceLabel, c as validateBankAccountForm };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js
CHANGED
|
@@ -1,52 +1,101 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { extractApiErrorMessage as t } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
7
|
+
import "../../../shared/ui/dist/index.js";
|
|
8
|
+
import { useWidgetConfig as n } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
9
|
+
import "../../../shared/feature/dist/index.js";
|
|
10
|
+
import { useCreateEntityBankAccountMutation as r, usePaymentAccountsQuery as i } from "../../data-access/dist/index3.js";
|
|
11
|
+
import "../../data-access/dist/index.js";
|
|
12
|
+
import { EMPTY_BANK_ACCOUNT_FORM_VALUES as a, bankAccountFormToPayload as o, buildBankAccountSectionView as s, buildPaymentAccountOptions as c, getBankAccountPermissions as l, validateBankAccountForm as u } from "./index18.js";
|
|
13
|
+
import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
2
14
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
function g({ open: g, bankAccountId: _, embeddedBankName: v, messages: y, onSelect: b }) {
|
|
16
|
+
let { initResponse: x } = n(), S = p(() => l(x?.scopes), [x?.scopes]), { paymentAccounts: C, isLoading: w, isIncomplete: T } = i({
|
|
17
|
+
enabled: g,
|
|
18
|
+
canReadEmbedded: S.canReadEmbedded,
|
|
19
|
+
canReadExternal: S.canReadExternal
|
|
20
|
+
}), E = r(), [D, O] = h(!1), [k, A] = h(a), [j, M] = h({}), N = m(!1), P = d(() => {
|
|
21
|
+
N.current = !1, O(!1), A(a), M({});
|
|
22
|
+
}, []);
|
|
23
|
+
f(() => {
|
|
24
|
+
if (!g || T || N.current || C.length !== 1) return;
|
|
25
|
+
let [e] = C;
|
|
26
|
+
N.current = !0, b({
|
|
27
|
+
bankAccountId: e.id,
|
|
28
|
+
bankAccountType: e.type
|
|
29
|
+
});
|
|
30
|
+
}, [
|
|
31
|
+
T,
|
|
32
|
+
b,
|
|
33
|
+
g,
|
|
34
|
+
C
|
|
35
|
+
]);
|
|
36
|
+
let F = d((e) => {
|
|
37
|
+
let t = C.find((t) => t.id === e);
|
|
38
|
+
t && b({
|
|
39
|
+
bankAccountId: t.id,
|
|
40
|
+
bankAccountType: t.type
|
|
41
|
+
});
|
|
42
|
+
}, [b, C]), I = d(() => O(!0), []), L = d(() => {
|
|
43
|
+
O(!1), A(a), M({});
|
|
44
|
+
}, []), R = d((e) => A((t) => ({
|
|
45
|
+
...t,
|
|
46
|
+
...e
|
|
47
|
+
})), []), z = d(async () => {
|
|
48
|
+
let n = u(k, y);
|
|
49
|
+
if (M(n), !(Object.keys(n).length > 0)) try {
|
|
50
|
+
let t = await E.mutateAsync({ body: o(k) });
|
|
51
|
+
O(!1), A(a), b({
|
|
52
|
+
bankAccountId: t.id,
|
|
53
|
+
bankAccountType: "BANK_DETAILS"
|
|
54
|
+
}), e.success(y.bankAccountCreated.replace("{name}", t.display_name ?? ""));
|
|
55
|
+
} catch (n) {
|
|
56
|
+
e.error(t(n) ?? y.bankAccountCreateFailed);
|
|
57
|
+
}
|
|
58
|
+
}, [
|
|
59
|
+
E,
|
|
60
|
+
k,
|
|
61
|
+
y,
|
|
62
|
+
b
|
|
63
|
+
]), B = p(() => c({
|
|
64
|
+
accounts: C,
|
|
65
|
+
embeddedBankName: v,
|
|
66
|
+
messages: y
|
|
67
|
+
}), [
|
|
68
|
+
v,
|
|
69
|
+
y,
|
|
70
|
+
C
|
|
71
|
+
]);
|
|
10
72
|
return {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
subtotal: s.subtotal
|
|
37
|
-
}), { taxableSubtotal: l, nonTaxableSubtotal: u } = a({
|
|
38
|
-
...s,
|
|
39
|
-
discountAmount: c
|
|
40
|
-
}), d = s.rate ? Math.round(l * s.rate) : 0, f = s.subtotal - c;
|
|
41
|
-
return {
|
|
42
|
-
...s,
|
|
43
|
-
discountAmount: c,
|
|
44
|
-
discountedSubtotal: f,
|
|
45
|
-
taxableSubtotal: l,
|
|
46
|
-
nonTaxableSubtotal: u,
|
|
47
|
-
totalTaxes: d,
|
|
48
|
-
total: f + d
|
|
73
|
+
view: p(() => s({
|
|
74
|
+
options: B,
|
|
75
|
+
isLoading: w,
|
|
76
|
+
selectedId: _,
|
|
77
|
+
isAddingAccount: D,
|
|
78
|
+
canAddAccount: S.canAddAccount,
|
|
79
|
+
formValues: k,
|
|
80
|
+
formErrors: j,
|
|
81
|
+
isSaving: E.isPending
|
|
82
|
+
}), [
|
|
83
|
+
_,
|
|
84
|
+
E.isPending,
|
|
85
|
+
j,
|
|
86
|
+
k,
|
|
87
|
+
D,
|
|
88
|
+
w,
|
|
89
|
+
B,
|
|
90
|
+
S.canAddAccount
|
|
91
|
+
]),
|
|
92
|
+
reset: P,
|
|
93
|
+
selectAccount: F,
|
|
94
|
+
openAddAccount: I,
|
|
95
|
+
cancelAddAccount: L,
|
|
96
|
+
updateAccountForm: R,
|
|
97
|
+
saveAccount: z
|
|
49
98
|
};
|
|
50
99
|
}
|
|
51
100
|
//#endregion
|
|
52
|
-
export {
|
|
101
|
+
export { g as useReceivableBankAccount };
|