@tesouro/embedded-components-react 0.5.136 → 0.5.138
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.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +26 -129
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +145 -204
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +214 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +4 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +5 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +113 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index89.js +0 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index90.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +93 -79
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index3.js +21 -12
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +17 -17
- 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/index8.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { RefreshingRootWidgetProvider as y } from "./libs/tesouro-embedded-compo
|
|
|
15
15
|
import { useDisclosuresAcceptanceSurface as b, useOwnWidgetConfig as x, useRefetchWidget as S, useWidgetConfig as C, useWidgetError as w, useWidgetInitStaleForToken as T, useWidgetLoading as E } from "./libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
16
16
|
import { BankAccountsWidget as D } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
|
|
17
17
|
import { CounterpartsWidget as O } from "./libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js";
|
|
18
|
-
import { BillPayWidget as k } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/
|
|
18
|
+
import { BillPayWidget as k } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index90.js";
|
|
19
19
|
import { CardDetailsWidget as A } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js";
|
|
20
20
|
import { CreditCardsWidget as j } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js";
|
|
21
21
|
import { DebitCardsWidget as M } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/
|
|
1
|
+
import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index90.js";
|
|
2
2
|
import "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js";
|
|
3
3
|
export { e as BillPayWidget };
|
|
@@ -25,8 +25,8 @@ import "./index70.js";
|
|
|
25
25
|
import "./index71.js";
|
|
26
26
|
import "./index73.js";
|
|
27
27
|
import "./index76.js";
|
|
28
|
-
import "./index83.js";
|
|
29
28
|
import "./index84.js";
|
|
30
29
|
import "./index85.js";
|
|
31
|
-
import
|
|
30
|
+
import "./index86.js";
|
|
31
|
+
import { BillPayWidget as e } from "./index90.js";
|
|
32
32
|
export { e as BillPayWidget };
|
|
@@ -2,137 +2,34 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import "../../data-access/dist/index.js";
|
|
11
|
-
import { derivePayableStatus as o } from "./index7.js";
|
|
12
|
-
import { resolveVendorName as ee } from "./index8.js";
|
|
13
|
-
import { isEditablePayableStatus as s } from "./index19.js";
|
|
14
|
-
import { BillQueue as c, DEFAULT_BILL_QUEUE as l, billQueueColumns as u, billQueueHasScheduledPayment as te, billQueueOffersAddPanel as d, billQueueStatuses as f, billSortColumnId as ne, billSortField as p } from "./index73.js";
|
|
15
|
-
import { useBillsFilters as m } from "./index82.js";
|
|
16
|
-
import { useCallback as h, useEffect as g, useMemo as _, useState as v } from "react";
|
|
5
|
+
import { useCounterpartsByIdsQuery as e } from "../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
6
|
+
import { resolveVendorName as t } from "./index8.js";
|
|
7
|
+
import { getCounterpartName as n } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
8
|
+
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
9
|
+
import { useMemo as r } from "react";
|
|
17
10
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return () => clearTimeout(e);
|
|
29
|
-
}, [P, R]);
|
|
30
|
-
let z = m({
|
|
31
|
-
offersStatusFilter: D === c.All,
|
|
32
|
-
offersVendorFilter: S,
|
|
33
|
-
isVendorFilterPaused: C,
|
|
34
|
-
labels: re,
|
|
35
|
-
onFiltersChange: R
|
|
36
|
-
}), { filterByVendor: B } = z, V = O[0], H = p(V?.id), U = H ? V?.desc ? "desc" : "asc" : void 0, W = _(() => ({
|
|
37
|
-
...z.query,
|
|
38
|
-
limit: A,
|
|
39
|
-
pagination_token: M,
|
|
40
|
-
status__in: f(D) ?? z.query.status__in,
|
|
41
|
-
has_scheduled_payment: te(D),
|
|
42
|
-
counterpart_name__icontains: I || void 0,
|
|
43
|
-
sort: H,
|
|
44
|
-
order: U
|
|
45
|
-
}), [
|
|
46
|
-
z.query,
|
|
47
|
-
A,
|
|
48
|
-
M,
|
|
49
|
-
D,
|
|
50
|
-
I,
|
|
51
|
-
H,
|
|
52
|
-
U
|
|
53
|
-
]), { organizationId: G } = e(), K = JSON.stringify([G, W]), q = i({
|
|
54
|
-
...W,
|
|
55
|
-
enabled: x,
|
|
56
|
-
pollWhileOcrProcessing: !0
|
|
57
|
-
}), [J, ae] = v(K);
|
|
58
|
-
g(() => {
|
|
59
|
-
q.isFetching || ae(K);
|
|
60
|
-
}, [q.isFetching, K]);
|
|
61
|
-
let Y = q.data?.data.length, X = Y === 0, Z = a({ enabled: x && X }), oe = !X || (Z.data?.count ?? 1) > 0, Q = _(() => (q.data?.data ?? []).filter((e) => e.ocr_status !== "processing").map((e) => {
|
|
62
|
-
let i = o({
|
|
63
|
-
apiStatus: e.status,
|
|
64
|
-
dueDate: e.due_date,
|
|
65
|
-
scheduledPaymentDate: e.scheduled_payment_date
|
|
66
|
-
}), a = e.amount_due ?? e.total_amount, l = e.status === "partially_paid" || e.status === "paid", u = (t) => t == null ? "" : n(t / 100, { currencyCode: e.currency ?? "USD" });
|
|
67
|
-
return {
|
|
68
|
-
rowKey: e.id,
|
|
69
|
-
vendorLabel: ee(e),
|
|
70
|
-
issueDateLabel: t(e.issued_at),
|
|
71
|
-
dueDateLabel: t(e.due_date),
|
|
72
|
-
dueDateTone: i.isOverdue ? "danger" : "default",
|
|
73
|
-
scheduledDateLabel: t(e.scheduled_payment_date),
|
|
74
|
-
scheduledDateIsGap: D === c.Scheduled,
|
|
75
|
-
paidDateLabel: t(e.paid_at?.slice(0, 10)),
|
|
76
|
-
amountDueLabel: u(a),
|
|
77
|
-
amountPaidLabel: l ? u(e.amount_paid) : "",
|
|
78
|
-
amountPaidIsGap: D === c.Paid,
|
|
79
|
-
amountScheduledLabel: u(e.amount_to_pay ?? a),
|
|
80
|
-
totalAmountLabel: u(e.total_amount),
|
|
81
|
-
attachment: e.file_id ? { label: E } : void 0,
|
|
82
|
-
status: i.status,
|
|
83
|
-
statusTone: i.tone,
|
|
84
|
-
addedOnLabel: t(e.created_at?.slice(0, 10)),
|
|
85
|
-
...r(e) ? {
|
|
86
|
-
rowTone: "warning",
|
|
87
|
-
rowNote: T
|
|
88
|
-
} : {},
|
|
89
|
-
onOpen: () => w(e.id, s(e.status))
|
|
90
|
-
};
|
|
91
|
-
}), [
|
|
92
|
-
q.data?.data,
|
|
93
|
-
T,
|
|
94
|
-
E,
|
|
95
|
-
w,
|
|
96
|
-
D
|
|
97
|
-
]), $ = h((e) => {
|
|
98
|
-
let t = e;
|
|
99
|
-
ie(t), k((e) => {
|
|
100
|
-
let n = e[0]?.id;
|
|
101
|
-
return n ? u(t).some((e) => ne(e) === n) ? e : b : e;
|
|
102
|
-
}), R();
|
|
103
|
-
}, [R]), se = h((e) => {
|
|
104
|
-
$(c.All), F(""), B(e);
|
|
105
|
-
}, [B, $]), ce = h((e) => {
|
|
106
|
-
k((t) => typeof e == "function" ? e(t) : e), R();
|
|
107
|
-
}, [R]), le = h((e) => {
|
|
108
|
-
j(e), R();
|
|
109
|
-
}, [R]), ue = h(() => N(q.data?.next_pagination_token ?? void 0), [q.data?.next_pagination_token]), de = h(() => N(q.data?.prev_pagination_token ?? void 0), [q.data?.prev_pagination_token]), fe = h(() => {
|
|
110
|
-
q.refetch();
|
|
111
|
-
}, [q.refetch]);
|
|
11
|
+
var i = {
|
|
12
|
+
Resolving: "resolving",
|
|
13
|
+
Unavailable: "unavailable",
|
|
14
|
+
Settled: "settled"
|
|
15
|
+
}, a = /* @__PURE__ */ new Map();
|
|
16
|
+
function o({ payables: i, enabled: o, canReadVendors: c = !0, isPaused: l = !1 } = {}) {
|
|
17
|
+
let u = r(() => (i ?? []).filter((e) => !t(e)).map((e) => e.counterpart_id).filter((e) => !!e), [i]), d = e({
|
|
18
|
+
counterpartIds: u,
|
|
19
|
+
enabled: o !== !1 && c && !l
|
|
20
|
+
}), f = !c && !l;
|
|
112
21
|
return {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
searchValue: P,
|
|
121
|
-
onSearchChange: F,
|
|
122
|
-
hasAnyBills: oe,
|
|
123
|
-
isSearchActive: I.length > 0 || z.isFilterActive,
|
|
124
|
-
filterBarProps: z.filterBarProps,
|
|
125
|
-
visibleColumns: u(D),
|
|
126
|
-
showAddPanelWhenEmpty: d(D),
|
|
127
|
-
sorting: O,
|
|
128
|
-
onSortingChange: ce,
|
|
129
|
-
pageSize: A,
|
|
130
|
-
onPageSizeChange: le,
|
|
131
|
-
hasNextPage: !!q.data?.next_pagination_token,
|
|
132
|
-
hasPrevPage: !!q.data?.prev_pagination_token,
|
|
133
|
-
onNextPage: ue,
|
|
134
|
-
onPrevPage: de
|
|
22
|
+
vendorNames: r(() => f ? a : new Map((d.data?.data ?? []).map((e) => [e.id, n(e)]).filter((e) => !!e[1])), [d.data?.data, f]),
|
|
23
|
+
lookup: s({
|
|
24
|
+
hasUnresolvedIds: u.length > 0,
|
|
25
|
+
isScopeWithdrawn: f,
|
|
26
|
+
isFetching: d.isFetching,
|
|
27
|
+
isError: d.isError
|
|
28
|
+
})
|
|
135
29
|
};
|
|
136
30
|
}
|
|
31
|
+
function s({ hasUnresolvedIds: e, isScopeWithdrawn: t, isFetching: n, isError: r }) {
|
|
32
|
+
return e ? t ? i.Unavailable : n ? i.Resolving : r ? i.Unavailable : i.Settled : i.Settled;
|
|
33
|
+
}
|
|
137
34
|
//#endregion
|
|
138
|
-
export {
|
|
35
|
+
export { i as BillVendorLookup, o as useBillVendorNames };
|
|
@@ -2,213 +2,154 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
10
|
-
import
|
|
11
|
-
import "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import "
|
|
16
|
-
import {
|
|
17
|
-
import "
|
|
18
|
-
import { BillCreateDialog as i } from "./index60.js";
|
|
19
|
-
import "./index61.js";
|
|
20
|
-
import { BillDetailsContainer as ae } from "./index63.js";
|
|
21
|
-
import "./index64.js";
|
|
22
|
-
import "./index70.js";
|
|
23
|
-
import "./index71.js";
|
|
24
|
-
import { BILL_QUEUE_ORDER as a } from "./index73.js";
|
|
25
|
-
import { BILLS_TAB_LABELS_EN as o } from "./index76.js";
|
|
26
|
-
import { useBillsTable as s } from "./index83.js";
|
|
27
|
-
import { formatBillQueueBadge as c } from "./index72.js";
|
|
28
|
-
import { copyTextToClipboard as l } from "./index74.js";
|
|
29
|
-
import { resolveDuplicateWarning as u } from "./index75.js";
|
|
30
|
-
import { billsTabTestIds as d, billsTableCellTestIds as f } from "./index77.js";
|
|
31
|
-
import { useBillQueueCounts as oe } from "./index78.js";
|
|
32
|
-
import { useCallback as p, useEffect as m, useMemo as h, useState as g } from "react";
|
|
33
|
-
import { jsx as _, jsxs as se } from "react/jsx-runtime";
|
|
5
|
+
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
|
+
import { formatCalendarDate as t } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
7
|
+
import { formatMoneyExact as n } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
8
|
+
import { hasSuspectedPayableDuplicate as r } from "../../data-access/dist/index7.js";
|
|
9
|
+
import { usePayablesQuery as i, usePayablesTotalCountQuery as a } from "../../data-access/dist/index17.js";
|
|
10
|
+
import "../../data-access/dist/index.js";
|
|
11
|
+
import { derivePayableStatus as o } from "./index7.js";
|
|
12
|
+
import { resolveVendorName as ee } from "./index8.js";
|
|
13
|
+
import { isEditablePayableStatus as te } from "./index19.js";
|
|
14
|
+
import { BillQueue as s, DEFAULT_BILL_QUEUE as c, billQueueColumns as l, billQueueHasScheduledPayment as u, billQueueOffersAddPanel as d, billQueueStatuses as f, billSortColumnId as ne, billSortField as re } from "./index73.js";
|
|
15
|
+
import { useBillsFilters as ie } from "./index82.js";
|
|
16
|
+
import { BillVendorLookup as p, useBillVendorNames as ae } from "./index83.js";
|
|
17
|
+
import { useCallback as m, useEffect as h, useMemo as g, useState as _ } from "react";
|
|
34
18
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js
|
|
35
|
-
var v =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
presets: {
|
|
48
|
-
...o.filters.presets,
|
|
49
|
-
...y?.filters?.presets
|
|
50
|
-
},
|
|
51
|
-
statuses: {
|
|
52
|
-
...o.filters.statuses,
|
|
53
|
-
...y?.filters?.statuses
|
|
54
|
-
},
|
|
55
|
-
dateFieldNames: {
|
|
56
|
-
...o.filters.dateFieldNames,
|
|
57
|
-
...y?.filters?.dateFieldNames
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
filterBar: {
|
|
61
|
-
...o.filterBar,
|
|
62
|
-
...y?.filterBar
|
|
63
|
-
},
|
|
64
|
-
queueEmptyStates: a.reduce((e, t) => ({
|
|
65
|
-
...e,
|
|
66
|
-
[t]: {
|
|
67
|
-
...o.queueEmptyStates[t],
|
|
68
|
-
...y?.queueEmptyStates?.[t]
|
|
69
|
-
}
|
|
70
|
-
}), {})
|
|
71
|
-
}), [y]), [ce, O] = g(!1), [le, k] = g(), [A, j] = g(), [M, N] = g(!1), [P, F] = g(), [I, L] = g(!1), [R, z] = g(!1), [B, V] = g(!1), { initResponse: H } = ee(), U = te(), ue = t(H?.scopes, [n.PayableReadOrg]), de = t(H?.scopes, [n.PayableWriteOrg]), W = !H || ue, G = !H || de, fe = p((e, t) => {
|
|
72
|
-
if (t && G) {
|
|
73
|
-
k(e), j(void 0), N(!0);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
F(e), z(!0);
|
|
77
|
-
}, [G]), pe = t(H?.scopes, [n.CounterpartReadOrg]), K = s({
|
|
78
|
-
enabled: W,
|
|
79
|
-
canReadVendors: pe,
|
|
80
|
-
isVendorFilterPaused: U,
|
|
81
|
-
filterLabels: D.filters,
|
|
82
|
-
onOpenBill: fe,
|
|
83
|
-
duplicateRowNote: D.duplicateRowNote,
|
|
84
|
-
attachmentLabel: D.attachmentIndicator
|
|
85
|
-
}), q = ne({ enabled: W }), me = u(q, D), J = oe({ enabled: W }), he = h(() => a.map((e) => ({
|
|
86
|
-
id: e,
|
|
87
|
-
label: D.queues[e],
|
|
88
|
-
badge: c(J[e])
|
|
89
|
-
})), [D.queues, J]), ge = (e) => {
|
|
90
|
-
V(!1), F(e), z(!0);
|
|
91
|
-
}, _e = () => {
|
|
92
|
-
L(!1), z(!0);
|
|
93
|
-
}, ve = () => {
|
|
94
|
-
z(!1), L(!0);
|
|
95
|
-
}, Y = () => {
|
|
96
|
-
L(!1), z(!1), k(P), j(void 0), N(!0);
|
|
97
|
-
}, ye = h(() => ({
|
|
98
|
-
createButton: D.createButton,
|
|
99
|
-
settingsButton: D.settingsButton,
|
|
100
|
-
addBill: { heading: D.nonEmptyHeading }
|
|
101
|
-
}), [
|
|
102
|
-
D.createButton,
|
|
103
|
-
D.settingsButton,
|
|
104
|
-
D.nonEmptyHeading
|
|
105
|
-
]), be = h(() => ({
|
|
106
|
-
...K.filterBarProps,
|
|
107
|
-
labels: D.filterBar
|
|
108
|
-
}), [K.filterBarProps, D.filterBar]), X = p((e) => {
|
|
109
|
-
O(!1), k(void 0), j(e), N(!0);
|
|
110
|
-
}, []), Z = (e) => {
|
|
111
|
-
O(!1), b?.(e);
|
|
112
|
-
}, Q = async () => {
|
|
113
|
-
await l(v) ? e.success(D.emailCopiedToast) : e.error(D.emailCopyFailedToast);
|
|
114
|
-
};
|
|
115
|
-
m(() => {
|
|
116
|
-
x && (k(x), j(void 0), N(!0), S?.());
|
|
117
|
-
}, [S, x]);
|
|
118
|
-
let { showVendorBills: $ } = K;
|
|
119
|
-
return m(() => {
|
|
120
|
-
C && (C.action === "createBill" ? G && X(C.vendorId) : $({
|
|
121
|
-
id: C.vendorId,
|
|
122
|
-
name: C.vendorName
|
|
123
|
-
}), w?.());
|
|
19
|
+
var oe = 10, v = [{
|
|
20
|
+
id: "addedOnLabel",
|
|
21
|
+
desc: !0
|
|
22
|
+
}];
|
|
23
|
+
function y({ enabled: p = !0, canReadVendors: y = !0, isVendorFilterPaused: b = !1, filterLabels: x, onOpenBill: S, duplicateRowNote: C, attachmentLabel: w }) {
|
|
24
|
+
let [T, E] = _(c), [D, O] = _(v), [k, A] = _(oe), [j, M] = _(), [N, P] = _(""), [F, ce] = _(""), I = m(() => M(void 0), []);
|
|
25
|
+
h(() => {
|
|
26
|
+
if (N === F) return;
|
|
27
|
+
let e = setTimeout(() => {
|
|
28
|
+
ce(N), I();
|
|
29
|
+
}, 300);
|
|
30
|
+
return () => clearTimeout(e);
|
|
124
31
|
}, [
|
|
125
|
-
|
|
32
|
+
N,
|
|
33
|
+
F,
|
|
34
|
+
I
|
|
35
|
+
]);
|
|
36
|
+
let L = ie({
|
|
37
|
+
offersStatusFilter: T === s.All,
|
|
38
|
+
offersVendorFilter: y,
|
|
39
|
+
isVendorFilterPaused: b,
|
|
40
|
+
labels: x,
|
|
41
|
+
onFiltersChange: I
|
|
42
|
+
}), { filterByVendor: R } = L, z = D[0], B = re(z?.id), V = B ? z?.desc ? "desc" : "asc" : void 0, H = g(() => ({
|
|
43
|
+
...L.query,
|
|
44
|
+
limit: k,
|
|
45
|
+
pagination_token: j,
|
|
46
|
+
status__in: f(T) ?? L.query.status__in,
|
|
47
|
+
has_scheduled_payment: u(T),
|
|
48
|
+
counterpart_name__icontains: F || void 0,
|
|
49
|
+
sort: B,
|
|
50
|
+
order: V
|
|
51
|
+
}), [
|
|
52
|
+
L.query,
|
|
53
|
+
k,
|
|
54
|
+
j,
|
|
55
|
+
T,
|
|
56
|
+
F,
|
|
57
|
+
B,
|
|
58
|
+
V
|
|
59
|
+
]), { organizationId: U } = e(), W = JSON.stringify([U, H]), G = i({
|
|
60
|
+
...H,
|
|
61
|
+
enabled: p,
|
|
62
|
+
pollWhileOcrProcessing: !0
|
|
63
|
+
}), [le, ue] = _(W);
|
|
64
|
+
h(() => {
|
|
65
|
+
G.isFetching || ue(W);
|
|
66
|
+
}, [G.isFetching, W]);
|
|
67
|
+
let K = G.data?.data.length, q = K === 0, J = a({ enabled: p && q }), Y = !q || (J.data?.count ?? 1) > 0, { vendorNames: X, lookup: Z } = ae({
|
|
68
|
+
payables: G.data?.data,
|
|
69
|
+
enabled: p,
|
|
70
|
+
canReadVendors: y,
|
|
71
|
+
isPaused: b
|
|
72
|
+
}), Q = g(() => (G.data?.data ?? []).filter((e) => e.ocr_status !== "processing").map((e) => {
|
|
73
|
+
let i = o({
|
|
74
|
+
apiStatus: e.status,
|
|
75
|
+
dueDate: e.due_date,
|
|
76
|
+
scheduledPaymentDate: e.scheduled_payment_date
|
|
77
|
+
}), a = e.amount_due ?? e.total_amount, c = e.status === "partially_paid" || e.status === "paid", l = (t) => t == null ? "" : n(t / 100, { currencyCode: e.currency ?? "USD" }), u = ee(e) || (e.counterpart_id ? X.get(e.counterpart_id) ?? "" : "");
|
|
78
|
+
return {
|
|
79
|
+
rowKey: e.id,
|
|
80
|
+
vendorLabel: u,
|
|
81
|
+
vendorLookup: u || !e.counterpart_id ? void 0 : se(Z),
|
|
82
|
+
issueDateLabel: t(e.issued_at),
|
|
83
|
+
dueDateLabel: t(e.due_date),
|
|
84
|
+
dueDateTone: i.isOverdue ? "danger" : "default",
|
|
85
|
+
scheduledDateLabel: t(e.scheduled_payment_date),
|
|
86
|
+
scheduledDateIsGap: T === s.Scheduled,
|
|
87
|
+
paidDateLabel: t(e.paid_at?.slice(0, 10)),
|
|
88
|
+
amountDueLabel: l(a),
|
|
89
|
+
amountPaidLabel: c ? l(e.amount_paid) : "",
|
|
90
|
+
amountPaidIsGap: T === s.Paid,
|
|
91
|
+
amountScheduledLabel: l(e.amount_to_pay ?? a),
|
|
92
|
+
totalAmountLabel: l(e.total_amount),
|
|
93
|
+
attachment: e.file_id ? { label: w } : void 0,
|
|
94
|
+
status: i.status,
|
|
95
|
+
statusTone: i.tone,
|
|
96
|
+
addedOnLabel: t(e.created_at?.slice(0, 10)),
|
|
97
|
+
...r(e) ? {
|
|
98
|
+
rowTone: "warning",
|
|
99
|
+
rowNote: C
|
|
100
|
+
} : {},
|
|
101
|
+
onOpen: () => S(e.id, te(e.status))
|
|
102
|
+
};
|
|
103
|
+
}), [
|
|
104
|
+
G.data?.data,
|
|
105
|
+
C,
|
|
126
106
|
w,
|
|
107
|
+
S,
|
|
108
|
+
T,
|
|
127
109
|
X,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
enabled: W,
|
|
172
|
-
canManageDuplicates: G,
|
|
173
|
-
onOpenBill: ge
|
|
174
|
-
}) : null,
|
|
175
|
-
G ? /* @__PURE__ */ _(r, {
|
|
176
|
-
open: ce,
|
|
177
|
-
onOpenChange: O,
|
|
178
|
-
onFilesSelected: Z,
|
|
179
|
-
maxFiles: 10,
|
|
180
|
-
onEnterManually: () => X(),
|
|
181
|
-
emailAddress: v,
|
|
182
|
-
onCopyEmail: Q,
|
|
183
|
-
labels: { heading: K.hasAnyBills ? D.nonEmptyHeading : D.emptyHeading }
|
|
184
|
-
}) : null,
|
|
185
|
-
M ? /* @__PURE__ */ _(i, {
|
|
186
|
-
open: M,
|
|
187
|
-
onOpenChange: N,
|
|
188
|
-
payableId: le,
|
|
189
|
-
initialCounterpartId: A
|
|
190
|
-
}) : null,
|
|
191
|
-
I ? /* @__PURE__ */ _(ae, {
|
|
192
|
-
open: I,
|
|
193
|
-
onOpenChange: L,
|
|
194
|
-
payableId: P,
|
|
195
|
-
onClose: () => L(!1),
|
|
196
|
-
onExpand: _e,
|
|
197
|
-
onEdit: Y,
|
|
198
|
-
testId: d.detailsSheet,
|
|
199
|
-
poweredByBankName: T
|
|
200
|
-
}) : null,
|
|
201
|
-
R ? /* @__PURE__ */ _(i, {
|
|
202
|
-
open: R,
|
|
203
|
-
onOpenChange: z,
|
|
204
|
-
payableId: P,
|
|
205
|
-
readOnly: !0,
|
|
206
|
-
onCollapse: ve,
|
|
207
|
-
onEdit: Y,
|
|
208
|
-
poweredByBankName: T
|
|
209
|
-
}) : null
|
|
210
|
-
]
|
|
211
|
-
});
|
|
110
|
+
Z
|
|
111
|
+
]), $ = m((e) => {
|
|
112
|
+
let t = e;
|
|
113
|
+
E(t), O((e) => {
|
|
114
|
+
let n = e[0]?.id;
|
|
115
|
+
return n ? l(t).some((e) => ne(e) === n) ? e : v : e;
|
|
116
|
+
}), I();
|
|
117
|
+
}, [I]), de = m((e) => {
|
|
118
|
+
$(s.All), P(""), R(e);
|
|
119
|
+
}, [R, $]), fe = m((e) => {
|
|
120
|
+
O((t) => typeof e == "function" ? e(t) : e), I();
|
|
121
|
+
}, [I]), pe = m((e) => {
|
|
122
|
+
A(e), I();
|
|
123
|
+
}, [I]), me = m(() => M(G.data?.next_pagination_token ?? void 0), [G.data?.next_pagination_token]), he = m(() => M(G.data?.prev_pagination_token ?? void 0), [G.data?.prev_pagination_token]), ge = m(() => {
|
|
124
|
+
G.refetch();
|
|
125
|
+
}, [G.refetch]);
|
|
126
|
+
return {
|
|
127
|
+
rows: Q,
|
|
128
|
+
isLoading: G.isLoading || W !== le || q && J.isLoading || (K ?? 0) > 0 && Q.length === 0,
|
|
129
|
+
isError: G.isError,
|
|
130
|
+
onRetry: ge,
|
|
131
|
+
selectedFilterTabId: T,
|
|
132
|
+
onFilterTabChange: $,
|
|
133
|
+
showVendorBills: de,
|
|
134
|
+
searchValue: N,
|
|
135
|
+
onSearchChange: P,
|
|
136
|
+
hasAnyBills: Y,
|
|
137
|
+
isSearchActive: F.length > 0 || L.isFilterActive,
|
|
138
|
+
filterBarProps: L.filterBarProps,
|
|
139
|
+
visibleColumns: l(T),
|
|
140
|
+
showAddPanelWhenEmpty: d(T),
|
|
141
|
+
sorting: D,
|
|
142
|
+
onSortingChange: fe,
|
|
143
|
+
pageSize: k,
|
|
144
|
+
onPageSizeChange: pe,
|
|
145
|
+
hasNextPage: !!G.data?.next_pagination_token,
|
|
146
|
+
hasPrevPage: !!G.data?.prev_pagination_token,
|
|
147
|
+
onNextPage: me,
|
|
148
|
+
onPrevPage: he
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
function se(e) {
|
|
152
|
+
return e === p.Settled ? void 0 : e;
|
|
212
153
|
}
|
|
213
154
|
//#endregion
|
|
214
|
-
export { y as
|
|
155
|
+
export { y as useBillsTable };
|