@tesouro/embedded-components-react 0.11.140 → 0.11.167
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/NOTICE +24 -0
- package/README.md +15 -37
- package/dist/experimental/BalanceHistoryWidget.d.ts +0 -11
- package/dist/experimental/QuickViewWidget.d.ts +0 -11
- package/dist/experimental/RemoteCheckCapture.d.ts +0 -11
- package/dist/experimental/index.d.ts +0 -11
- package/dist/fixtures/index.d.ts +27 -1
- package/dist/index.css +6976 -6246
- package/dist/index.d.ts +64 -173
- package/dist/index.js +9 -10
- package/dist/lib/AcceptDisclosuresWidget.d.ts +0 -11
- package/dist/lib/BalancesWidget.d.ts +0 -11
- package/dist/lib/BankAccountOnboardingWidget.d.ts +0 -11
- package/dist/lib/BankAccountsWidget.d.ts +2 -11
- package/dist/lib/BankingComplianceBannerWidget.d.ts +0 -11
- package/dist/lib/BillPayWidget.d.ts +0 -11
- package/dist/lib/CardDetailsWidget.d.ts +0 -11
- package/dist/lib/CounterpartsWidget.d.ts +1 -12
- package/dist/lib/CounterpartsWidgetPublic.d.ts +1 -12
- package/dist/lib/CreditCardsWidget.d.ts +0 -11
- package/dist/lib/DebitCardsWidget.d.ts +0 -11
- package/dist/lib/ExpenseManagementWidget.d.ts +1 -12
- package/dist/lib/InsightsWidget.d.ts +0 -11
- package/dist/lib/LinkedAccountsWidget.d.ts +0 -11
- package/dist/lib/OfferWidget.d.ts +0 -11
- package/dist/lib/ReceivablesWidget.d.ts +60 -17
- package/dist/lib/ReceivablesWidget.js +3 -2
- package/dist/lib/SettingsWidget.d.ts +0 -11
- package/dist/lib/TransfersWidget.d.ts +0 -11
- package/dist/lib/WidgetProvider.d.ts +0 -11
- package/dist/lib/WidgetProviderPublic.d.ts +0 -11
- package/dist/lib/WidgetSuite.d.ts +60 -15
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +20 -19
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index10.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index4.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index10.js +83 -82
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index4.js +84 -79
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index9.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/formatters.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js +51 -46
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/labels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index10.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useActivateCard.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useCardLock.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useEditCardNickname.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/ExpenseManagementWidget.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +66 -74
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +351 -318
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +126 -133
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +63 -56
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilter.js +78 -72
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilterLabels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +14 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +138 -129
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +119 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusCards.js +37 -28
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/tabs.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useInvoicesFilter.js +131 -81
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useLocalDayStart.js +15 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +46 -46
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableAttachmentUploads.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableBankAccount.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +440 -438
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentTerms.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js +62 -56
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +47 -16
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +78 -86
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +180 -158
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useRecurringSeriesTable.js +132 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/invoicing.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/receivables.js +153 -137
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +22 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +6 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +137 -129
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +21 -46
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +143 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +47 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +25 -25
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductDelete.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/mocks/products.js +3 -11
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/scenarios.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index2.js +36 -77
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/summarizeCardSpend.js +11 -13
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/useCardSpendSummary.js +20 -17
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/useRemoteCheckCaptureWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index8.js +4 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index12.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index16.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApprovalPolicyRules.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +43 -43
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +233 -211
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +66 -42
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/util/dist/lib/receivableFilledTone.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/toasts.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +28 -28
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/EmbeddedToaster.js +33 -32
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +9 -8
- package/dist/node_modules/sonner/dist/index.js +620 -0
- package/dist/packages/shared-ui-shadcn/dist/index.js +6072 -6062
- package/dist/scenarios/index.d.ts +1 -3
- package/dist/scenarios/index.js +17 -20
- package/package.json +17 -4
- package/dist/lib/CustomersWidget.d.ts +0 -993
- package/dist/lib/CustomersWidget.js +0 -2
- package/dist/lib/ProductsWidget.d.ts +0 -893
- package/dist/lib/ProductsWidget.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/CustomersWidget/CustomersWidget.js +0 -41
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/analytics/events.js +0 -3
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/scenarios.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useUtcDayStart.js +0 -15
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { toast as e } from "../../../../../../../
|
|
5
|
+
import { toast as e } from "../../../../../../../node_modules/sonner/dist/index.js";
|
|
6
6
|
import { extractApiErrorMessage as t } from "../../../../../shared/util/dist/lib/apiErrors.js";
|
|
7
7
|
import "../../../../../shared/util/dist/index.js";
|
|
8
8
|
import { useCurrentUserQuery as n } from "../../../../../shared/data-access/dist/lib/useCurrentUserQuery.js";
|
|
@@ -10,15 +10,15 @@ import "../../../../../shared/data-access/dist/index.js";
|
|
|
10
10
|
import "../../../../../shared/ui/dist/index.js";
|
|
11
11
|
import { useWidgetConfig as r } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
12
12
|
import "../../../../../shared/feature/dist/index.js";
|
|
13
|
-
import {
|
|
13
|
+
import { getCurrencySymbol as i } from "./lineItems.js";
|
|
14
|
+
import { formatMoney as a } from "./helpers.js";
|
|
15
|
+
import { useCreateReceivablePaymentRecordMutation as o } from "../../../../data-access/dist/index13.js";
|
|
14
16
|
import "../../../../data-access/dist/index.js";
|
|
15
|
-
import { getCurrencySymbol as a } from "./lineItems.js";
|
|
16
|
-
import { formatMoney as o } from "./helpers.js";
|
|
17
17
|
import { amountDueInputValue as s, buildPaymentRecordPayload as c, buildPaymentReviewView as l, defaultPaymentRecordValues as u, hasPaymentRecordErrors as d, validatePaymentRecordValues as f } from "./paymentRecord.js";
|
|
18
18
|
import { useCallback as p, useState as m } from "react";
|
|
19
19
|
// ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js
|
|
20
20
|
function h({ messages: h }) {
|
|
21
|
-
let [g, _] = m(), [v, y] = m("form"), [b, x] = m(() => u()), [S, C] = m({}), [w, T] = m(!1), { initResponse: E } = r(), D = E?.userId ?? void 0, O =
|
|
21
|
+
let [g, _] = m(), [v, y] = m("form"), [b, x] = m(() => u()), [S, C] = m({}), [w, T] = m(!1), { initResponse: E } = r(), D = E?.userId ?? void 0, O = o(), k = n({ enabled: !!g }), A = p((e) => {
|
|
22
22
|
_(e), y("form"), x(u()), C({}), T(!1);
|
|
23
23
|
}, []), j = p(() => _(void 0), []), M = p((e) => {
|
|
24
24
|
let t = {
|
|
@@ -66,8 +66,8 @@ function h({ messages: h }) {
|
|
|
66
66
|
step: v,
|
|
67
67
|
values: b,
|
|
68
68
|
errors: S,
|
|
69
|
-
currencySymbol: g ?
|
|
70
|
-
amountDueLabel: g ?
|
|
69
|
+
currencySymbol: g ? i(g.currency) : "",
|
|
70
|
+
amountDueLabel: g ? a({
|
|
71
71
|
amount: g.amount_due,
|
|
72
72
|
currency: g.currency,
|
|
73
73
|
fallback: ""
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { usePaymentTermsQuery as e } from "../../../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
|
|
6
|
-
import "../../../../data-access/dist/index.js";
|
|
7
6
|
import { buildCustomDateCalendar as t, buildPaymentTermsView as n, closeCustomDatePickerFields as r, resolveIssueDate as i, selectPaymentTermsFields as a, toCustomDateValue as o } from "./paymentTerms.js";
|
|
7
|
+
import "../../../../data-access/dist/index.js";
|
|
8
8
|
import { useCallback as s, useMemo as c, useState as l } from "react";
|
|
9
9
|
// ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentTerms.js
|
|
10
10
|
function u({ paymentTermsId: u, paymentTermsCustomDate: d, issueDate: f, isRecurring: p, messages: m, onChange: h }) {
|
|
@@ -22,116 +22,122 @@ var y = [
|
|
|
22
22
|
"recurrenceRecipientsCc",
|
|
23
23
|
"recurrenceRecipientsBcc"
|
|
24
24
|
];
|
|
25
|
-
function x({ values: x, errors: S, lockSchedule: C,
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
]),
|
|
25
|
+
function x({ values: x, errors: S, lockSchedule: C, requireRepeat: w, messages: T, onChange: E, onClearErrors: D, onRevalidateErrors: O }) {
|
|
26
|
+
let k = t(x.customerId || void 0), A = x.customerEmail.trim() || (k.data ? e(k.data).trim() : ""), [j, M] = v(!1), [N, P] = v(x), [F, I] = v(null), L = g(() => F ?? o(N, A), [
|
|
27
|
+
A,
|
|
28
|
+
F,
|
|
29
|
+
N
|
|
30
|
+
]), R = _({
|
|
31
31
|
id: x.customerId,
|
|
32
|
-
email:
|
|
32
|
+
email: A
|
|
33
33
|
});
|
|
34
34
|
h(() => {
|
|
35
|
-
if (!
|
|
36
|
-
let e =
|
|
37
|
-
|
|
35
|
+
if (!A && k.isLoading) return;
|
|
36
|
+
let e = R.current;
|
|
37
|
+
R.current = {
|
|
38
38
|
id: x.customerId,
|
|
39
|
-
email:
|
|
40
|
-
}, e.email && e.email !==
|
|
39
|
+
email: A
|
|
40
|
+
}, e.email && e.email !== A && E(!e.id || e.id === x.customerId ? s : a);
|
|
41
41
|
}, [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
k.isLoading,
|
|
43
|
+
A,
|
|
44
|
+
E,
|
|
45
45
|
x.customerId
|
|
46
46
|
]);
|
|
47
|
-
let
|
|
48
|
-
|
|
47
|
+
let z = m((e) => {
|
|
48
|
+
P(e), I(null), M(!0);
|
|
49
49
|
}, []);
|
|
50
50
|
return {
|
|
51
51
|
view: g(() => i({
|
|
52
52
|
fields: x,
|
|
53
53
|
errors: S,
|
|
54
54
|
lockSchedule: C,
|
|
55
|
-
|
|
55
|
+
requireRepeat: w,
|
|
56
|
+
messages: T
|
|
56
57
|
}), [
|
|
57
58
|
S,
|
|
58
59
|
C,
|
|
60
|
+
T,
|
|
59
61
|
w,
|
|
60
62
|
x
|
|
61
63
|
]),
|
|
62
64
|
emailView: g(() => r({
|
|
63
|
-
open:
|
|
64
|
-
ready: !
|
|
65
|
-
draft:
|
|
66
|
-
messages:
|
|
65
|
+
open: j,
|
|
66
|
+
ready: !k.isLoading,
|
|
67
|
+
draft: L,
|
|
68
|
+
messages: T
|
|
67
69
|
}), [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
k.isLoading,
|
|
71
|
+
L,
|
|
72
|
+
j,
|
|
73
|
+
T
|
|
72
74
|
]),
|
|
73
75
|
changeFrequency: m((e) => {
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
+
w && e === "once" || (D(y), E((t) => d(t, e)));
|
|
77
|
+
}, [
|
|
78
|
+
E,
|
|
79
|
+
D,
|
|
80
|
+
w
|
|
81
|
+
]),
|
|
76
82
|
changeMonthDay: m((e) => {
|
|
77
|
-
|
|
83
|
+
O(["recurrenceIssueMode"]), E((t) => f(t, e, { lockSchedule: C }));
|
|
78
84
|
}, [
|
|
79
85
|
C,
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
E,
|
|
87
|
+
O
|
|
82
88
|
]),
|
|
83
89
|
changeWeekday: m((e) => {
|
|
84
|
-
C || (
|
|
90
|
+
C || (D(["recurrenceStartDate"]), O(["recurrenceDayOfWeek"]), E((t) => l(t, e, { lockSchedule: C })));
|
|
85
91
|
}, [
|
|
86
92
|
C,
|
|
87
|
-
T,
|
|
88
93
|
E,
|
|
89
|
-
D
|
|
94
|
+
D,
|
|
95
|
+
O
|
|
90
96
|
]),
|
|
91
97
|
changeStartDate: m((e) => {
|
|
92
|
-
|
|
93
|
-
}, [
|
|
98
|
+
O(["recurrenceStartDate"]), E((t) => c(t, "recurrenceStartDate", e));
|
|
99
|
+
}, [E, O]),
|
|
94
100
|
changeEndDate: m((e) => {
|
|
95
|
-
|
|
96
|
-
}, [
|
|
101
|
+
O(["recurrenceEndDate"]), E((t) => c(t, "recurrenceEndDate", e));
|
|
102
|
+
}, [E, O]),
|
|
97
103
|
changeEndMode: m((e) => {
|
|
98
|
-
|
|
99
|
-
}, [
|
|
104
|
+
O(["recurrenceEndMode"]), E((t) => u(t, e));
|
|
105
|
+
}, [E, O]),
|
|
100
106
|
changeMaxOccurrences: m((e) => {
|
|
101
|
-
|
|
107
|
+
O(["recurrenceMaxOccurrences"]), E((t) => ({
|
|
102
108
|
...t,
|
|
103
109
|
recurrenceMaxOccurrences: e
|
|
104
110
|
}));
|
|
105
|
-
}, [
|
|
111
|
+
}, [E, O]),
|
|
106
112
|
changeCreationMode: m((e) => {
|
|
107
113
|
let t = {
|
|
108
114
|
...x,
|
|
109
115
|
recurrenceAutomationLevel: e
|
|
110
116
|
};
|
|
111
|
-
|
|
117
|
+
E((t) => ({
|
|
112
118
|
...t,
|
|
113
119
|
recurrenceAutomationLevel: e
|
|
114
|
-
})), p(t, e) &&
|
|
120
|
+
})), p(t, e) && z(t);
|
|
115
121
|
}, [
|
|
116
|
-
|
|
117
|
-
|
|
122
|
+
E,
|
|
123
|
+
z,
|
|
118
124
|
x
|
|
119
125
|
]),
|
|
120
|
-
setUpEmail: m(() =>
|
|
121
|
-
changeEmailOpen:
|
|
122
|
-
changeEmail: m((e, t) =>
|
|
123
|
-
...n ??
|
|
126
|
+
setUpEmail: m(() => z(x), [z, x]),
|
|
127
|
+
changeEmailOpen: M,
|
|
128
|
+
changeEmail: m((e, t) => I((n) => ({
|
|
129
|
+
...n ?? L,
|
|
124
130
|
[e]: t
|
|
125
|
-
})), [
|
|
131
|
+
})), [L]),
|
|
126
132
|
saveEmail: m(() => {
|
|
127
|
-
|
|
133
|
+
E((e) => n(e, L)), D(b), M(!1);
|
|
128
134
|
}, [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
L,
|
|
136
|
+
E,
|
|
137
|
+
D
|
|
132
138
|
]),
|
|
133
139
|
reset: m(() => {
|
|
134
|
-
|
|
140
|
+
M(!1), R.current = {
|
|
135
141
|
id: "",
|
|
136
142
|
email: ""
|
|
137
143
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { toast as e } from "../../../../../../../
|
|
5
|
+
import { toast as e } from "../../../../../../../node_modules/sonner/dist/index.js";
|
|
6
6
|
import { extractApiErrorMessage as t } from "../../../../../shared/util/dist/lib/apiErrors.js";
|
|
7
7
|
import "../../../../../shared/util/dist/index.js";
|
|
8
8
|
import { usePaymentTermsQuery as n } from "../../../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
|
|
@@ -2,39 +2,70 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { buildReceivableStatusCardsView as e } from "./statusCards.js";
|
|
6
|
+
import { useReceivablesAnalyticsQuery as t } from "../../../../data-access/dist/index17.js";
|
|
6
7
|
import "../../../../data-access/dist/index.js";
|
|
7
|
-
import { buildReceivableStatusCardsView as t } from "./statusCards.js";
|
|
8
8
|
import { useMemo as n } from "react";
|
|
9
9
|
// ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js
|
|
10
|
-
function r({ enabled: r, visible: i = r, selectedStatuses: a,
|
|
11
|
-
let
|
|
10
|
+
function r({ enabled: r, visible: i = r, selectedStatuses: a, paidWindow: o, isPaidWindowApplied: s, messages: c }) {
|
|
11
|
+
let l = t({
|
|
12
12
|
enabled: r,
|
|
13
13
|
dimension: "status",
|
|
14
14
|
metric: "id",
|
|
15
15
|
aggregation_function: "count",
|
|
16
16
|
type: "invoice"
|
|
17
|
-
}),
|
|
17
|
+
}), u = t({
|
|
18
18
|
enabled: r,
|
|
19
19
|
dimension: "status",
|
|
20
20
|
metric: "amount_due",
|
|
21
21
|
aggregation_function: "summary",
|
|
22
22
|
type: "invoice"
|
|
23
|
-
}),
|
|
23
|
+
}), d = t({
|
|
24
|
+
enabled: r,
|
|
25
|
+
dimension: "status",
|
|
26
|
+
metric: "id",
|
|
27
|
+
aggregation_function: "count",
|
|
28
|
+
type: "invoice",
|
|
29
|
+
status: "paid",
|
|
30
|
+
...o
|
|
31
|
+
}), f = t({
|
|
32
|
+
enabled: r,
|
|
33
|
+
dimension: "status",
|
|
34
|
+
metric: "total_amount",
|
|
35
|
+
aggregation_function: "summary",
|
|
36
|
+
type: "invoice",
|
|
37
|
+
status: "paid",
|
|
38
|
+
...o
|
|
39
|
+
}), p = l.data?.data, m = u.data?.data, h = d.data?.data, g = f.data?.data, _ = [
|
|
40
|
+
l,
|
|
41
|
+
u,
|
|
42
|
+
d,
|
|
43
|
+
f
|
|
44
|
+
].some((e) => e.isPending), v = l.isError, y = u.isError, b = d.isError || f.isError;
|
|
24
45
|
return n(() => {
|
|
25
|
-
if (i) return
|
|
26
|
-
counts:
|
|
27
|
-
amountsDue:
|
|
28
|
-
|
|
46
|
+
if (i) return _ ? { kind: "loading" } : e({
|
|
47
|
+
counts: p ?? [],
|
|
48
|
+
amountsDue: m ?? [],
|
|
49
|
+
paidCounts: h ?? [],
|
|
50
|
+
paidTotals: g ?? [],
|
|
51
|
+
isCountsError: v,
|
|
52
|
+
isAmountsDueError: y,
|
|
53
|
+
isPaidError: b,
|
|
29
54
|
selectedStatuses: a,
|
|
30
|
-
|
|
55
|
+
isPaidWindowApplied: s,
|
|
56
|
+
messages: c
|
|
31
57
|
});
|
|
32
58
|
}, [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
59
|
+
m,
|
|
60
|
+
p,
|
|
61
|
+
y,
|
|
62
|
+
v,
|
|
63
|
+
b,
|
|
64
|
+
s,
|
|
65
|
+
_,
|
|
66
|
+
c,
|
|
67
|
+
h,
|
|
68
|
+
g,
|
|
38
69
|
a,
|
|
39
70
|
i
|
|
40
71
|
]);
|
|
@@ -2,113 +2,105 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { buildReceivableRows as e } from "./helpers.js";
|
|
6
|
+
import { buildPaidWindow as t } from "./statusCards.js";
|
|
7
|
+
import { useReceivablesQuery as n } from "../../../../data-access/dist/index15.js";
|
|
7
8
|
import "../../../../data-access/dist/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { useUtcDayStart as s } from "./useUtcDayStart.js";
|
|
14
|
-
import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
|
|
9
|
+
import { useInvoicesFilter as r } from "./useInvoicesFilter.js";
|
|
10
|
+
import { useReceivableCustomerNames as i } from "./useReceivableCustomerNames.js";
|
|
11
|
+
import { useReceivableStatusCards as a } from "./useReceivableStatusCards.js";
|
|
12
|
+
import { useLocalDayStart as o } from "./useLocalDayStart.js";
|
|
13
|
+
import { useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
|
|
15
14
|
// ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js
|
|
16
|
-
var
|
|
15
|
+
var d = [], f = [{
|
|
17
16
|
id: "dueDateLabel",
|
|
18
17
|
desc: !0
|
|
19
18
|
}];
|
|
20
|
-
function
|
|
21
|
-
let [
|
|
22
|
-
initialCounterpartId:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
function p({ initialCounterpartId: p, selectedStatusCard: h, onStatusCardChange: g, messages: _, statusLabels: v, filterLabels: y, pageSizeOptions: b, enabled: x = !0, visible: S = x }) {
|
|
20
|
+
let [C, w] = u(f), [T, E] = u(b?.[0] ?? 10), [D, O] = u(), [k, A] = u(""), [j, M] = u(""), N = o(), P = l(() => t(N), [N]), F = s(() => O(void 0), []), I = r({
|
|
21
|
+
initialCounterpartId: p,
|
|
22
|
+
selectedStatusCard: h,
|
|
23
|
+
onStatusCardChange: g,
|
|
24
|
+
search: k,
|
|
25
|
+
onSearchChange: A,
|
|
26
|
+
onFiltersChange: F,
|
|
27
|
+
statusLabels: v,
|
|
28
|
+
paidWindow: P,
|
|
29
|
+
labels: y
|
|
28
30
|
});
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
+
c(() => {
|
|
32
|
+
if (k === j) return;
|
|
31
33
|
let e = setTimeout(() => {
|
|
32
|
-
|
|
34
|
+
M(k), F();
|
|
33
35
|
}, 300);
|
|
34
36
|
return () => clearTimeout(e);
|
|
35
37
|
}, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
j,
|
|
39
|
+
F,
|
|
40
|
+
k
|
|
39
41
|
]);
|
|
40
|
-
let
|
|
41
|
-
enabled:
|
|
42
|
+
let L = C[0]?.id, R = L ? m[L] : void 0, z = C[0] ? C[0].desc ? "desc" : "asc" : void 0, B = n({
|
|
43
|
+
enabled: x,
|
|
42
44
|
type: "invoice",
|
|
43
|
-
limit:
|
|
44
|
-
pagination_token:
|
|
45
|
-
search_text:
|
|
46
|
-
...
|
|
47
|
-
...
|
|
48
|
-
sort:
|
|
49
|
-
order:
|
|
45
|
+
limit: T,
|
|
46
|
+
pagination_token: D,
|
|
47
|
+
search_text: j || void 0,
|
|
48
|
+
...I.query,
|
|
49
|
+
...R ? {
|
|
50
|
+
sort: R,
|
|
51
|
+
order: z
|
|
50
52
|
} : {}
|
|
51
|
-
}),
|
|
52
|
-
enabled:
|
|
53
|
-
visible:
|
|
54
|
-
selectedStatuses:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
g,
|
|
64
|
-
U,
|
|
65
|
-
W
|
|
66
|
-
]), K = s(), q = u(() => n({
|
|
67
|
-
receivables: z,
|
|
68
|
-
messages: g,
|
|
69
|
-
customerNames: H,
|
|
70
|
-
seriesStatuses: G,
|
|
71
|
-
now: new Date(K)
|
|
53
|
+
}), V = a({
|
|
54
|
+
enabled: x,
|
|
55
|
+
visible: S,
|
|
56
|
+
selectedStatuses: I.selectedStatuses,
|
|
57
|
+
paidWindow: P,
|
|
58
|
+
isPaidWindowApplied: I.isPaidWindowApplied,
|
|
59
|
+
messages: _
|
|
60
|
+
}), H = B.data?.data ?? d, U = l(() => new Map(H.map((e) => [e.id, e])), [H]), W = s((e) => U.get(e), [U]), G = i(H), K = l(() => e({
|
|
61
|
+
receivables: H,
|
|
62
|
+
messages: _,
|
|
63
|
+
customerNames: G,
|
|
64
|
+
now: new Date(N)
|
|
72
65
|
}), [
|
|
73
|
-
H,
|
|
74
|
-
g,
|
|
75
|
-
z,
|
|
76
66
|
G,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}, [
|
|
84
|
-
|
|
85
|
-
}, [
|
|
67
|
+
_,
|
|
68
|
+
H,
|
|
69
|
+
N
|
|
70
|
+
]), q = s((e) => {
|
|
71
|
+
let t = typeof e == "function" ? e(C) : e;
|
|
72
|
+
w(t[0] && Object.hasOwn(m, t[0].id) ? t : f), F();
|
|
73
|
+
}, [F, C]), J = s((e) => {
|
|
74
|
+
E(e), F();
|
|
75
|
+
}, [F]), Y = s(() => O(B.data?.next_pagination_token ?? void 0), [B.data?.next_pagination_token]), X = s(() => O(B.data?.prev_pagination_token ?? void 0), [B.data?.prev_pagination_token]), Z = s(() => {
|
|
76
|
+
B.refetch();
|
|
77
|
+
}, [B]);
|
|
86
78
|
return {
|
|
87
|
-
rows:
|
|
88
|
-
isLoading:
|
|
89
|
-
isError:
|
|
90
|
-
sorting:
|
|
91
|
-
onSortingChange:
|
|
92
|
-
pageSize:
|
|
93
|
-
onPageSizeChange:
|
|
94
|
-
hasNextPage: !!
|
|
95
|
-
hasPrevPage: !!
|
|
96
|
-
onNextPage:
|
|
97
|
-
onPrevPage:
|
|
98
|
-
statusCards:
|
|
99
|
-
onStatusCardSelect:
|
|
100
|
-
showCustomer:
|
|
101
|
-
filterBar:
|
|
102
|
-
isFiltering:
|
|
103
|
-
onRetry:
|
|
104
|
-
getReceivableById:
|
|
79
|
+
rows: K,
|
|
80
|
+
isLoading: B.isLoading,
|
|
81
|
+
isError: B.isError,
|
|
82
|
+
sorting: C,
|
|
83
|
+
onSortingChange: q,
|
|
84
|
+
pageSize: T,
|
|
85
|
+
onPageSizeChange: J,
|
|
86
|
+
hasNextPage: !!B.data?.next_pagination_token,
|
|
87
|
+
hasPrevPage: !!B.data?.prev_pagination_token,
|
|
88
|
+
onNextPage: Y,
|
|
89
|
+
onPrevPage: X,
|
|
90
|
+
statusCards: V,
|
|
91
|
+
onStatusCardSelect: I.selectStatusCard,
|
|
92
|
+
showCustomer: I.showCustomer,
|
|
93
|
+
filterBar: I.filterBar,
|
|
94
|
+
isFiltering: I.isFiltering,
|
|
95
|
+
onRetry: Z,
|
|
96
|
+
getReceivableById: W
|
|
105
97
|
};
|
|
106
98
|
}
|
|
107
|
-
var
|
|
99
|
+
var m = {
|
|
108
100
|
documentLabel: "document_id",
|
|
109
101
|
status: "status",
|
|
110
102
|
issueDateLabel: "issue_date",
|
|
111
103
|
dueDateLabel: "due_date",
|
|
112
104
|
totalLabel: "total_amount"
|
|
113
105
|
};
|
|
114
|
-
export {
|
|
106
|
+
export { p as useReceivablesTable };
|