@tesouro/embedded-components-react 0.11.176 → 0.11.180
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/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index.js +24 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index10.js +16 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index11.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index12.js +5 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index13.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index14.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index15.js +13 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index16.js +34 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index17.js +23 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +26 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +12 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +34 -85
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index20.js +48 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +36 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +20 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js +14 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index24.js +31 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index25.js +26 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index26.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +90 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +30 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index5.js +8 -74
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index6.js +60 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index7.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index8.js +12 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index9.js +20 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +17 -36
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +42 -54
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +89 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +5 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +15 -92
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +103 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +8 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +7 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +11 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +24 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +22 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +14 -137
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +139 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +39 -108
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +96 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +4 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +56 -116
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +114 -197
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +194 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +75 -67
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +69 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +108 -459
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +450 -102
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +117 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +8 -85
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +73 -67
- 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 +71 -246
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +251 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +38 -237
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +244 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +21 -529
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +530 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +4 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +41 -242
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +245 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +3 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +4 -63
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +64 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +6 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index3.js +7 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/approvalDecisionQueries.js +22 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js +20 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/queryKeys.js +32 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +237 -215
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +151 -135
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -2,25 +2,19 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { Scope as t } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
7
|
-
import "../../../../shared/data-access/dist/index.js";
|
|
8
|
-
import { useWidgetConfig as n } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
5
|
+
import { useLocalCalendarDay as e } from "../../../../shared/feature/dist/lib/calendar/useLocalCalendarDay.js";
|
|
9
6
|
import "../../../../shared/feature/dist/index.js";
|
|
10
|
-
import {
|
|
7
|
+
import { formatScheduledDateLabel as t } from "../../../util/dist/lib/formatScheduledDateLabel.js";
|
|
11
8
|
import "../../../util/dist/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import "../../data-access/dist/index.js";
|
|
9
|
+
import { useMemo as n } from "react";
|
|
14
10
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js
|
|
15
|
-
function
|
|
16
|
-
let
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
scheduledPaymentIntentId: d?.payment_intent_id ?? void 0
|
|
24
|
-
};
|
|
11
|
+
function r({ hasScheduledPayment: r, scheduledDate: i, labels: a }) {
|
|
12
|
+
let o = e();
|
|
13
|
+
return n(() => r && i ? t(i, a, o) : void 0, [
|
|
14
|
+
r,
|
|
15
|
+
i,
|
|
16
|
+
a,
|
|
17
|
+
o
|
|
18
|
+
]);
|
|
25
19
|
}
|
|
26
|
-
export {
|
|
20
|
+
export { r as useScheduledDateLabel };
|
|
@@ -2,42 +2,25 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Scope as n } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
5
|
+
import { hasAnyScope as e } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
6
|
+
import { Scope as t } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
8
7
|
import "../../../../shared/data-access/dist/index.js";
|
|
9
|
-
import "../../../../shared/
|
|
10
|
-
import { useWidgetConfig as r } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
8
|
+
import { useWidgetConfig as n } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
9
|
import "../../../../shared/feature/dist/index.js";
|
|
12
|
-
import {
|
|
10
|
+
import { isLiveScheduledPaymentRecord as r } from "../../../util/dist/lib/isLiveScheduledPaymentRecord.js";
|
|
11
|
+
import "../../../util/dist/index.js";
|
|
12
|
+
import { usePayablePaymentRecordsQuery as i } from "../../data-access/dist/index20.js";
|
|
13
13
|
import "../../data-access/dist/index.js";
|
|
14
|
-
import { useState as a } from "react";
|
|
15
14
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js
|
|
16
|
-
function
|
|
17
|
-
let { initResponse:
|
|
18
|
-
id: "deleteDraft",
|
|
19
|
-
label: l.menuItem,
|
|
20
|
-
destructive: !0,
|
|
21
|
-
onSelect: () => m(!0)
|
|
22
|
-
}] : [], v = p && g;
|
|
15
|
+
function a({ payableId: a, scheduledPaymentDate: o, enabled: s = !0 }) {
|
|
16
|
+
let { initResponse: c } = n(), l = e(c?.scopes, [t.PaymentRecordReadOrg]), u = i(s ? a : void 0, { enabled: s && l }), d = u.paymentRecords.find(r), f = !!d || !!o, p = d?.planned_payment_date ?? (f ? o : void 0);
|
|
23
17
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
f.isPending || m(!1);
|
|
31
|
-
},
|
|
32
|
-
onConfirm: () => {
|
|
33
|
-
g && o && !f.isPending && f.mutate({ path: { payable_id: o } }, {
|
|
34
|
-
onError: () => e.error(l.error),
|
|
35
|
-
onSuccess: () => {
|
|
36
|
-
m(!1), u();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
18
|
+
hasScheduledPayment: f,
|
|
19
|
+
paymentRecords: u.paymentRecords,
|
|
20
|
+
isError: u.isError,
|
|
21
|
+
isResolving: u.isResolving,
|
|
22
|
+
scheduledDate: p ?? void 0,
|
|
23
|
+
scheduledPaymentIntentId: d?.payment_intent_id ?? void 0
|
|
41
24
|
};
|
|
42
25
|
}
|
|
43
|
-
export {
|
|
26
|
+
export { a as useScheduledPayment };
|
|
@@ -1,112 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { toast as e } from "../../../../../../node_modules/sonner/dist/index.js";
|
|
6
|
+
import { hasAnyScope as t } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
7
|
+
import { Scope as n } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
8
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
9
|
+
import "../../../../shared/ui/dist/index.js";
|
|
10
|
+
import { useWidgetConfig as r } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
|
+
import "../../../../shared/feature/dist/index.js";
|
|
12
|
+
import { useDeletePayableMutation as i } from "../../data-access/dist/index12.js";
|
|
13
|
+
import "../../data-access/dist/index.js";
|
|
14
|
+
import { useState as a } from "react";
|
|
11
15
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js
|
|
12
|
-
function l
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let S = d.currency, C = (e) => t(e, S), w = c({
|
|
20
|
-
apiStatus: d.status,
|
|
21
|
-
dueDate: d.due_date,
|
|
22
|
-
scheduledPaymentDate: d.scheduled_payment_date,
|
|
23
|
-
hasScheduledPayment: g,
|
|
24
|
-
now: _
|
|
25
|
-
}), T = a(d), E = o(d), D = e(d.issued_at) || h.notProvided, O = e(d.due_date) || h.notProvided, k = n({
|
|
26
|
-
status: d.status,
|
|
27
|
-
dueDate: d.due_date,
|
|
28
|
-
today: v,
|
|
29
|
-
isScheduled: w.status === "scheduled",
|
|
30
|
-
labels: h.dueDate,
|
|
31
|
-
emptyLabel: h.notProvided
|
|
32
|
-
}), A = [{
|
|
33
|
-
label: h.vendorRow,
|
|
34
|
-
value: E || h.notProvided,
|
|
35
|
-
secondaryValue: T?.email ?? void 0
|
|
36
|
-
}], j = x ? b?.account_number : void 0;
|
|
37
|
-
j && A.push({
|
|
38
|
-
label: h.bankAccountRow,
|
|
39
|
-
value: h.bankAccountValue(j.slice(-4))
|
|
40
|
-
});
|
|
41
|
-
let M = [
|
|
42
|
-
{
|
|
43
|
-
label: h.invoiceNumberRow,
|
|
44
|
-
value: d.document_id || h.notProvided
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: h.issueDateRow,
|
|
48
|
-
value: D
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
label: h.dueDateRow,
|
|
52
|
-
value: O
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
label: h.poNumberRow,
|
|
56
|
-
value: u(d.purchase_order_number) || h.notProvided
|
|
57
|
-
}
|
|
58
|
-
], N = new Map(m.map((e) => [e.id, s(e)])), P = p.map((e) => {
|
|
59
|
-
let t = C(e.unit_price), n = String(i(e));
|
|
60
|
-
return {
|
|
61
|
-
id: e.id,
|
|
62
|
-
description: e.name ?? e.description ?? "",
|
|
63
|
-
glCodeLabel: (e.ledger_account_id ? N.get(e.ledger_account_id) : void 0) || h.glCodeMissing,
|
|
64
|
-
quantityLabel: t ? h.quantityValue(n, t) : h.quantityOnlyValue(n),
|
|
65
|
-
amountLabel: C(r(e)) ?? ""
|
|
66
|
-
};
|
|
67
|
-
}), F = [
|
|
68
|
-
{
|
|
69
|
-
label: h.subtotalRow,
|
|
70
|
-
value: d.subtotal
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
label: h.discountsRow,
|
|
74
|
-
value: d.discount
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
label: h.taxRow,
|
|
78
|
-
value: d.tax_amount
|
|
79
|
-
}
|
|
80
|
-
].map(({ label: e, value: t }) => ({
|
|
81
|
-
label: e,
|
|
82
|
-
value: C(t)
|
|
83
|
-
})).filter((e) => !!e.value), I = C(l(d));
|
|
84
|
-
I && F.push({
|
|
85
|
-
label: h.totalRow,
|
|
86
|
-
value: I,
|
|
87
|
-
emphasis: !0
|
|
88
|
-
});
|
|
89
|
-
let L = f(d);
|
|
16
|
+
function o({ payableId: o, status: s, enabled: c = !0, labels: l, onDeleted: u }) {
|
|
17
|
+
let { initResponse: d } = r(), f = i(), [p, m] = a(!1), h = t(d?.scopes, [n.PayableWriteOrg]), g = !!(c && o && s === "draft" && h), _ = g ? [{
|
|
18
|
+
id: "deleteDraft",
|
|
19
|
+
label: l.menuItem,
|
|
20
|
+
destructive: !0,
|
|
21
|
+
onSelect: () => m(!0)
|
|
22
|
+
}] : [], v = p && g;
|
|
90
23
|
return {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
24
|
+
menuItems: _,
|
|
25
|
+
dialog: {
|
|
26
|
+
open: v,
|
|
27
|
+
copy: v ? l.dialog : void 0,
|
|
28
|
+
isPending: f.isPending,
|
|
29
|
+
onCancel: () => {
|
|
30
|
+
f.isPending || m(!1);
|
|
31
|
+
},
|
|
32
|
+
onConfirm: () => {
|
|
33
|
+
g && o && !f.isPending && f.mutate({ path: { payable_id: o } }, {
|
|
34
|
+
onError: () => e.error(l.error),
|
|
35
|
+
onSuccess: () => {
|
|
36
|
+
m(!1), u();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
107
41
|
};
|
|
108
42
|
}
|
|
109
|
-
|
|
110
|
-
return t.status === "paid" && t.paid_at ? e(t.paid_at.slice(0, 10)) : void 0;
|
|
111
|
-
}
|
|
112
|
-
export { f as getPaidAtLabel, d as mapPayableToBillDetails, l as resolveInvoiceTotalMinorUnits };
|
|
43
|
+
export { o as useDraftDelete };
|
|
@@ -1,96 +1,112 @@
|
|
|
1
1
|
import { formatCalendarDate as e } from "../../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
2
|
import "../../../../shared/util/dist/index.js";
|
|
3
3
|
import { formatBillMoney as t } from "../../../util/dist/lib/formatBillMoney.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { resolveVendor as o } from "../../../util/dist/lib/resolveVendor.js";
|
|
4
|
+
import { resolveBillDueDate as n } from "../../../util/dist/lib/resolveBillDueDate.js";
|
|
5
|
+
import { resolveLineItemAmountMinorUnits as r } from "../../../util/dist/lib/resolveLineItemAmount.js";
|
|
6
|
+
import { resolveLineItemQuantity as i } from "../../../util/dist/lib/resolveLineItemQuantity.js";
|
|
7
|
+
import { resolveVendor as a, resolveVendorName as o } from "../../../util/dist/lib/resolveVendor.js";
|
|
9
8
|
import "../../../util/dist/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { formatGlCodeLabel as s } from "./index16.js";
|
|
10
|
+
import { derivePayableStatus as c } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
|
|
12
11
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}),
|
|
12
|
+
function l(e) {
|
|
13
|
+
return e.total_amount ?? e.amount_due ?? void 0;
|
|
14
|
+
}
|
|
15
|
+
function u(e) {
|
|
16
|
+
return typeof e == "string" ? e : "";
|
|
17
|
+
}
|
|
18
|
+
function d({ payable: d, lineItems: p, ledgerAccounts: m, labels: h, hasScheduledPayment: g, now: _, today: v, rejection: y, achInstructions: b, achInstructionsReadable: x = !1 }) {
|
|
19
|
+
let S = d.currency, C = (e) => t(e, S), w = c({
|
|
20
|
+
apiStatus: d.status,
|
|
21
|
+
dueDate: d.due_date,
|
|
22
|
+
scheduledPaymentDate: d.scheduled_payment_date,
|
|
23
|
+
hasScheduledPayment: g,
|
|
24
|
+
now: _
|
|
25
|
+
}), T = a(d), E = o(d), D = e(d.issued_at) || h.notProvided, O = e(d.due_date) || h.notProvided, k = n({
|
|
26
|
+
status: d.status,
|
|
27
|
+
dueDate: d.due_date,
|
|
28
|
+
today: v,
|
|
29
|
+
isScheduled: w.status === "scheduled",
|
|
30
|
+
labels: h.dueDate,
|
|
31
|
+
emptyLabel: h.notProvided
|
|
32
|
+
}), A = [{
|
|
33
|
+
label: h.vendorRow,
|
|
34
|
+
value: E || h.notProvided,
|
|
35
|
+
secondaryValue: T?.email ?? void 0
|
|
36
|
+
}], j = x ? b?.account_number : void 0;
|
|
37
|
+
j && A.push({
|
|
38
|
+
label: h.bankAccountRow,
|
|
39
|
+
value: h.bankAccountValue(j.slice(-4))
|
|
40
|
+
});
|
|
41
|
+
let M = [
|
|
27
42
|
{
|
|
28
|
-
label:
|
|
29
|
-
|
|
43
|
+
label: h.invoiceNumberRow,
|
|
44
|
+
value: d.document_id || h.notProvided
|
|
30
45
|
},
|
|
31
46
|
{
|
|
32
|
-
label:
|
|
33
|
-
|
|
47
|
+
label: h.issueDateRow,
|
|
48
|
+
value: D
|
|
34
49
|
},
|
|
35
50
|
{
|
|
36
|
-
label:
|
|
37
|
-
|
|
51
|
+
label: h.dueDateRow,
|
|
52
|
+
value: O
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: h.poNumberRow,
|
|
56
|
+
value: u(d.purchase_order_number) || h.notProvided
|
|
38
57
|
}
|
|
39
|
-
].map((e) => ({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
58
|
+
], N = new Map(m.map((e) => [e.id, s(e)])), P = p.map((e) => {
|
|
59
|
+
let t = C(e.unit_price), n = String(i(e));
|
|
60
|
+
return {
|
|
61
|
+
id: e.id,
|
|
62
|
+
description: e.name ?? e.description ?? "",
|
|
63
|
+
glCodeLabel: (e.ledger_account_id ? N.get(e.ledger_account_id) : void 0) || h.glCodeMissing,
|
|
64
|
+
quantityLabel: t ? h.quantityValue(n, t) : h.quantityOnlyValue(n),
|
|
65
|
+
amountLabel: C(r(e)) ?? ""
|
|
66
|
+
};
|
|
67
|
+
}), F = [
|
|
68
|
+
{
|
|
69
|
+
label: h.subtotalRow,
|
|
70
|
+
value: d.subtotal
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: h.discountsRow,
|
|
74
|
+
value: d.discount
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: h.taxRow,
|
|
78
|
+
value: d.tax_amount
|
|
79
|
+
}
|
|
80
|
+
].map(({ label: e, value: t }) => ({
|
|
81
|
+
label: e,
|
|
82
|
+
value: C(t)
|
|
83
|
+
})).filter((e) => !!e.value), I = C(l(d));
|
|
84
|
+
I && F.push({
|
|
85
|
+
label: h.totalRow,
|
|
86
|
+
value: I,
|
|
46
87
|
emphasis: !0
|
|
47
88
|
});
|
|
48
|
-
let
|
|
89
|
+
let L = f(d);
|
|
49
90
|
return {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
label: _.invoiceDateRow,
|
|
68
|
-
value: A
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
label: _.dueDateRow,
|
|
72
|
-
value: j
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
label: _.invoiceNumberRow,
|
|
76
|
-
value: u.document_id || _.notProvided
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
lineItems: d.map((e) => {
|
|
80
|
-
let n = t(e.unit_price, w), r = String(a(e));
|
|
81
|
-
return {
|
|
82
|
-
id: e.id,
|
|
83
|
-
description: e.name ?? e.description ?? "",
|
|
84
|
-
glCodeLabel: e.ledger_account_id ? N.get(e.ledger_account_id) ?? (p ? _.glCodeMissing : _.glCodeUnavailable) : _.glCodeMissing,
|
|
85
|
-
qtyPriceLabel: n ? _.qtyPriceValue(r, n) : _.qtyOnlyValue(r),
|
|
86
|
-
amount: t(i(e), w) ?? ""
|
|
87
|
-
};
|
|
88
|
-
}),
|
|
89
|
-
amountRows: P,
|
|
90
|
-
approvalPolicy: g,
|
|
91
|
-
paymentHistory: h,
|
|
92
|
-
history: m,
|
|
93
|
-
rejection: x
|
|
91
|
+
title: E,
|
|
92
|
+
subtitle: h.subtitle,
|
|
93
|
+
status: w.status,
|
|
94
|
+
statusTone: w.tone,
|
|
95
|
+
amountDueLabel: C(d.amount_due) ?? C(d.total_amount) ?? "",
|
|
96
|
+
amountPaidLabel: L ? C(d.amount_paid) : void 0,
|
|
97
|
+
paidOnLabel: L ? h.paidOnLabel(L) : void 0,
|
|
98
|
+
invoiceDateLabel: D,
|
|
99
|
+
dueDateLabel: k.label,
|
|
100
|
+
dueDateOverdueLabel: k.overdueLabel,
|
|
101
|
+
dueDateAccessibleLabel: k.accessibleLabel,
|
|
102
|
+
payToItems: A,
|
|
103
|
+
invoiceItems: M,
|
|
104
|
+
lineItems: P,
|
|
105
|
+
totals: F,
|
|
106
|
+
rejection: y
|
|
94
107
|
};
|
|
95
108
|
}
|
|
96
|
-
|
|
109
|
+
function f(t) {
|
|
110
|
+
return t.status === "paid" && t.paid_at ? e(t.paid_at.slice(0, 10)) : void 0;
|
|
111
|
+
}
|
|
112
|
+
export { f as getPaidAtLabel, d as mapPayableToBillDetails, l as resolveInvoiceTotalMinorUnits };
|
|
@@ -1,5 +1,96 @@
|
|
|
1
|
+
import { formatCalendarDate as e } from "../../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
|
+
import "../../../../shared/util/dist/index.js";
|
|
3
|
+
import { formatBillMoney as t } from "../../../util/dist/lib/formatBillMoney.js";
|
|
4
|
+
import { resolveAmountDueMinorUnits as n } from "../../../util/dist/lib/resolveAmountDue.js";
|
|
5
|
+
import { resolveBillDueDate as r } from "../../../util/dist/lib/resolveBillDueDate.js";
|
|
6
|
+
import { resolveLineItemAmountMinorUnits as i } from "../../../util/dist/lib/resolveLineItemAmount.js";
|
|
7
|
+
import { resolveLineItemQuantity as a } from "../../../util/dist/lib/resolveLineItemQuantity.js";
|
|
8
|
+
import { resolveVendor as o } from "../../../util/dist/lib/resolveVendor.js";
|
|
9
|
+
import "../../../util/dist/index.js";
|
|
10
|
+
import { derivePayableStatus as s } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
|
|
11
|
+
import { getPaidAtLabel as c, resolveInvoiceTotalMinorUnits as l } from "./index27.js";
|
|
1
12
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js
|
|
2
|
-
function
|
|
3
|
-
|
|
13
|
+
function u({ payable: u, lineItems: d, glCodeOptions: f, glCodeRosterAvailable: p = !0, history: m, paymentHistory: h, approvalPolicy: g, labels: _, dueDateLabels: v, today: y, hasScheduledPayment: b, rejection: x, payableAchInstructions: S, payableAchInstructionsReadable: C = !1 }) {
|
|
14
|
+
let w = u.currency, T = s({
|
|
15
|
+
apiStatus: u.status,
|
|
16
|
+
dueDate: u.due_date,
|
|
17
|
+
scheduledPaymentDate: u.scheduled_payment_date,
|
|
18
|
+
hasScheduledPayment: b
|
|
19
|
+
}), E = o(u), D = C ? S : void 0, O = D?.account_number, k = !!(D?.account_holder_name && D.routing_number && D.account_number), A = e(u.issued_at) || _.notProvided, j = e(u.due_date) || _.notProvided, M = r({
|
|
20
|
+
status: u.status,
|
|
21
|
+
dueDate: u.due_date,
|
|
22
|
+
today: y,
|
|
23
|
+
isScheduled: T.status === "scheduled",
|
|
24
|
+
labels: v,
|
|
25
|
+
emptyLabel: _.notProvided
|
|
26
|
+
}), N = new Map(f.map((e) => [e.value, e.label])), P = [
|
|
27
|
+
{
|
|
28
|
+
label: _.subtotalRow,
|
|
29
|
+
minorUnits: u.subtotal
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: _.discountRow,
|
|
33
|
+
minorUnits: u.discount
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: _.taxRow,
|
|
37
|
+
minorUnits: u.tax_amount
|
|
38
|
+
}
|
|
39
|
+
].map((e) => ({
|
|
40
|
+
label: e.label,
|
|
41
|
+
value: t(e.minorUnits, w)
|
|
42
|
+
})).filter((e) => !!e.value), F = t(l(u), w);
|
|
43
|
+
F && P.push({
|
|
44
|
+
label: _.totalRow,
|
|
45
|
+
value: F,
|
|
46
|
+
emphasis: !0
|
|
47
|
+
});
|
|
48
|
+
let I = c(u);
|
|
49
|
+
return {
|
|
50
|
+
amountDue: t(n(u), w) ?? "",
|
|
51
|
+
amountPaid: I ? t(u.amount_paid, w) : void 0,
|
|
52
|
+
paidOnLabel: I ? _.paidOnLabel(I) : void 0,
|
|
53
|
+
invoiceDateLabel: A,
|
|
54
|
+
dueDateLabel: M.label,
|
|
55
|
+
dueDateOverdueLabel: M.overdueLabel,
|
|
56
|
+
dueDateAccessibleLabel: M.accessibleLabel,
|
|
57
|
+
status: T.status,
|
|
58
|
+
statusTone: T.tone,
|
|
59
|
+
payTo: {
|
|
60
|
+
name: E?.name || _.notProvided,
|
|
61
|
+
email: E?.email ?? "",
|
|
62
|
+
methodLabel: k ? _.paymentInstructionsValue(O?.slice(-4) ?? "") : _.paymentInstructionsNotSet,
|
|
63
|
+
hasPaymentInstructions: k
|
|
64
|
+
},
|
|
65
|
+
invoiceFields: [
|
|
66
|
+
{
|
|
67
|
+
label: _.invoiceDateRow,
|
|
68
|
+
value: A
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: _.dueDateRow,
|
|
72
|
+
value: j
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: _.invoiceNumberRow,
|
|
76
|
+
value: u.document_id || _.notProvided
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
lineItems: d.map((e) => {
|
|
80
|
+
let n = t(e.unit_price, w), r = String(a(e));
|
|
81
|
+
return {
|
|
82
|
+
id: e.id,
|
|
83
|
+
description: e.name ?? e.description ?? "",
|
|
84
|
+
glCodeLabel: e.ledger_account_id ? N.get(e.ledger_account_id) ?? (p ? _.glCodeMissing : _.glCodeUnavailable) : _.glCodeMissing,
|
|
85
|
+
qtyPriceLabel: n ? _.qtyPriceValue(r, n) : _.qtyOnlyValue(r),
|
|
86
|
+
amount: t(i(e), w) ?? ""
|
|
87
|
+
};
|
|
88
|
+
}),
|
|
89
|
+
amountRows: P,
|
|
90
|
+
approvalPolicy: g,
|
|
91
|
+
paymentHistory: h,
|
|
92
|
+
history: m,
|
|
93
|
+
rejection: x
|
|
94
|
+
};
|
|
4
95
|
}
|
|
5
|
-
export {
|
|
96
|
+
export { u as buildBillDetailView };
|
|
@@ -1,58 +1,5 @@
|
|
|
1
|
-
import { formatCalendarDate as e } from "../../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
|
-
import "../../../../shared/util/dist/index.js";
|
|
3
|
-
import { formatBillMoney as t } from "../../../util/dist/lib/formatBillMoney.js";
|
|
4
|
-
import "../../../util/dist/index.js";
|
|
5
1
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
year: "numeric"
|
|
11
|
-
}),
|
|
12
|
-
timeLabel: (e) => new Date(e).toLocaleTimeString(void 0, {
|
|
13
|
-
hour: "numeric",
|
|
14
|
-
minute: "2-digit",
|
|
15
|
-
timeZoneName: "short"
|
|
16
|
-
}),
|
|
17
|
-
byActor: (e, t) => `${e} by ${t}`,
|
|
18
|
-
formatAmount: (e) => t(e) ?? "",
|
|
19
|
-
billCreated: "Bill created",
|
|
20
|
-
createdManually: "Data entered manually",
|
|
21
|
-
createdFromUpload: "File uploaded and scanned automatically",
|
|
22
|
-
billCreatedByEmail: "Bill created by email",
|
|
23
|
-
sentFrom: (e) => `Sent from ${e}`,
|
|
24
|
-
billDetailsUpdated: "Bill details updated",
|
|
25
|
-
filledInFromFile: "Filled in from the attached file",
|
|
26
|
-
submittedForReview: "Finalized and submitted for review",
|
|
27
|
-
approvalRequested: "Approval requested",
|
|
28
|
-
approved: "Approved",
|
|
29
|
-
approvedAutomatically: "Auto-approved",
|
|
30
|
-
rejected: "Rejected",
|
|
31
|
-
policyOverrideApproved: "Policy override: Approved",
|
|
32
|
-
policyOverrideRejected: "Policy override: Rejected",
|
|
33
|
-
quotedReason: (e) => `"${e}"`,
|
|
34
|
-
cancelled: "Cancelled",
|
|
35
|
-
reopened: "Re-opened",
|
|
36
|
-
paymentReleased: "Payment released",
|
|
37
|
-
paid: (e) => `Paid ${e}`,
|
|
38
|
-
paymentReverted: "Payment reverted",
|
|
39
|
-
calendarDateLabel: (t) => e(t),
|
|
40
|
-
paymentScheduled: "Payment scheduled",
|
|
41
|
-
scheduledFor: (e) => `Scheduled for ${e}`,
|
|
42
|
-
scheduledPaymentCancelled: "Scheduled payment cancelled",
|
|
43
|
-
cancelledAsBillChanged: "The bill was changed",
|
|
44
|
-
cancelledAsBillDeleted: "The bill was deleted",
|
|
45
|
-
paymentFailed: "Payment failed",
|
|
46
|
-
billMarkedAsFullyPaid: "Bill marked as fully paid",
|
|
47
|
-
billMarkedAsPartiallyPaid: "Bill marked as partially paid",
|
|
48
|
-
draftDeleted: "Draft deleted",
|
|
49
|
-
fileAttached: "File attached",
|
|
50
|
-
fileRemoved: "File removed",
|
|
51
|
-
creditNoteLinked: "Credit note linked",
|
|
52
|
-
creditNoteUnlinked: "Credit note unlinked",
|
|
53
|
-
lineItemsUpdated: "Line items updated",
|
|
54
|
-
lineItemAdded: "Line item added",
|
|
55
|
-
lineItemUpdated: "Line item updated",
|
|
56
|
-
lineItemRemoved: "Line item removed"
|
|
57
|
-
};
|
|
58
|
-
export { n as PAYABLE_AUDIT_HISTORY_LABELS_EN };
|
|
2
|
+
function e({ isUnsavedPromptOpen: e, isLocked: t, isDirty: n }) {
|
|
3
|
+
return e ? "dismiss-prompt" : !t && n ? "prompt" : "close";
|
|
4
|
+
}
|
|
5
|
+
export { e as resolveEditorDismissal };
|