@tesouro/embedded-components-react 0.11.86 → 0.11.88
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/fixtures/index.d.ts +243 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index.js +19 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index10.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index11.js +5 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index12.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index13.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index14.js +13 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index15.js +30 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index16.js +23 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index17.js +26 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +12 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +48 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index20.js +35 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +13 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +31 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js +26 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index24.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +8 -76
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index5.js +60 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index6.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index7.js +12 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index8.js +20 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index9.js +16 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +1 -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/index28.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +126 -108
- 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/index41.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -2,32 +2,38 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { postPaymentIntentsIdCancel as e } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
6
|
import { useEmbedApi as t } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
7
|
import { organizationHeaders as n } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
8
8
|
import "../../../../shared/data-access/dist/index.js";
|
|
9
9
|
import { invalidatePayableQueries as r } from "../../../data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js";
|
|
10
|
+
import { reconcileCancelledPaymentQueries as i } from "../../../data-access/dist/lib/invalidatePayableQueries/reconcileCancelledPaymentQueries.js";
|
|
10
11
|
import "../../../data-access/dist/invalidation.js";
|
|
11
|
-
import { useMutation as
|
|
12
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
12
13
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index8.js
|
|
13
|
-
function
|
|
14
|
-
let { client:
|
|
15
|
-
return
|
|
16
|
-
mutationFn: async ({
|
|
14
|
+
function o() {
|
|
15
|
+
let { client: o, organizationId: s } = t();
|
|
16
|
+
return a({
|
|
17
|
+
mutationFn: async ({ path: t }) => {
|
|
17
18
|
let { data: r } = await e({
|
|
18
|
-
client:
|
|
19
|
-
headers: n(
|
|
20
|
-
|
|
19
|
+
client: o,
|
|
20
|
+
headers: n(s),
|
|
21
|
+
path: t,
|
|
21
22
|
throwOnError: !0
|
|
22
23
|
});
|
|
23
24
|
return r;
|
|
24
25
|
},
|
|
25
|
-
onSuccess: async () => {
|
|
26
|
+
onSuccess: async (e, t) => {
|
|
26
27
|
await r({
|
|
27
|
-
client:
|
|
28
|
-
organizationId:
|
|
29
|
-
|
|
28
|
+
client: o,
|
|
29
|
+
organizationId: s,
|
|
30
|
+
payableId: t.payableId
|
|
31
|
+
}), i({
|
|
32
|
+
client: o,
|
|
33
|
+
organizationId: s,
|
|
34
|
+
payableId: t.payableId
|
|
35
|
+
}).catch(() => {});
|
|
30
36
|
}
|
|
31
37
|
});
|
|
32
38
|
}
|
|
33
|
-
export {
|
|
39
|
+
export { o as useCancelScheduledPaymentMutation };
|
|
@@ -2,32 +2,30 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { postPayables as e } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
6
|
import { useEmbedApi as t } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
7
|
import { organizationHeaders as n } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
8
8
|
import "../../../../shared/data-access/dist/index.js";
|
|
9
9
|
import { invalidatePayableQueries as r } from "../../../data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js";
|
|
10
10
|
import "../../../data-access/dist/invalidation.js";
|
|
11
|
-
import {
|
|
11
|
+
import { dataOrThrowWithStatus as i } from "./index4.js";
|
|
12
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
12
13
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index9.js
|
|
13
|
-
function
|
|
14
|
-
let { client:
|
|
15
|
-
return
|
|
16
|
-
mutationFn: async ({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
onSuccess: async (e, t) => {
|
|
14
|
+
function o() {
|
|
15
|
+
let { client: o, organizationId: s } = t();
|
|
16
|
+
return a({
|
|
17
|
+
mutationFn: async ({ body: t }) => i(e({
|
|
18
|
+
client: o,
|
|
19
|
+
headers: n(s),
|
|
20
|
+
body: t,
|
|
21
|
+
throwOnError: !1
|
|
22
|
+
})),
|
|
23
|
+
onSuccess: async () => {
|
|
25
24
|
await r({
|
|
26
|
-
client:
|
|
27
|
-
organizationId:
|
|
28
|
-
payableId: t.path.payable_id
|
|
25
|
+
client: o,
|
|
26
|
+
organizationId: s
|
|
29
27
|
});
|
|
30
28
|
}
|
|
31
29
|
});
|
|
32
30
|
}
|
|
33
|
-
export {
|
|
31
|
+
export { o as useCreatePayableMutation };
|
|
@@ -7,11 +7,11 @@ import "../../../../shared/ui/dist/index.js";
|
|
|
7
7
|
import { useWidgetConfig as t } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
8
8
|
import "../../../../shared/feature/dist/index.js";
|
|
9
9
|
import { useApprovePayableApprovalRequestMutation as n, useRejectPayableApprovalRequestMutation as r } from "../../data-access/dist/index2.js";
|
|
10
|
-
import { useCancelPayableMutation as i } from "../../data-access/dist/
|
|
11
|
-
import { useCancelScheduledPaymentMutation as a } from "../../data-access/dist/
|
|
12
|
-
import { useForceApprovePayableMutation as o } from "../../data-access/dist/
|
|
13
|
-
import { useForceRejectPayableMutation as s } from "../../data-access/dist/
|
|
14
|
-
import { useReopenPayableMutation as c } from "../../data-access/dist/
|
|
10
|
+
import { useCancelPayableMutation as i } from "../../data-access/dist/index7.js";
|
|
11
|
+
import { useCancelScheduledPaymentMutation as a } from "../../data-access/dist/index8.js";
|
|
12
|
+
import { useForceApprovePayableMutation as o } from "../../data-access/dist/index12.js";
|
|
13
|
+
import { useForceRejectPayableMutation as s } from "../../data-access/dist/index13.js";
|
|
14
|
+
import { useReopenPayableMutation as c } from "../../data-access/dist/index14.js";
|
|
15
15
|
import "../../data-access/dist/index.js";
|
|
16
16
|
import { getBillDetailActions as l } from "./index5.js";
|
|
17
17
|
import { useState as u } from "react";
|
|
@@ -9,7 +9,7 @@ import { useWidgetConfig as n } from "../../../../shared/feature/dist/lib/Widget
|
|
|
9
9
|
import "../../../../shared/feature/dist/index.js";
|
|
10
10
|
import { isLiveScheduledPaymentRecord as r } from "../../../util/dist/lib/isLiveScheduledPaymentRecord.js";
|
|
11
11
|
import "../../../util/dist/index.js";
|
|
12
|
-
import { usePayablePaymentRecordsQuery as i } from "../../data-access/dist/
|
|
12
|
+
import { usePayablePaymentRecordsQuery as i } from "../../data-access/dist/index19.js";
|
|
13
13
|
import "../../data-access/dist/index.js";
|
|
14
14
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js
|
|
15
15
|
function a({ payableId: a, scheduledPaymentDate: o, enabled: s = !0 }) {
|
|
@@ -9,7 +9,7 @@ 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 { useDeletePayableMutation as i } from "../../data-access/dist/
|
|
12
|
+
import { useDeletePayableMutation as i } from "../../data-access/dist/index11.js";
|
|
13
13
|
import "../../data-access/dist/index.js";
|
|
14
14
|
import { useState as a } from "react";
|
|
15
15
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js
|
|
@@ -15,6 +15,7 @@ var g = {
|
|
|
15
15
|
unknownValidationField: "(unknown field)",
|
|
16
16
|
requiredField: "This field is required.",
|
|
17
17
|
saveFailed: "We could not save this bill. Try again.",
|
|
18
|
+
saveRejected: (e) => `We could not save this bill. ${e}`,
|
|
18
19
|
discountTaxBlockedByLineItems: "Discount and Tax can't be saved on a bill with line items. Remove them, then save again.",
|
|
19
20
|
vendorResolutionFailed: "We couldn't create this vendor automatically. Select or add a vendor before submitting.",
|
|
20
21
|
finalizeFailed: "We could not submit this bill. Try again.",
|
|
@@ -6,7 +6,7 @@ import { createSourceDocumentPreview as e } from "./index27.js";
|
|
|
6
6
|
import { SourceDocumentPanel as t } from "../../ui/dist/index49.js";
|
|
7
7
|
import "../../ui/dist/index.js";
|
|
8
8
|
import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as n } from "./index28.js";
|
|
9
|
-
import { useAttachPayableFileMutation as r } from "../../data-access/dist/
|
|
9
|
+
import { useAttachPayableFileMutation as r } from "../../data-access/dist/index6.js";
|
|
10
10
|
import "../../data-access/dist/index.js";
|
|
11
11
|
import { useEffect as i, useState as a } from "react";
|
|
12
12
|
import { jsx as o } from "react/jsx-runtime";
|
|
@@ -10,7 +10,7 @@ import "../../../../shared/ui/dist/index.js";
|
|
|
10
10
|
import { useWidgetConfig as n } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
11
|
import "../../../../shared/feature/dist/index.js";
|
|
12
12
|
import { VENDOR_SECTION_PROPS_LABELS_EN as r } from "./index28.js";
|
|
13
|
-
import { usePayableSuggestionsQuery as i } from "../../data-access/dist/
|
|
13
|
+
import { usePayableSuggestionsQuery as i } from "../../data-access/dist/index20.js";
|
|
14
14
|
import "../../data-access/dist/index.js";
|
|
15
15
|
import { resolvePaymentInstructionsGestures as a } from "./index14.js";
|
|
16
16
|
import { COUNTERPART_MESSAGE_LABELS_EN as o } from "../../../../shared/counterpart-management/feature/dist/lib/labels.js";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import "../../../../shared/ui/dist/index.js";
|
|
7
|
-
import { useUpdatePayableMutation as t } from "../../data-access/dist/
|
|
7
|
+
import { useUpdatePayableMutation as t } from "../../data-access/dist/index16.js";
|
|
8
8
|
import "../../data-access/dist/index.js";
|
|
9
9
|
import { cloneElement as n, isValidElement as r, useCallback as i, useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
10
10
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js
|
|
@@ -5,46 +5,59 @@
|
|
|
5
5
|
import { toast as e } from "../../../../../../packages/shared-ui-shadcn/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
|
+
import { isApiConflictError as n } from "../../../../shared/data-access/dist/lib/isApiConflictError.js";
|
|
9
|
+
import { isApiUnprocessableError as r } from "../../../../shared/data-access/dist/lib/isApiUnprocessableError.js";
|
|
10
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
8
11
|
import "../../../../shared/ui/dist/index.js";
|
|
9
|
-
import { BILL_CREATE_MESSAGE_LABELS_EN as
|
|
10
|
-
import { encodeFileToBase64 as
|
|
11
|
-
import { mapBillFormToPayload as
|
|
12
|
-
import { validateBillCompleteness as
|
|
13
|
-
import { useReplacePayableLineItemsMutation as
|
|
14
|
-
import { useCreatePayableMutation as
|
|
15
|
-
import { useDeletePayableFileMutation as
|
|
16
|
-
import { useSubmitPayableForApprovalMutation as
|
|
17
|
-
import { useUpdatePayableMutation as
|
|
18
|
-
import { useValidatePayableMutation as
|
|
12
|
+
import { BILL_CREATE_MESSAGE_LABELS_EN as i } from "./index28.js";
|
|
13
|
+
import { encodeFileToBase64 as a } from "./index34.js";
|
|
14
|
+
import { mapBillFormToPayload as o, mapLineItemsToPayload as s, mapPayableAmountFieldsToPayload as c } from "./index35.js";
|
|
15
|
+
import { validateBillCompleteness as l, validateBillTotalIsPayable as u, validateBillTotals as d, validateBillValues as f, validateLineItems as p, validateStoredAmountDue as ee } from "./index36.js";
|
|
16
|
+
import { useReplacePayableLineItemsMutation as m } from "../../data-access/dist/index5.js";
|
|
17
|
+
import { useCreatePayableMutation as h } from "../../data-access/dist/index9.js";
|
|
18
|
+
import { useDeletePayableFileMutation as g } from "../../data-access/dist/index10.js";
|
|
19
|
+
import { useSubmitPayableForApprovalMutation as te } from "../../data-access/dist/index15.js";
|
|
20
|
+
import { useUpdatePayableMutation as ne } from "../../data-access/dist/index16.js";
|
|
21
|
+
import { useValidatePayableMutation as re } from "../../data-access/dist/index17.js";
|
|
19
22
|
import "../../data-access/dist/index.js";
|
|
20
|
-
import { useCallback as _, useRef as
|
|
23
|
+
import { useCallback as _, useRef as v, useState as y } from "react";
|
|
21
24
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js
|
|
22
|
-
var
|
|
25
|
+
var b = {
|
|
23
26
|
document_id: "invoiceNumber",
|
|
24
27
|
issued_at: "invoiceDate",
|
|
25
28
|
due_date: "dueDate",
|
|
26
29
|
counterpart_id: "vendor",
|
|
27
30
|
purchase_order_number: "poNumber"
|
|
28
|
-
},
|
|
29
|
-
function
|
|
31
|
+
}, x = { tax_amount: "tax" };
|
|
32
|
+
function S(e) {
|
|
30
33
|
return e.type === "type_error.none.not_allowed" || e.msg === "none is not an allowed value";
|
|
31
34
|
}
|
|
32
|
-
var
|
|
33
|
-
function
|
|
35
|
+
var ie = "pending-vendor";
|
|
36
|
+
function C(e) {
|
|
34
37
|
return !!t(e)?.includes("line_items_enabled");
|
|
35
38
|
}
|
|
36
|
-
function
|
|
39
|
+
function w(e) {
|
|
37
40
|
return !!t(e)?.includes("A vendor could not be linked or created for this payable");
|
|
38
41
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
function T(e) {
|
|
43
|
+
if (!n(e) && !r(e) || typeof e != "object" || !e || !("error" in e)) return;
|
|
44
|
+
let t = e.error;
|
|
45
|
+
if (typeof t == "object" && t && "message" in t) return typeof t.message == "string" && t.message.trim() ? t.message : void 0;
|
|
46
|
+
}
|
|
47
|
+
function E(e, t) {
|
|
48
|
+
if (C(e)) return t.discountTaxBlockedByLineItems;
|
|
49
|
+
let n = T(e);
|
|
50
|
+
return n ? t.saveRejected(n) : t.saveFailed;
|
|
51
|
+
}
|
|
52
|
+
function D(e, t = i) {
|
|
53
|
+
let n = {}, r = {}, a = [];
|
|
54
|
+
for (let i of e) {
|
|
55
|
+
let e = i.loc[0] ?? t.unknownValidationField, o = b[e], s = x[e], c = S(i) ? t.requiredField : i.msg;
|
|
56
|
+
o ? n[o] = c : s ? r[s] = c : a.push(t.unmappedValidationError(e, c));
|
|
44
57
|
}
|
|
45
|
-
return a.length && (
|
|
46
|
-
formErrors:
|
|
47
|
-
totalsErrors: Object.keys(
|
|
58
|
+
return a.length && (n.form = a.join(" ")), {
|
|
59
|
+
formErrors: n,
|
|
60
|
+
totalsErrors: Object.keys(r).length ? r : void 0
|
|
48
61
|
};
|
|
49
62
|
}
|
|
50
63
|
function ae(e, t) {
|
|
@@ -56,76 +69,76 @@ function ae(e, t) {
|
|
|
56
69
|
};
|
|
57
70
|
return n;
|
|
58
71
|
}
|
|
59
|
-
function
|
|
72
|
+
function O({ payableId: t, form: n, counterpartId: r, isVendorPending: b, onVendorIncomplete: x, clearCounterpart: S, prepareVendorForSave: C, onSaved: T, onPayableCreated: O, readSavedStatus: k, onDraftSaved: A, onFinalized: j, labels: M }) {
|
|
60
73
|
let N = {
|
|
61
|
-
...
|
|
74
|
+
...i,
|
|
62
75
|
...M
|
|
63
|
-
}, [P, F] =
|
|
64
|
-
let t =
|
|
65
|
-
return
|
|
76
|
+
}, [P, F] = y(), I = t ?? P, [L, R] = y(), oe = _(() => R(void 0), []), [z, B] = y(!1), se = _(() => B(!0), []), [V, H] = y(), U = v(!1), [ce, le] = y(0), W = _(() => le((e) => e + 1), []), G = h(), K = g(), q = ne(), J = m(), Y = re(), X = te(), Z = _(() => n.isTotalsDirty ? d(n.discount, n.tax, n.totalOverride, N) : void 0, [n, N]), Q = _(() => {
|
|
77
|
+
let t = f(n.values, N), r = p(n.lineItems, N), i = Z();
|
|
78
|
+
return n.setErrors(t), n.setLineItemErrors(r), n.setTotalsErrors(i), !t && !r && !i || (r && e.error(N.lineItemsNeedAttention), W(), !1);
|
|
66
79
|
}, [
|
|
67
|
-
|
|
80
|
+
n,
|
|
68
81
|
N,
|
|
69
82
|
W,
|
|
70
83
|
Z
|
|
71
|
-
]), $ = _(async (e, t,
|
|
72
|
-
let
|
|
73
|
-
base64EncodedFile: await
|
|
84
|
+
]), $ = _(async (e, t, i) => {
|
|
85
|
+
let l = !I && L ? {
|
|
86
|
+
base64EncodedFile: await a(L),
|
|
74
87
|
fileName: L.name
|
|
75
|
-
} : void 0,
|
|
76
|
-
discount:
|
|
77
|
-
tax:
|
|
78
|
-
total:
|
|
79
|
-
} : void 0,
|
|
80
|
-
values:
|
|
81
|
-
initialLineItems: I ? void 0 :
|
|
82
|
-
counterpartId: t ??
|
|
83
|
-
clearCounterpart:
|
|
88
|
+
} : void 0, u = n.isTotalsDirty ? {
|
|
89
|
+
discount: n.discount,
|
|
90
|
+
tax: n.tax,
|
|
91
|
+
total: n.totalOverride
|
|
92
|
+
} : void 0, d = o({
|
|
93
|
+
values: n.values,
|
|
94
|
+
initialLineItems: I ? void 0 : n.lineItems,
|
|
95
|
+
counterpartId: t ?? r,
|
|
96
|
+
clearCounterpart: S,
|
|
84
97
|
counterpartBankAccountId: e,
|
|
85
98
|
currentTotals: {
|
|
86
|
-
discount:
|
|
87
|
-
tax:
|
|
88
|
-
total:
|
|
99
|
+
discount: n.discount,
|
|
100
|
+
tax: n.tax,
|
|
101
|
+
total: n.totalOverride
|
|
89
102
|
},
|
|
90
|
-
lineItems:
|
|
91
|
-
editedTotals:
|
|
92
|
-
document:
|
|
93
|
-
}),
|
|
94
|
-
...
|
|
95
|
-
counterpart_raw_data:
|
|
96
|
-
} :
|
|
97
|
-
if (
|
|
98
|
-
path: { payable_id:
|
|
99
|
-
body:
|
|
100
|
-
}) : (
|
|
103
|
+
lineItems: n.lineItems,
|
|
104
|
+
editedTotals: u,
|
|
105
|
+
document: l
|
|
106
|
+
}), f = i ? {
|
|
107
|
+
...d,
|
|
108
|
+
counterpart_raw_data: i
|
|
109
|
+
} : d, p = I;
|
|
110
|
+
if (p ? await q.mutateAsync({
|
|
111
|
+
path: { payable_id: p },
|
|
112
|
+
body: f
|
|
113
|
+
}) : (p = (await G.mutateAsync({ body: f }))?.id, p && (F(p), O?.(p), l && R(void 0))), !p) throw Error("Payable was created without an id");
|
|
101
114
|
if (z) {
|
|
102
115
|
try {
|
|
103
|
-
await K.mutateAsync({ path: { payable_id:
|
|
116
|
+
await K.mutateAsync({ path: { payable_id: p } });
|
|
104
117
|
} catch {}
|
|
105
118
|
B(!1);
|
|
106
119
|
}
|
|
107
120
|
return await J.mutateAsync({
|
|
108
|
-
path: { payable_id:
|
|
109
|
-
body: { data:
|
|
110
|
-
}),
|
|
111
|
-
path: { payable_id:
|
|
112
|
-
body:
|
|
113
|
-
lineItems:
|
|
114
|
-
editedTotals:
|
|
121
|
+
path: { payable_id: p },
|
|
122
|
+
body: { data: s(n.lineItems) }
|
|
123
|
+
}), u && await q.mutateAsync({
|
|
124
|
+
path: { payable_id: p },
|
|
125
|
+
body: c({
|
|
126
|
+
lineItems: n.lineItems,
|
|
127
|
+
editedTotals: u
|
|
115
128
|
})
|
|
116
|
-
}),
|
|
129
|
+
}), p;
|
|
117
130
|
}, [
|
|
118
|
-
|
|
119
|
-
|
|
131
|
+
r,
|
|
132
|
+
S,
|
|
120
133
|
G,
|
|
121
134
|
K,
|
|
122
135
|
z,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
136
|
+
n.discount,
|
|
137
|
+
n.isTotalsDirty,
|
|
138
|
+
n.lineItems,
|
|
139
|
+
n.tax,
|
|
140
|
+
n.totalOverride,
|
|
141
|
+
n.values,
|
|
129
142
|
O,
|
|
130
143
|
I,
|
|
131
144
|
J,
|
|
@@ -139,83 +152,88 @@ function w({ payableId: t, form: y, counterpartId: b, isVendorPending: x, onVend
|
|
|
139
152
|
if (!U.current && Q()) {
|
|
140
153
|
U.current = !0, H("draft");
|
|
141
154
|
try {
|
|
142
|
-
let t = await
|
|
155
|
+
let t = await C?.({ allowIncompleteVendor: !0 });
|
|
143
156
|
if (t && !t.ok) return;
|
|
144
|
-
let
|
|
145
|
-
|
|
146
|
-
let
|
|
147
|
-
return e.success(
|
|
157
|
+
let r = await $(t?.counterpartBankAccountId, t?.counterpartId, t?.counterpartRawData);
|
|
158
|
+
n.setErrors(void 0), T?.(r), A?.(r);
|
|
159
|
+
let i = await k?.();
|
|
160
|
+
return e.success(i === "draft" ? N.submittedDemoted : N.draftSaved), r;
|
|
148
161
|
} catch (e) {
|
|
149
|
-
|
|
162
|
+
n.setSaveFailureMessage(E(e, {
|
|
163
|
+
discountTaxBlockedByLineItems: N.discountTaxBlockedByLineItems,
|
|
164
|
+
saveFailed: N.saveFailed,
|
|
165
|
+
saveRejected: N.saveRejected
|
|
166
|
+
})), W();
|
|
150
167
|
return;
|
|
151
168
|
} finally {
|
|
152
169
|
H(void 0), U.current = !1;
|
|
153
170
|
}
|
|
154
171
|
}
|
|
155
172
|
}, [
|
|
156
|
-
|
|
173
|
+
n,
|
|
157
174
|
Q,
|
|
158
175
|
N.discountTaxBlockedByLineItems,
|
|
159
176
|
N.draftSaved,
|
|
160
177
|
N.saveFailed,
|
|
178
|
+
N.saveRejected,
|
|
161
179
|
N.submittedDemoted,
|
|
162
180
|
A,
|
|
163
|
-
|
|
181
|
+
T,
|
|
164
182
|
k,
|
|
165
|
-
|
|
183
|
+
C,
|
|
166
184
|
$,
|
|
167
185
|
W
|
|
168
186
|
]),
|
|
169
187
|
finalize: _(async () => {
|
|
170
188
|
if (U.current) return;
|
|
171
|
-
let t =
|
|
172
|
-
...
|
|
173
|
-
...
|
|
174
|
-
...
|
|
175
|
-
} : void 0, { formErrors:
|
|
176
|
-
|
|
177
|
-
let
|
|
178
|
-
...
|
|
179
|
-
...
|
|
189
|
+
let t = p(n.lineItems, N), i = f(n.values, N), a = Z(), o = u(n.total, N), s = n.isTotalsDirty ? ee(n.totalOverride, N) : void 0, c = a || o || s ? {
|
|
190
|
+
...s,
|
|
191
|
+
...o,
|
|
192
|
+
...a
|
|
193
|
+
} : void 0, { formErrors: d, lineItemErrors: m } = l(n.values, r ?? (b ? ie : void 0), n.lineItems, N), h = ae(m, t);
|
|
194
|
+
n.setLineItemErrors(h), n.setTotalsErrors(c);
|
|
195
|
+
let g = {
|
|
196
|
+
...d,
|
|
197
|
+
...i
|
|
180
198
|
};
|
|
181
|
-
if (
|
|
199
|
+
if (n.setErrors(Object.keys(g).length ? g : void 0), t && e.error(N.lineItemsNeedAttention), h || c || Object.keys(g).length) g.vendor && x?.(), W();
|
|
182
200
|
else {
|
|
183
201
|
U.current = !0, H("finalize");
|
|
184
202
|
try {
|
|
185
203
|
let t;
|
|
186
204
|
try {
|
|
187
|
-
let e = await
|
|
205
|
+
let e = await C?.();
|
|
188
206
|
if (e && !e.ok) return;
|
|
189
207
|
t = await $(e?.counterpartBankAccountId, e?.counterpartId);
|
|
190
208
|
} catch (e) {
|
|
191
|
-
|
|
209
|
+
n.setSaveFailureMessage(E(e, N)), W();
|
|
192
210
|
return;
|
|
193
211
|
}
|
|
194
|
-
|
|
212
|
+
T?.(t);
|
|
195
213
|
try {
|
|
196
|
-
let
|
|
197
|
-
if (
|
|
198
|
-
let e =
|
|
199
|
-
|
|
214
|
+
let r = await Y.mutateAsync({ path: { payable_id: t } });
|
|
215
|
+
if (r.validation_errors.length) {
|
|
216
|
+
let e = D(r.validation_errors, N);
|
|
217
|
+
n.setErrors(e.formErrors), n.setTotalsErrors(e.totalsErrors), W();
|
|
200
218
|
return;
|
|
201
219
|
}
|
|
202
|
-
await X.mutateAsync({ path: { payable_id: t } }),
|
|
220
|
+
await X.mutateAsync({ path: { payable_id: t } }), n.setErrors(void 0), j?.(t), e.success(N.billFinalized);
|
|
203
221
|
} catch (e) {
|
|
204
|
-
|
|
222
|
+
w(e) ? n.setErrors({ vendor: N.vendorResolutionFailed }) : n.setSaveFailureMessage(N.finalizeFailed), W();
|
|
205
223
|
}
|
|
206
224
|
} finally {
|
|
207
225
|
H(void 0), U.current = !1;
|
|
208
226
|
}
|
|
209
227
|
}
|
|
210
228
|
}, [
|
|
229
|
+
r,
|
|
211
230
|
b,
|
|
212
|
-
|
|
213
|
-
y,
|
|
231
|
+
n,
|
|
214
232
|
N,
|
|
215
233
|
j,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
234
|
+
T,
|
|
235
|
+
x,
|
|
236
|
+
C,
|
|
219
237
|
$,
|
|
220
238
|
W,
|
|
221
239
|
X,
|
|
@@ -236,4 +254,4 @@ function w({ payableId: t, form: y, counterpartId: b, isVendorPending: x, onVend
|
|
|
236
254
|
hasFileDeletionFailed: K.isError
|
|
237
255
|
};
|
|
238
256
|
}
|
|
239
|
-
export {
|
|
257
|
+
export { D as mapValidationErrorsToForm, O as useBillCreateController };
|
|
@@ -18,7 +18,7 @@ import "../../../util/dist/index.js";
|
|
|
18
18
|
import { derivePayableStatus as d } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
|
|
19
19
|
import { useApplyDuplicateVerdictsMutation as f } from "../../../data-access/dist/lib/useApplyDuplicateVerdictsMutation.js";
|
|
20
20
|
import "../../../data-access/dist/index.js";
|
|
21
|
-
import { usePayablesByIdsQueries as p } from "../../data-access/dist/
|
|
21
|
+
import { usePayablesByIdsQueries as p } from "../../data-access/dist/index23.js";
|
|
22
22
|
import "../../data-access/dist/index.js";
|
|
23
23
|
import { DUPLICATE_BILLS_LABELS_EN as m } from "./index3.js";
|
|
24
24
|
import { useCallback as h, useMemo as g, useState as _ } from "react";
|
|
@@ -26,8 +26,8 @@ import { ExtractionNotice as fe } from "../../ui/dist/index46.js";
|
|
|
26
26
|
import { UnsavedBillDialog as pe } from "../../ui/dist/index52.js";
|
|
27
27
|
import "../../ui/dist/index.js";
|
|
28
28
|
import { BILL_CREATE_MESSAGE_LABELS_EN as me, mergeBillDialogCopy as he } from "./index28.js";
|
|
29
|
-
import { useAllPayableLineItemsQuery as ge } from "../../data-access/dist/
|
|
30
|
-
import { usePayableQuery as _e } from "../../data-access/dist/
|
|
29
|
+
import { useAllPayableLineItemsQuery as ge } from "../../data-access/dist/index5.js";
|
|
30
|
+
import { usePayableQuery as _e } from "../../data-access/dist/index22.js";
|
|
31
31
|
import "../../data-access/dist/index.js";
|
|
32
32
|
import { useBillCreateController as ve } from "./index37.js";
|
|
33
33
|
import { useBillForm as ye } from "./index39.js";
|
|
@@ -18,8 +18,8 @@ import "../../../ui/dist/index.js";
|
|
|
18
18
|
import { BillDetailsSheet as c } from "../../ui/dist/index34.js";
|
|
19
19
|
import { BillDuplicateNotice as l } from "../../ui/dist/index37.js";
|
|
20
20
|
import "../../ui/dist/index.js";
|
|
21
|
-
import { useAllPayableLineItemsQuery as u } from "../../data-access/dist/
|
|
22
|
-
import { usePayableQuery as d } from "../../data-access/dist/
|
|
21
|
+
import { useAllPayableLineItemsQuery as u } from "../../data-access/dist/index5.js";
|
|
22
|
+
import { usePayableQuery as d } from "../../data-access/dist/index22.js";
|
|
23
23
|
import "../../data-access/dist/index.js";
|
|
24
24
|
import { buildPaymentHistory as f } from "./index2.js";
|
|
25
25
|
import { canOverrideApprovalPolicy as p, canReadCounterpartBankAccounts as m } from "./index5.js";
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.11.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.88", n = "274a9c8790da5af5e6689d2be223a87ce3d9fbfc", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|