@tesouro/embedded-components-react 0.11.127 → 0.11.131
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 +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +20 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +14 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js +31 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index24.js +26 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index25.js +2 -0
- 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 +35 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +57 -65
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +6 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +20 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +97 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +10 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +7 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +8 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +24 -139
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +24 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +14 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +130 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +17 -100
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +21 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +41 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +98 -53
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +82 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +3 -193
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +57 -81
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +110 -66
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +190 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +71 -456
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +69 -114
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +113 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +458 -79
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +116 -79
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +10 -256
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +78 -36
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +73 -236
- 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 +256 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +43 -516
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +245 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +20 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +497 -211
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +40 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +235 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +64 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index6.js +4 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index7.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index8.js +8 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +18 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index3.js +44 -34
- 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/products-widget/ui/dist/index4.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/sections/InvoicingSection.js +3 -3
- package/package.json +1 -1
|
@@ -1,103 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useLocalCalendarDay as e } from "../../../../shared/feature/dist/lib/calendar/useLocalCalendarDay.js";
|
|
6
|
+
import "../../../../shared/feature/dist/index.js";
|
|
7
|
+
import { formatScheduledDateLabel as t } from "../../../util/dist/lib/formatScheduledDateLabel.js";
|
|
7
8
|
import "../../../util/dist/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import { derivePayableStatus as s } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
|
|
9
|
+
import { useMemo as n } from "react";
|
|
10
10
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js
|
|
11
|
-
function
|
|
12
|
-
|
|
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
|
+
]);
|
|
13
19
|
}
|
|
14
|
-
|
|
15
|
-
return typeof e == "string" ? e : "";
|
|
16
|
-
}
|
|
17
|
-
function u({ payable: u, lineItems: f, ledgerAccounts: p, labels: m, hasScheduledPayment: h, now: g, rejection: _, achInstructions: v, achInstructionsReadable: y = !1 }) {
|
|
18
|
-
let b = u.currency, x = (e) => t(e, b), S = s({
|
|
19
|
-
apiStatus: u.status,
|
|
20
|
-
dueDate: u.due_date,
|
|
21
|
-
scheduledPaymentDate: u.scheduled_payment_date,
|
|
22
|
-
hasScheduledPayment: h,
|
|
23
|
-
now: g
|
|
24
|
-
}), C = i(u), w = a(u), T = e(u.issued_at) || m.notProvided, E = e(u.due_date) || m.notProvided, D = [{
|
|
25
|
-
label: m.vendorRow,
|
|
26
|
-
value: w || m.notProvided,
|
|
27
|
-
secondaryValue: C?.email ?? void 0
|
|
28
|
-
}], O = y ? v?.account_number : void 0;
|
|
29
|
-
O && D.push({
|
|
30
|
-
label: m.bankAccountRow,
|
|
31
|
-
value: m.bankAccountValue(O.slice(-4))
|
|
32
|
-
});
|
|
33
|
-
let k = [
|
|
34
|
-
{
|
|
35
|
-
label: m.invoiceNumberRow,
|
|
36
|
-
value: u.document_id || m.notProvided
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
label: m.issueDateRow,
|
|
40
|
-
value: T
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
label: m.dueDateRow,
|
|
44
|
-
value: E
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: m.poNumberRow,
|
|
48
|
-
value: l(u.purchase_order_number) || m.notProvided
|
|
49
|
-
}
|
|
50
|
-
], A = new Map(p.map((e) => [e.id, o(e)])), j = f.map((e) => {
|
|
51
|
-
let t = x(e.unit_price), i = String(r(e));
|
|
52
|
-
return {
|
|
53
|
-
id: e.id,
|
|
54
|
-
description: e.name ?? e.description ?? "",
|
|
55
|
-
glCodeLabel: (e.ledger_account_id ? A.get(e.ledger_account_id) : void 0) || m.glCodeMissing,
|
|
56
|
-
quantityLabel: t ? m.quantityValue(i, t) : m.quantityOnlyValue(i),
|
|
57
|
-
amountLabel: x(n(e)) ?? ""
|
|
58
|
-
};
|
|
59
|
-
}), M = [
|
|
60
|
-
{
|
|
61
|
-
label: m.subtotalRow,
|
|
62
|
-
value: u.subtotal
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
label: m.discountsRow,
|
|
66
|
-
value: u.discount
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
label: m.taxRow,
|
|
70
|
-
value: u.tax_amount
|
|
71
|
-
}
|
|
72
|
-
].map(({ label: e, value: t }) => ({
|
|
73
|
-
label: e,
|
|
74
|
-
value: x(t)
|
|
75
|
-
})).filter((e) => !!e.value), N = x(c(u));
|
|
76
|
-
N && M.push({
|
|
77
|
-
label: m.totalRow,
|
|
78
|
-
value: N,
|
|
79
|
-
emphasis: !0
|
|
80
|
-
});
|
|
81
|
-
let P = d(u);
|
|
82
|
-
return {
|
|
83
|
-
title: w,
|
|
84
|
-
subtitle: m.subtitle,
|
|
85
|
-
status: S.status,
|
|
86
|
-
statusTone: S.tone,
|
|
87
|
-
amountDueLabel: x(u.amount_due) ?? x(u.total_amount) ?? "",
|
|
88
|
-
amountPaidLabel: P ? x(u.amount_paid) : void 0,
|
|
89
|
-
paidOnLabel: P ? m.paidOnLabel(P) : void 0,
|
|
90
|
-
invoiceDateLabel: T,
|
|
91
|
-
dueDateLabel: E,
|
|
92
|
-
dueDateTone: S.isOverdue ? "danger" : "default",
|
|
93
|
-
payToItems: D,
|
|
94
|
-
invoiceItems: k,
|
|
95
|
-
lineItems: j,
|
|
96
|
-
totals: M,
|
|
97
|
-
rejection: _
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
function d(t) {
|
|
101
|
-
return t.status === "paid" && t.paid_at ? e(t.paid_at.slice(0, 10)) : void 0;
|
|
102
|
-
}
|
|
103
|
-
export { d as getPaidAtLabel, u as mapPayableToBillDetails, c as resolveInvoiceTotalMinorUnits };
|
|
20
|
+
export { r as useScheduledDateLabel };
|
|
@@ -1,87 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
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";
|
|
7
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
8
|
+
import { useWidgetConfig as n } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
9
|
+
import "../../../../shared/feature/dist/index.js";
|
|
10
|
+
import { isLiveScheduledPaymentRecord as r } from "../../../util/dist/lib/isLiveScheduledPaymentRecord.js";
|
|
8
11
|
import "../../../util/dist/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
12
|
+
import { usePayablePaymentRecordsQuery as i } from "../../data-access/dist/index19.js";
|
|
13
|
+
import "../../data-access/dist/index.js";
|
|
11
14
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
apiStatus: l.status,
|
|
15
|
-
dueDate: l.due_date,
|
|
16
|
-
scheduledPaymentDate: l.scheduled_payment_date,
|
|
17
|
-
hasScheduledPayment: _
|
|
18
|
-
}), C = a(l), w = b ? y : void 0, T = w?.account_number, E = !!(w?.account_holder_name && w.routing_number && w.account_number), D = e(l.issued_at) || g.notProvided, O = e(l.due_date) || g.notProvided, k = new Map(d.map((e) => [e.value, e.label])), A = [
|
|
19
|
-
{
|
|
20
|
-
label: g.subtotalRow,
|
|
21
|
-
minorUnits: l.subtotal
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
label: g.discountRow,
|
|
25
|
-
minorUnits: l.discount
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
label: g.taxRow,
|
|
29
|
-
minorUnits: l.tax_amount
|
|
30
|
-
}
|
|
31
|
-
].map((e) => ({
|
|
32
|
-
label: e.label,
|
|
33
|
-
value: t(e.minorUnits, x)
|
|
34
|
-
})).filter((e) => !!e.value), j = t(c(l), x);
|
|
35
|
-
j && A.push({
|
|
36
|
-
label: g.totalRow,
|
|
37
|
-
value: j,
|
|
38
|
-
emphasis: !0
|
|
39
|
-
});
|
|
40
|
-
let M = s(l);
|
|
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);
|
|
41
17
|
return {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
status: S.status,
|
|
49
|
-
statusTone: S.tone,
|
|
50
|
-
payTo: {
|
|
51
|
-
name: C?.name || g.notProvided,
|
|
52
|
-
email: C?.email ?? "",
|
|
53
|
-
methodLabel: E ? g.paymentInstructionsValue(T?.slice(-4) ?? "") : g.paymentInstructionsNotSet,
|
|
54
|
-
hasPaymentInstructions: E
|
|
55
|
-
},
|
|
56
|
-
invoiceFields: [
|
|
57
|
-
{
|
|
58
|
-
label: g.invoiceDateRow,
|
|
59
|
-
value: D
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
label: g.dueDateRow,
|
|
63
|
-
value: O
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
label: g.invoiceNumberRow,
|
|
67
|
-
value: l.document_id || g.notProvided
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
lineItems: u.map((e) => {
|
|
71
|
-
let n = t(e.unit_price, x), a = String(i(e));
|
|
72
|
-
return {
|
|
73
|
-
id: e.id,
|
|
74
|
-
description: e.name ?? e.description ?? "",
|
|
75
|
-
glCodeLabel: e.ledger_account_id ? k.get(e.ledger_account_id) ?? (f ? g.glCodeMissing : g.glCodeUnavailable) : g.glCodeMissing,
|
|
76
|
-
qtyPriceLabel: n ? g.qtyPriceValue(a, n) : g.qtyOnlyValue(a),
|
|
77
|
-
amount: t(r(e), x) ?? ""
|
|
78
|
-
};
|
|
79
|
-
}),
|
|
80
|
-
amountRows: A,
|
|
81
|
-
approvalPolicy: h,
|
|
82
|
-
paymentHistory: m,
|
|
83
|
-
history: p,
|
|
84
|
-
rejection: v
|
|
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
|
|
85
24
|
};
|
|
86
25
|
}
|
|
87
|
-
export {
|
|
26
|
+
export { a as useScheduledPayment };
|
|
@@ -1,5 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { 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/index11.js";
|
|
13
|
+
import "../../data-access/dist/index.js";
|
|
14
|
+
import { useState as a } from "react";
|
|
1
15
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js
|
|
2
|
-
function
|
|
3
|
-
|
|
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;
|
|
23
|
+
return {
|
|
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
|
+
}
|
|
41
|
+
};
|
|
4
42
|
}
|
|
5
|
-
export {
|
|
43
|
+
export { o as useDraftDelete };
|
|
@@ -1,58 +1,103 @@
|
|
|
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 { resolveLineItemAmountMinorUnits as n } from "../../../util/dist/lib/resolveLineItemAmount.js";
|
|
5
|
+
import { resolveLineItemQuantity as r } from "../../../util/dist/lib/resolveLineItemQuantity.js";
|
|
6
|
+
import { resolveVendor as i, resolveVendorName as a } from "../../../util/dist/lib/resolveVendor.js";
|
|
4
7
|
import "../../../util/dist/index.js";
|
|
8
|
+
import { formatGlCodeLabel as o } from "./index15.js";
|
|
9
|
+
import { derivePayableStatus as s } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
|
|
5
10
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
11
|
+
function c(e) {
|
|
12
|
+
return e.total_amount ?? e.amount_due ?? void 0;
|
|
13
|
+
}
|
|
14
|
+
function l(e) {
|
|
15
|
+
return typeof e == "string" ? e : "";
|
|
16
|
+
}
|
|
17
|
+
function u({ payable: u, lineItems: f, ledgerAccounts: p, labels: m, hasScheduledPayment: h, now: g, rejection: _, achInstructions: v, achInstructionsReadable: y = !1 }) {
|
|
18
|
+
let b = u.currency, x = (e) => t(e, b), S = s({
|
|
19
|
+
apiStatus: u.status,
|
|
20
|
+
dueDate: u.due_date,
|
|
21
|
+
scheduledPaymentDate: u.scheduled_payment_date,
|
|
22
|
+
hasScheduledPayment: h,
|
|
23
|
+
now: g
|
|
24
|
+
}), C = i(u), w = a(u), T = e(u.issued_at) || m.notProvided, E = e(u.due_date) || m.notProvided, D = [{
|
|
25
|
+
label: m.vendorRow,
|
|
26
|
+
value: w || m.notProvided,
|
|
27
|
+
secondaryValue: C?.email ?? void 0
|
|
28
|
+
}], O = y ? v?.account_number : void 0;
|
|
29
|
+
O && D.push({
|
|
30
|
+
label: m.bankAccountRow,
|
|
31
|
+
value: m.bankAccountValue(O.slice(-4))
|
|
32
|
+
});
|
|
33
|
+
let k = [
|
|
34
|
+
{
|
|
35
|
+
label: m.invoiceNumberRow,
|
|
36
|
+
value: u.document_id || m.notProvided
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: m.issueDateRow,
|
|
40
|
+
value: T
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: m.dueDateRow,
|
|
44
|
+
value: E
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: m.poNumberRow,
|
|
48
|
+
value: l(u.purchase_order_number) || m.notProvided
|
|
49
|
+
}
|
|
50
|
+
], A = new Map(p.map((e) => [e.id, o(e)])), j = f.map((e) => {
|
|
51
|
+
let t = x(e.unit_price), i = String(r(e));
|
|
52
|
+
return {
|
|
53
|
+
id: e.id,
|
|
54
|
+
description: e.name ?? e.description ?? "",
|
|
55
|
+
glCodeLabel: (e.ledger_account_id ? A.get(e.ledger_account_id) : void 0) || m.glCodeMissing,
|
|
56
|
+
quantityLabel: t ? m.quantityValue(i, t) : m.quantityOnlyValue(i),
|
|
57
|
+
amountLabel: x(n(e)) ?? ""
|
|
58
|
+
};
|
|
59
|
+
}), M = [
|
|
60
|
+
{
|
|
61
|
+
label: m.subtotalRow,
|
|
62
|
+
value: u.subtotal
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: m.discountsRow,
|
|
66
|
+
value: u.discount
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: m.taxRow,
|
|
70
|
+
value: u.tax_amount
|
|
71
|
+
}
|
|
72
|
+
].map(({ label: e, value: t }) => ({
|
|
73
|
+
label: e,
|
|
74
|
+
value: x(t)
|
|
75
|
+
})).filter((e) => !!e.value), N = x(c(u));
|
|
76
|
+
N && M.push({
|
|
77
|
+
label: m.totalRow,
|
|
78
|
+
value: N,
|
|
79
|
+
emphasis: !0
|
|
80
|
+
});
|
|
81
|
+
let P = d(u);
|
|
82
|
+
return {
|
|
83
|
+
title: w,
|
|
84
|
+
subtitle: m.subtitle,
|
|
85
|
+
status: S.status,
|
|
86
|
+
statusTone: S.tone,
|
|
87
|
+
amountDueLabel: x(u.amount_due) ?? x(u.total_amount) ?? "",
|
|
88
|
+
amountPaidLabel: P ? x(u.amount_paid) : void 0,
|
|
89
|
+
paidOnLabel: P ? m.paidOnLabel(P) : void 0,
|
|
90
|
+
invoiceDateLabel: T,
|
|
91
|
+
dueDateLabel: E,
|
|
92
|
+
dueDateTone: S.isOverdue ? "danger" : "default",
|
|
93
|
+
payToItems: D,
|
|
94
|
+
invoiceItems: k,
|
|
95
|
+
lineItems: j,
|
|
96
|
+
totals: M,
|
|
97
|
+
rejection: _
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function d(t) {
|
|
101
|
+
return t.status === "paid" && t.paid_at ? e(t.paid_at.slice(0, 10)) : void 0;
|
|
102
|
+
}
|
|
103
|
+
export { d as getPaidAtLabel, u as mapPayableToBillDetails, c as resolveInvoiceTotalMinorUnits };
|
|
@@ -1,118 +1,87 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { formatCalendarDate as e } from "../../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
2
|
import "../../../../shared/util/dist/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
3
|
+
import { formatBillMoney as t } from "../../../util/dist/lib/formatBillMoney.js";
|
|
4
|
+
import { resolveAmountDueMinorUnits as n } from "../../../util/dist/lib/resolveAmountDue.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 } from "../../../util/dist/lib/resolveVendor.js";
|
|
8
|
+
import "../../../util/dist/index.js";
|
|
9
|
+
import { derivePayableStatus as o } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
|
|
10
|
+
import { getPaidAtLabel as s, resolveInvoiceTotalMinorUnits as c } from "./index26.js";
|
|
6
11
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
t && (i.GlobalWorkerOptions.workerSrc = e(i.version), y({
|
|
35
|
-
Document: n,
|
|
36
|
-
Page: r
|
|
37
|
-
}));
|
|
38
|
-
}).catch(() => {
|
|
39
|
-
t && x(!0);
|
|
40
|
-
}), () => {
|
|
41
|
-
t = !1;
|
|
42
|
-
};
|
|
43
|
-
}, []), t(() => {
|
|
44
|
-
if (!v) return;
|
|
45
|
-
let e = f.current;
|
|
46
|
-
if (!e) return;
|
|
47
|
-
let t = () => {
|
|
48
|
-
let t = e.clientWidth;
|
|
49
|
-
t && _(Math.max(c, Math.min(t, s)));
|
|
50
|
-
};
|
|
51
|
-
if (t(), typeof ResizeObserver > "u") return;
|
|
52
|
-
let n = new ResizeObserver(t);
|
|
53
|
-
return n.observe(e), () => n.disconnect();
|
|
54
|
-
}, [v]), t(() => {
|
|
55
|
-
C(/* @__PURE__ */ new Set([1]));
|
|
56
|
-
}, [a]), t(() => {
|
|
57
|
-
let e = f.current;
|
|
58
|
-
if (!e || !m || typeof IntersectionObserver > "u") return;
|
|
59
|
-
let t = new IntersectionObserver((e) => {
|
|
60
|
-
let t = e.filter((e) => e.isIntersecting).map((e) => Number(e.target.getAttribute("data-page-number"))).filter((e) => e >= 1);
|
|
61
|
-
t.length && C((e) => {
|
|
62
|
-
let n = new Set(e);
|
|
63
|
-
return t.forEach((e) => n.add(e)), n.size === e.size ? e : n;
|
|
64
|
-
});
|
|
65
|
-
}, {
|
|
66
|
-
root: e,
|
|
67
|
-
rootMargin: "600px 0px"
|
|
68
|
-
});
|
|
69
|
-
return p.current.forEach((e) => t.observe(e)), () => t.disconnect();
|
|
70
|
-
}, [m, g]), b) return /* @__PURE__ */ i(d, {
|
|
71
|
-
url: a,
|
|
72
|
-
labels: o
|
|
12
|
+
function l({ payable: l, lineItems: u, glCodeOptions: d, glCodeRosterAvailable: f = !0, history: p, paymentHistory: m, approvalPolicy: h, labels: g, hasScheduledPayment: _, rejection: v, payableAchInstructions: y, payableAchInstructionsReadable: b = !1 }) {
|
|
13
|
+
let x = l.currency, S = o({
|
|
14
|
+
apiStatus: l.status,
|
|
15
|
+
dueDate: l.due_date,
|
|
16
|
+
scheduledPaymentDate: l.scheduled_payment_date,
|
|
17
|
+
hasScheduledPayment: _
|
|
18
|
+
}), C = a(l), w = b ? y : void 0, T = w?.account_number, E = !!(w?.account_holder_name && w.routing_number && w.account_number), D = e(l.issued_at) || g.notProvided, O = e(l.due_date) || g.notProvided, k = new Map(d.map((e) => [e.value, e.label])), A = [
|
|
19
|
+
{
|
|
20
|
+
label: g.subtotalRow,
|
|
21
|
+
minorUnits: l.subtotal
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: g.discountRow,
|
|
25
|
+
minorUnits: l.discount
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: g.taxRow,
|
|
29
|
+
minorUnits: l.tax_amount
|
|
30
|
+
}
|
|
31
|
+
].map((e) => ({
|
|
32
|
+
label: e.label,
|
|
33
|
+
value: t(e.minorUnits, x)
|
|
34
|
+
})).filter((e) => !!e.value), j = t(c(l), x);
|
|
35
|
+
j && A.push({
|
|
36
|
+
label: g.totalRow,
|
|
37
|
+
value: j,
|
|
38
|
+
emphasis: !0
|
|
73
39
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
40
|
+
let M = s(l);
|
|
41
|
+
return {
|
|
42
|
+
amountDue: t(n(l), x) ?? "",
|
|
43
|
+
amountPaid: M ? t(l.amount_paid, x) : void 0,
|
|
44
|
+
paidOnLabel: M ? g.paidOnLabel(M) : void 0,
|
|
45
|
+
invoiceDateLabel: D,
|
|
46
|
+
dueDateLabel: O,
|
|
47
|
+
dueDateTone: S.isOverdue ? "danger" : "default",
|
|
48
|
+
status: S.status,
|
|
49
|
+
statusTone: S.tone,
|
|
50
|
+
payTo: {
|
|
51
|
+
name: C?.name || g.notProvided,
|
|
52
|
+
email: C?.email ?? "",
|
|
53
|
+
methodLabel: E ? g.paymentInstructionsValue(T?.slice(-4) ?? "") : g.paymentInstructionsNotSet,
|
|
54
|
+
hasPaymentInstructions: E
|
|
55
|
+
},
|
|
56
|
+
invoiceFields: [
|
|
57
|
+
{
|
|
58
|
+
label: g.invoiceDateRow,
|
|
59
|
+
value: D
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: g.dueDateRow,
|
|
63
|
+
value: O
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: g.invoiceNumberRow,
|
|
67
|
+
value: l.document_id || g.notProvided
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
lineItems: u.map((e) => {
|
|
71
|
+
let n = t(e.unit_price, x), a = String(i(e));
|
|
72
|
+
return {
|
|
73
|
+
id: e.id,
|
|
74
|
+
description: e.name ?? e.description ?? "",
|
|
75
|
+
glCodeLabel: e.ledger_account_id ? k.get(e.ledger_account_id) ?? (f ? g.glCodeMissing : g.glCodeUnavailable) : g.glCodeMissing,
|
|
76
|
+
qtyPriceLabel: n ? g.qtyPriceValue(a, n) : g.qtyOnlyValue(a),
|
|
77
|
+
amount: t(r(e), x) ?? ""
|
|
78
|
+
};
|
|
79
|
+
}),
|
|
80
|
+
amountRows: A,
|
|
81
|
+
approvalPolicy: h,
|
|
82
|
+
paymentHistory: m,
|
|
83
|
+
history: p,
|
|
84
|
+
rejection: v
|
|
105
85
|
};
|
|
106
|
-
return e.mimetype === "application/pdf" ? /* @__PURE__ */ i(f, {
|
|
107
|
-
url: e.url,
|
|
108
|
-
labels: n
|
|
109
|
-
}) : e.mimetype.startsWith("image/") ? /* @__PURE__ */ i("img", {
|
|
110
|
-
src: e.url,
|
|
111
|
-
alt: e.name,
|
|
112
|
-
className: "ttw:max-h-full ttw:max-w-full ttw:object-contain"
|
|
113
|
-
}) : /* @__PURE__ */ i(d, {
|
|
114
|
-
url: e.url,
|
|
115
|
-
labels: n
|
|
116
|
-
});
|
|
117
86
|
}
|
|
118
|
-
export {
|
|
87
|
+
export { l as buildBillDetailView };
|