@tesouro/embedded-components-react 0.5.279 → 0.5.280
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 +21 -6
- package/dist/lib/ReceivablesWidget.d.ts +21 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +14 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +24 -168
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +173 -44
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +42 -94
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js +91 -76
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js +67 -173
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index15.js +186 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +11 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +42 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +28 -132
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +137 -16
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +16 -62
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +66 -28
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +28 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableAttachmentsSection.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableCustomerSection.js +38 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +304 -287
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/customer.js +58 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +14 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/permissions.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +62 -62
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +41 -35
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/totals.js +21 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +124 -124
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +11 -11
- 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/useReceivableCustomerPicker.js +109 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +520 -476
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +6 -6
- 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/useReceivablePreview.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js +92 -77
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +79 -75
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useSendReceivableWithPaymentLink.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +26 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +9 -25
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +26 -228
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +227 -52
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +50 -212
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +193 -138
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +157 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +10 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +23 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +2 -116
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +118 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +3 -39
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +209 -53
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +2 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +36 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +53 -77
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +17 -35
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +8 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +73 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +36 -26
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +17 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +39 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +26 -33
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +20 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +8 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +34 -84
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +14 -492
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +28 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +79 -39
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +490 -68
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +2 -487
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +41 -217
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +70 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +440 -5
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +224 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +21 -263
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +8 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +261 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +2 -237
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +100 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +21 -242
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +226 -82
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +3 -60
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +233 -178
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +85 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +60 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +194 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +45 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +2 -23
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js +2 -51
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +4 -80
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +10 -22
- 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/ui/dist/index48.js +0 -100
|
@@ -6,22 +6,22 @@ import { useMyEntityQuery as e } from "../../../../../shared/data-access/dist/li
|
|
|
6
6
|
import "../../../../../shared/data-access/dist/index.js";
|
|
7
7
|
import { useCounterpartQuery as t } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
8
8
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
9
|
-
import { useReceivableRequiredFieldsQuery as n } from "../../../../data-access/dist/
|
|
9
|
+
import { useReceivableRequiredFieldsQuery as n } from "../../../../data-access/dist/index14.js";
|
|
10
10
|
import "../../../../data-access/dist/index.js";
|
|
11
11
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js
|
|
12
|
-
function r({ counterpartId: r, billingAddressId: i, billingCountry: a }) {
|
|
13
|
-
let
|
|
12
|
+
function r({ counterpartId: r, billingAddressId: i, billingCountry: a, inlineCustomerType: o }) {
|
|
13
|
+
let s = e(), c = t(r || void 0), l = c.data?.id === r ? c.data : void 0, u = n({
|
|
14
14
|
counterpart_id: r || void 0,
|
|
15
15
|
counterpart_billing_address_id: i || void 0,
|
|
16
16
|
counterpart_country: a,
|
|
17
|
-
counterpart_type:
|
|
18
|
-
enabled: !!(r
|
|
19
|
-
}),
|
|
17
|
+
counterpart_type: l?.type ?? o,
|
|
18
|
+
enabled: !!(r || o)
|
|
19
|
+
}), d = !!u.data?.entity?.tax_id?.required, f = !!r && !l && (c.isLoading || c.isFetching);
|
|
20
20
|
return {
|
|
21
|
-
counterpart:
|
|
22
|
-
isCounterpartLoading:
|
|
23
|
-
isLoading:
|
|
24
|
-
isTaxIdMissing:
|
|
21
|
+
counterpart: l,
|
|
22
|
+
isCounterpartLoading: f,
|
|
23
|
+
isLoading: s.isLoading || u.isLoading || f,
|
|
24
|
+
isTaxIdMissing: d && !s.data?.tax_id
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
@@ -9,15 +9,15 @@ import "../../../../../shared/data-access/dist/index.js";
|
|
|
9
9
|
import "../../../../../shared/ui/dist/index.js";
|
|
10
10
|
import { useWidgetConfig as r } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
11
|
import "../../../../../shared/feature/dist/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import { formatMoney as a } from "./helpers.js";
|
|
14
|
-
import { useCreateReceivablePaymentRecordMutation as o } from "../../../../data-access/dist/index12.js";
|
|
12
|
+
import { useCreateReceivablePaymentRecordMutation as i } from "../../../../data-access/dist/index13.js";
|
|
15
13
|
import "../../../../data-access/dist/index.js";
|
|
14
|
+
import { getCurrencySymbol as a } from "./lineItems.js";
|
|
15
|
+
import { formatMoney as o } from "./helpers.js";
|
|
16
16
|
import { amountDueInputValue as s, buildPaymentRecordPayload as c, buildPaymentReviewView as l, defaultPaymentRecordValues as u, hasPaymentRecordErrors as d, validatePaymentRecordValues as f } from "./paymentRecord.js";
|
|
17
17
|
import { useCallback as p, useState as m } from "react";
|
|
18
18
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js
|
|
19
19
|
function h({ messages: h }) {
|
|
20
|
-
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 =
|
|
20
|
+
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 = i(), k = n({ enabled: !!g }), A = p((e) => {
|
|
21
21
|
_(e), y("form"), x(u()), C({}), T(!1);
|
|
22
22
|
}, []), j = p(() => _(void 0), []), M = p((e) => {
|
|
23
23
|
let t = {
|
|
@@ -65,8 +65,8 @@ function h({ messages: h }) {
|
|
|
65
65
|
step: v,
|
|
66
66
|
values: b,
|
|
67
67
|
errors: S,
|
|
68
|
-
currencySymbol: g ?
|
|
69
|
-
amountDueLabel: g ?
|
|
68
|
+
currencySymbol: g ? a(g.currency) : "",
|
|
69
|
+
amountDueLabel: g ? o({
|
|
70
70
|
amount: g.amount_due,
|
|
71
71
|
currency: g.currency,
|
|
72
72
|
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 { buildCustomDateCalendar as t, buildPaymentTermsView as n, closeCustomDatePickerFields as r, resolveIssueDate as i, selectPaymentTermsFields as a, toCustomDateValue as o } from "./paymentTerms.js";
|
|
7
6
|
import "../../../../data-access/dist/index.js";
|
|
7
|
+
import { buildCustomDateCalendar as t, buildPaymentTermsView as n, closeCustomDatePickerFields as r, resolveIssueDate as i, selectPaymentTermsFields as a, toCustomDateValue as o } from "./paymentTerms.js";
|
|
8
8
|
import { useCallback as s, useMemo as c, useState as l } from "react";
|
|
9
9
|
//#region ../../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 }) {
|
|
@@ -7,7 +7,7 @@ import { usePaymentTermsQuery as t } from "../../../../../shared/data-access/dis
|
|
|
7
7
|
import "../../../../../shared/data-access/dist/index.js";
|
|
8
8
|
import { useCounterpartQuery as n } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
9
9
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
10
|
-
import { useEntityPaymentMethodsQuery as r, useEntitySettingsQuery as i } from "../../../../data-access/dist/
|
|
10
|
+
import { useEntityPaymentMethodsQuery as r, useEntitySettingsQuery as i } from "../../../../data-access/dist/index5.js";
|
|
11
11
|
import "../../../../data-access/dist/index.js";
|
|
12
12
|
import { buildReceivablePreviewView as a, displaysBankAccount as o, hasReceivePaymentMethod as s } from "./preview.js";
|
|
13
13
|
import { useMemo as c } from "react";
|
|
@@ -5,123 +5,138 @@
|
|
|
5
5
|
import { getCounterpartEmail as e } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
6
6
|
import { useCounterpartQuery as t } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
7
7
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
8
|
-
import { applyRecurrenceEmailDraft as n, buildRecurrenceEmailView as r, buildRecurrenceView as i, clearRecurrenceRecipients as a, createRecurrenceEmailDraft as o,
|
|
9
|
-
import { useCallback as
|
|
8
|
+
import { applyRecurrenceEmailDraft as n, buildRecurrenceEmailView as r, buildRecurrenceView as i, clearRecurrenceRecipients as a, createRecurrenceEmailDraft as o, resetRecurrenceRecipientsTo as s, selectRecurrenceDate as c, selectRecurrenceDayOfWeek as l, selectRecurrenceEndMode as u, selectRecurrenceFrequency as d, selectRecurrenceIssueMode as f, shouldOpenRecurrenceEmail as p } from "./recurrence.js";
|
|
9
|
+
import { useCallback as m, useEffect as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
10
10
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js
|
|
11
|
-
var
|
|
11
|
+
var y = [
|
|
12
12
|
"recurrenceStartDate",
|
|
13
13
|
"recurrenceEndDate",
|
|
14
14
|
"recurrenceIssueMode",
|
|
15
15
|
"recurrenceDayOfWeek",
|
|
16
16
|
"recurrenceEndMode",
|
|
17
17
|
"recurrenceMaxOccurrences"
|
|
18
|
-
],
|
|
18
|
+
], b = [
|
|
19
19
|
"recurrenceSubject",
|
|
20
20
|
"recurrenceBody",
|
|
21
21
|
"recurrenceRecipientsTo",
|
|
22
22
|
"recurrenceRecipientsCc",
|
|
23
23
|
"recurrenceRecipientsBcc"
|
|
24
24
|
];
|
|
25
|
-
function
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
]),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
function x({ values: x, errors: S, lockSchedule: C, messages: w, onChange: T, onClearErrors: E, onRevalidateErrors: D }) {
|
|
26
|
+
let O = t(x.customerId || void 0), k = x.customerEmail.trim() || (O.data ? e(O.data).trim() : ""), [A, j] = v(!1), [M, N] = v(x), [P, F] = v(null), I = g(() => P ?? o(M, k), [
|
|
27
|
+
k,
|
|
28
|
+
P,
|
|
29
|
+
M
|
|
30
|
+
]), L = _({
|
|
31
|
+
id: x.customerId,
|
|
32
|
+
email: k
|
|
33
|
+
});
|
|
34
|
+
h(() => {
|
|
35
|
+
if (!k && O.isLoading) return;
|
|
36
|
+
let e = L.current;
|
|
37
|
+
L.current = {
|
|
38
|
+
id: x.customerId,
|
|
39
|
+
email: k
|
|
40
|
+
}, e.email && e.email !== k && T(e.id === x.customerId ? s : a);
|
|
41
|
+
}, [
|
|
42
|
+
O.isLoading,
|
|
43
|
+
k,
|
|
44
|
+
T,
|
|
45
|
+
x.customerId
|
|
46
|
+
]);
|
|
47
|
+
let R = m((e) => {
|
|
48
|
+
N(e), F(null), j(!0);
|
|
37
49
|
}, []);
|
|
38
50
|
return {
|
|
39
|
-
view:
|
|
40
|
-
fields:
|
|
41
|
-
errors:
|
|
42
|
-
lockSchedule:
|
|
43
|
-
messages:
|
|
51
|
+
view: g(() => i({
|
|
52
|
+
fields: x,
|
|
53
|
+
errors: S,
|
|
54
|
+
lockSchedule: C,
|
|
55
|
+
messages: w
|
|
44
56
|
}), [
|
|
45
|
-
x,
|
|
46
57
|
S,
|
|
47
58
|
C,
|
|
48
|
-
|
|
59
|
+
w,
|
|
60
|
+
x
|
|
49
61
|
]),
|
|
50
|
-
emailView:
|
|
51
|
-
open:
|
|
52
|
-
ready: !
|
|
53
|
-
draft:
|
|
54
|
-
messages:
|
|
62
|
+
emailView: g(() => r({
|
|
63
|
+
open: A,
|
|
64
|
+
ready: !O.isLoading,
|
|
65
|
+
draft: I,
|
|
66
|
+
messages: w
|
|
55
67
|
}), [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
O.isLoading,
|
|
69
|
+
I,
|
|
70
|
+
A,
|
|
71
|
+
w
|
|
60
72
|
]),
|
|
61
|
-
changeFrequency:
|
|
62
|
-
|
|
63
|
-
}, [
|
|
64
|
-
changeMonthDay:
|
|
65
|
-
|
|
73
|
+
changeFrequency: m((e) => {
|
|
74
|
+
E(y), T((t) => d(t, e));
|
|
75
|
+
}, [T, E]),
|
|
76
|
+
changeMonthDay: m((e) => {
|
|
77
|
+
D(["recurrenceIssueMode"]), T((t) => f(t, e, { lockSchedule: C }));
|
|
66
78
|
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
C,
|
|
80
|
+
T,
|
|
81
|
+
D
|
|
70
82
|
]),
|
|
71
|
-
changeWeekday:
|
|
72
|
-
|
|
83
|
+
changeWeekday: m((e) => {
|
|
84
|
+
C || (E(["recurrenceStartDate"]), D(["recurrenceDayOfWeek"]), T((t) => l(t, e, { lockSchedule: C })));
|
|
73
85
|
}, [
|
|
74
|
-
|
|
75
|
-
w,
|
|
86
|
+
C,
|
|
76
87
|
T,
|
|
77
|
-
E
|
|
88
|
+
E,
|
|
89
|
+
D
|
|
78
90
|
]),
|
|
79
|
-
changeStartDate:
|
|
80
|
-
|
|
81
|
-
}, [
|
|
82
|
-
changeEndDate:
|
|
83
|
-
|
|
84
|
-
}, [
|
|
85
|
-
changeEndMode:
|
|
86
|
-
|
|
87
|
-
}, [
|
|
88
|
-
changeMaxOccurrences:
|
|
89
|
-
|
|
91
|
+
changeStartDate: m((e) => {
|
|
92
|
+
D(["recurrenceStartDate"]), T((t) => c(t, "recurrenceStartDate", e));
|
|
93
|
+
}, [T, D]),
|
|
94
|
+
changeEndDate: m((e) => {
|
|
95
|
+
D(["recurrenceEndDate"]), T((t) => c(t, "recurrenceEndDate", e));
|
|
96
|
+
}, [T, D]),
|
|
97
|
+
changeEndMode: m((e) => {
|
|
98
|
+
D(["recurrenceEndMode"]), T((t) => u(t, e));
|
|
99
|
+
}, [T, D]),
|
|
100
|
+
changeMaxOccurrences: m((e) => {
|
|
101
|
+
D(["recurrenceMaxOccurrences"]), T((t) => ({
|
|
90
102
|
...t,
|
|
91
103
|
recurrenceMaxOccurrences: e
|
|
92
104
|
}));
|
|
93
|
-
}, [
|
|
94
|
-
changeCreationMode:
|
|
105
|
+
}, [T, D]),
|
|
106
|
+
changeCreationMode: m((e) => {
|
|
95
107
|
let t = {
|
|
96
|
-
...
|
|
108
|
+
...x,
|
|
97
109
|
recurrenceAutomationLevel: e
|
|
98
110
|
};
|
|
99
|
-
|
|
111
|
+
T((t) => ({
|
|
100
112
|
...t,
|
|
101
113
|
recurrenceAutomationLevel: e
|
|
102
|
-
})),
|
|
114
|
+
})), p(t, e) && R(t);
|
|
103
115
|
}, [
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
116
|
+
T,
|
|
117
|
+
R,
|
|
118
|
+
x
|
|
107
119
|
]),
|
|
108
|
-
setUpEmail:
|
|
109
|
-
changeEmailOpen:
|
|
110
|
-
changeEmail:
|
|
111
|
-
...n ??
|
|
120
|
+
setUpEmail: m(() => R(x), [R, x]),
|
|
121
|
+
changeEmailOpen: j,
|
|
122
|
+
changeEmail: m((e, t) => F((n) => ({
|
|
123
|
+
...n ?? I,
|
|
112
124
|
[e]: t
|
|
113
|
-
})), [
|
|
114
|
-
saveEmail:
|
|
115
|
-
|
|
125
|
+
})), [I]),
|
|
126
|
+
saveEmail: m(() => {
|
|
127
|
+
T((e) => n(e, I)), E(b), j(!1);
|
|
116
128
|
}, [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
129
|
+
I,
|
|
130
|
+
T,
|
|
131
|
+
E
|
|
120
132
|
]),
|
|
121
|
-
reset:
|
|
122
|
-
|
|
133
|
+
reset: m(() => {
|
|
134
|
+
j(!1), L.current = {
|
|
135
|
+
id: "",
|
|
136
|
+
email: ""
|
|
137
|
+
};
|
|
123
138
|
}, [])
|
|
124
139
|
};
|
|
125
140
|
}
|
|
126
141
|
//#endregion
|
|
127
|
-
export {
|
|
142
|
+
export { x as useReceivableRecurrence };
|
|
@@ -8,26 +8,26 @@ import { usePaymentTermsQuery as n } from "../../../../../shared/data-access/dis
|
|
|
8
8
|
import "../../../../../shared/ui/dist/index.js";
|
|
9
9
|
import { useWidgetConfig as r } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
10
|
import "../../../../../shared/feature/dist/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import { useCreateOverdueReminderMutation as f, useCreatePaymentReminderMutation as p, useOverdueRemindersQuery as m, usePaymentRemindersQuery as h } from "../../../../data-access/dist/index14.js";
|
|
11
|
+
import { useCreateOverdueReminderMutation as i, useCreatePaymentReminderMutation as a, useOverdueRemindersQuery as o, usePaymentRemindersQuery as s } from "../../../../data-access/dist/index15.js";
|
|
13
12
|
import "../../../../data-access/dist/index.js";
|
|
13
|
+
import { areOverdueTermsValid as c, buildOverdueReminderPayload as l, buildPaymentReminderPayload as u, buildRemindersView as d, canCreateReminders as f, getImpliedDueDate as p, isBeforeDueDaysValid as m, sanitizeReminderDays as h } from "./reminders.js";
|
|
14
14
|
import { useCallback as g, useMemo as _, useState as v } from "react";
|
|
15
15
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js
|
|
16
16
|
var y = [""];
|
|
17
17
|
function b({ open: b, isInvoice: x, disabled: S, paymentTermsId: C, paymentTermsCustomDate: w, paymentReminderId: T, overdueReminderId: E, messages: D, onSelect: O }) {
|
|
18
|
-
let { initResponse: k } = r(), A = n().data?.data, j = _(() =>
|
|
18
|
+
let { initResponse: k } = r(), A = n().data?.data, j = _(() => f(k?.scopes), [k?.scopes]), [M, N] = v(!1), [P, F] = v(""), [I, L] = v(y), R = b && x && M, z = s({ enabled: R }), B = o({ enabled: R }), V = a(), H = i(), U = g((e) => {
|
|
19
19
|
N(e), F(""), L(y);
|
|
20
20
|
}, []), W = g((e) => {
|
|
21
21
|
e || (O({
|
|
22
22
|
paymentReminderId: "",
|
|
23
23
|
overdueReminderId: ""
|
|
24
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(
|
|
26
|
-
let n =
|
|
25
|
+
}, [O]), G = g((e) => O({ paymentReminderId: e }), [O]), K = g((e) => O({ overdueReminderId: e }), [O]), q = g((e) => F(h(e)), []), J = g((e, t) => {
|
|
26
|
+
let n = h(t);
|
|
27
27
|
L((t) => t.map((t, r) => r === e ? n : t));
|
|
28
28
|
}, []), Y = g(() => {
|
|
29
29
|
L((e) => e.length < 3 ? [...e, ""] : e);
|
|
30
|
-
}, []), X = g(() => L(y), []), Z = g(() =>
|
|
30
|
+
}, []), X = g(() => L(y), []), Z = g(() => p({
|
|
31
31
|
paymentTermsId: C,
|
|
32
32
|
paymentTermsCustomDate: w,
|
|
33
33
|
paymentTerms: A,
|
|
@@ -37,8 +37,8 @@ function b({ open: b, isInvoice: x, disabled: S, paymentTermsId: C, paymentTerms
|
|
|
37
37
|
w,
|
|
38
38
|
C
|
|
39
39
|
]), Q = g(async () => {
|
|
40
|
-
if (
|
|
41
|
-
let t = await V.mutateAsync({ body:
|
|
40
|
+
if (m(P)) try {
|
|
41
|
+
let t = await V.mutateAsync({ body: u({
|
|
42
42
|
daysBefore: Number(P),
|
|
43
43
|
dueDate: Z(),
|
|
44
44
|
messages: D
|
|
@@ -54,8 +54,8 @@ function b({ open: b, isInvoice: x, disabled: S, paymentTermsId: C, paymentTerms
|
|
|
54
54
|
D,
|
|
55
55
|
O
|
|
56
56
|
]), $ = g(async () => {
|
|
57
|
-
if (
|
|
58
|
-
let t = await H.mutateAsync({ body:
|
|
57
|
+
if (c(I)) try {
|
|
58
|
+
let t = await H.mutateAsync({ body: l({
|
|
59
59
|
terms: I,
|
|
60
60
|
dueDate: Z(),
|
|
61
61
|
messages: D
|
|
@@ -72,7 +72,7 @@ function b({ open: b, isInvoice: x, disabled: S, paymentTermsId: C, paymentTerms
|
|
|
72
72
|
I
|
|
73
73
|
]);
|
|
74
74
|
return {
|
|
75
|
-
view: _(() => x ?
|
|
75
|
+
view: _(() => x ? d({
|
|
76
76
|
showReminders: M,
|
|
77
77
|
paymentTermsId: C,
|
|
78
78
|
paymentTermsCustomDate: w,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { useReceivablesAnalyticsQuery as e } from "../../../../data-access/dist/
|
|
5
|
+
import { useReceivablesAnalyticsQuery as e } from "../../../../data-access/dist/index16.js";
|
|
6
6
|
import "../../../../data-access/dist/index.js";
|
|
7
7
|
import { buildReceivableStatusCardsView as t } from "./statusCards.js";
|
|
8
8
|
import { useMemo as n } from "react";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { useReceivablesQuery as t } from "../../../../data-access/dist/index13.js";
|
|
5
|
+
import { useReceivablesQuery as e } from "../../../../data-access/dist/index14.js";
|
|
7
6
|
import "../../../../data-access/dist/index.js";
|
|
7
|
+
import { buildReceivableRows as t } from "./helpers.js";
|
|
8
8
|
import { useInvoicesFilter as n } from "./useInvoicesFilter.js";
|
|
9
9
|
import { useReceivableCustomerNames as r } from "./useReceivableCustomerNames.js";
|
|
10
10
|
import { useReceivableStatusCards as i } from "./useReceivableStatusCards.js";
|
|
@@ -29,7 +29,7 @@ function d({ initialCounterpartId: d, messages: p, statusLabels: m, filterLabels
|
|
|
29
29
|
}, 300);
|
|
30
30
|
return () => clearTimeout(e);
|
|
31
31
|
}, [T]);
|
|
32
|
-
let j = y[0]?.id, M = j ? f[j] : void 0, N = y[0] ? y[0].desc ? "desc" : "asc" : void 0, P =
|
|
32
|
+
let j = y[0]?.id, M = j ? f[j] : void 0, N = y[0] ? y[0].desc ? "desc" : "asc" : void 0, P = e({
|
|
33
33
|
enabled: _,
|
|
34
34
|
type: "invoice",
|
|
35
35
|
limit: x,
|
|
@@ -46,7 +46,7 @@ function d({ initialCounterpartId: d, messages: p, statusLabels: m, filterLabels
|
|
|
46
46
|
statusFilter: A.cardStatus,
|
|
47
47
|
messages: p,
|
|
48
48
|
statusLabels: m
|
|
49
|
-
}), I = P.data?.data ?? l, L = s(() => new Map(I.map((e) => [e.id, e])), [I]), R = a((e) => L.get(e), [L]), z = r(I), B = s(() =>
|
|
49
|
+
}), I = P.data?.data ?? l, L = s(() => new Map(I.map((e) => [e.id, e])), [I]), R = a((e) => L.get(e), [L]), z = r(I), B = s(() => t({
|
|
50
50
|
receivables: I,
|
|
51
51
|
messages: p,
|
|
52
52
|
customerNames: z
|