@tesouro/embedded-components-react 0.11.9 → 0.11.11
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.css +12 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js +8 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +99 -94
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index36.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +110 -100
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/ui/dist/index4.js +45 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +259 -210
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +190 -165
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +7 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +151 -143
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +19 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index10.js +13 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index11.js +52 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +2 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +39 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +2 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +77 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +25 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +28 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +2 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +33 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index6.js +9 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index8.js +29 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js +1 -53
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/index.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/groupCollapse.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +1637 -1507
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +0 -28
|
@@ -14,34 +14,35 @@ import { DuplicateVerdict as a } from "../../../util/dist/lib/duplicateVerdict.j
|
|
|
14
14
|
import { formatScheduledDateLabel as o } from "../../../util/dist/lib/formatScheduledDateLabel.js";
|
|
15
15
|
import { hasSuspectedPayableDuplicate as s, suspectedPayableDuplicates as c } from "../../../util/dist/lib/payableDuplicates.js";
|
|
16
16
|
import { compareByArrival as l, duplicateVerdictMatches as u, resolveDuplicateOriginalId as d } from "../../../util/dist/lib/groupDuplicates.js";
|
|
17
|
-
import { isEditablePayableStatus as
|
|
18
|
-
import { payableRemoval as
|
|
19
|
-
import { resolveVendorName as
|
|
17
|
+
import { isEditablePayableStatus as f } from "../../../util/dist/lib/isEditablePayableStatus.js";
|
|
18
|
+
import { payableRemoval as p } from "../../../util/dist/lib/payableRemoval.js";
|
|
19
|
+
import { resolveVendorName as ee } from "../../../util/dist/lib/resolveVendor.js";
|
|
20
|
+
import { buildGroupCollapse as m } from "../../../util/dist/lib/groupCollapse.js";
|
|
20
21
|
import "../../../util/dist/index.js";
|
|
21
|
-
import { derivePayableStatus as
|
|
22
|
-
import { useApplyDuplicateVerdictsMutation as
|
|
22
|
+
import { derivePayableStatus as te } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
|
|
23
|
+
import { useApplyDuplicateVerdictsMutation as h } from "../../../data-access/dist/lib/useApplyDuplicateVerdictsMutation.js";
|
|
23
24
|
import "../../../data-access/dist/index.js";
|
|
24
|
-
import { BillColumn as
|
|
25
|
+
import { BillColumn as g } from "../../ui/dist/index19.js";
|
|
25
26
|
import "../../ui/dist/index.js";
|
|
26
|
-
import { BillQueue as
|
|
27
|
+
import { BillQueue as _, DEFAULT_BILL_QUEUE as ne, billQueueColumns as v, billQueueFilters as re, billQueueOffersAddPanel as ie, billSortColumnId as ae, billSortField as oe } from "./index5.js";
|
|
27
28
|
import { duplicateRemovalPrompt as se } from "./index11.js";
|
|
28
29
|
import { useBillsFilters as ce } from "./index14.js";
|
|
29
|
-
import { BillVendorLookup as
|
|
30
|
-
import { useFirstPayablesPagesQuery as
|
|
31
|
-
import { usePayablesQuery as
|
|
32
|
-
import { usePayablesTotalCountQuery as
|
|
30
|
+
import { BillVendorLookup as le, useBillVendorNames as ue } from "./index15.js";
|
|
31
|
+
import { useFirstPayablesPagesQuery as de } from "../../data-access/dist/index2.js";
|
|
32
|
+
import { usePayablesQuery as fe } from "../../data-access/dist/index4.js";
|
|
33
|
+
import { usePayablesTotalCountQuery as pe } from "../../data-access/dist/index5.js";
|
|
33
34
|
import "../../data-access/dist/index.js";
|
|
34
|
-
import { useCallback as y, useEffect as
|
|
35
|
-
import { BanIcon as
|
|
35
|
+
import { useCallback as y, useEffect as me, useMemo as b, useState as x } from "react";
|
|
36
|
+
import { BanIcon as he, FileCheckIcon as ge, Trash2Icon as _e } from "lucide-react";
|
|
36
37
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js
|
|
37
|
-
var
|
|
38
|
+
var ve = 10, S = 100, ye = 3, be = [{
|
|
38
39
|
id: "addedOnLabel",
|
|
39
40
|
desc: !0
|
|
40
41
|
}], C = {
|
|
41
42
|
AllBills: "allBills",
|
|
42
43
|
PossibleDuplicates: "possibleDuplicates"
|
|
43
44
|
};
|
|
44
|
-
function
|
|
45
|
+
function xe(e, t) {
|
|
45
46
|
let n = new Map(e.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map(), i = (e) => {
|
|
46
47
|
r.has(e) || r.set(e, /* @__PURE__ */ new Set());
|
|
47
48
|
}, a = (e, t) => {
|
|
@@ -54,7 +55,7 @@ function be(e, t) {
|
|
|
54
55
|
for (let n of e) a(t.id, n.matched_payable_id);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
let o =
|
|
58
|
+
let o = [], s = /* @__PURE__ */ new Set();
|
|
58
59
|
for (let e of r.keys()) {
|
|
59
60
|
if (s.has(e)) continue;
|
|
60
61
|
let i = [], a = [e];
|
|
@@ -64,95 +65,113 @@ function be(e, t) {
|
|
|
64
65
|
for (let t of r.get(e) ?? []) s.has(t) || (s.add(t), a.push(t));
|
|
65
66
|
}
|
|
66
67
|
if (i.length === 0) continue;
|
|
67
|
-
let c = i.map((e) => n.get(e)).filter((e) => !!e).sort(l), u = d(c), [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
let c = i.map((e) => n.get(e)).filter((e) => !!e).sort(l), u = d(c), [f] = c, p = ee(f), m = f?.document_id ?? "", te = u ?? f?.id ?? e, h = `duplicate-group:${p || m ? `${p}|${m}` : te}`;
|
|
69
|
+
o.push({
|
|
70
|
+
componentIds: i,
|
|
71
|
+
baseKey: h,
|
|
72
|
+
anchorId: te,
|
|
73
|
+
group: {
|
|
74
|
+
label: t.groupHeader({
|
|
75
|
+
vendorLabel: p,
|
|
76
|
+
invoiceNumberLabel: m
|
|
77
|
+
}),
|
|
78
|
+
title: p,
|
|
79
|
+
meta: m ? t.groupInvoice(m) : void 0,
|
|
80
|
+
invoiceNumberLabel: m,
|
|
81
|
+
vendorCounterpartId: f?.counterpart_id ?? void 0,
|
|
82
|
+
originalPayableId: u
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
let u = /* @__PURE__ */ new Map();
|
|
87
|
+
for (let { baseKey: e } of o) u.set(e, (u.get(e) ?? 0) + 1);
|
|
88
|
+
let f = /* @__PURE__ */ new Map();
|
|
89
|
+
for (let { componentIds: e, baseKey: t, anchorId: n, group: r } of o) {
|
|
90
|
+
let i = (u.get(t) ?? 0) > 1 ? `${t}:${n}` : t, a = {
|
|
91
|
+
...r,
|
|
92
|
+
key: i
|
|
74
93
|
};
|
|
75
|
-
for (let
|
|
94
|
+
for (let t of e) f.set(t, a);
|
|
76
95
|
}
|
|
77
|
-
return
|
|
96
|
+
return f;
|
|
78
97
|
}
|
|
79
|
-
function
|
|
80
|
-
let
|
|
81
|
-
|
|
82
|
-
let k =
|
|
98
|
+
function Se({ enabled: c = !0, canPay: d, canReadVendors: m = !0, isVendorFilterPaused: le = !1, filterLabels: Se, onOpenBill: Ee, duplicateRowNote: De, attachmentLabel: Oe, duplicateGroupLabels: w, canManageDuplicates: ke = !1, duplicateView: T = C.AllBills, scheduledRelativeDayLabels: Ae }) {
|
|
99
|
+
let je = i(), [E, Me] = x(ne), [Ne, Pe] = x(be), [D, Fe] = x(ve), [Ie, O] = x(), [Le, Re] = x(d);
|
|
100
|
+
d !== void 0 && Le !== d && (Re(d), O(void 0));
|
|
101
|
+
let k = d ?? Le, [ze, A] = x(0), [j, M] = x(""), [N, Be] = x(""), [P, F] = x(), [I, Ve] = x(), L = y(() => {
|
|
83
102
|
O(void 0), A(0);
|
|
84
103
|
}, []);
|
|
85
|
-
|
|
104
|
+
me(() => {
|
|
86
105
|
if (j === N) return;
|
|
87
106
|
let e = setTimeout(() => {
|
|
88
|
-
|
|
107
|
+
Be(j), L();
|
|
89
108
|
}, 300);
|
|
90
109
|
return () => clearTimeout(e);
|
|
91
110
|
}, [
|
|
92
111
|
j,
|
|
93
112
|
N,
|
|
94
|
-
|
|
95
|
-
]),
|
|
96
|
-
|
|
97
|
-
}, [T,
|
|
98
|
-
let
|
|
99
|
-
offersStatusFilter: E ===
|
|
100
|
-
offersVendorFilter:
|
|
101
|
-
isVendorFilterPaused:
|
|
102
|
-
labels:
|
|
103
|
-
onFiltersChange:
|
|
104
|
-
}), { clearAll:
|
|
105
|
-
let e = re(
|
|
113
|
+
L
|
|
114
|
+
]), me(() => {
|
|
115
|
+
L();
|
|
116
|
+
}, [T, L]);
|
|
117
|
+
let R = T === C.PossibleDuplicates, z = ce({
|
|
118
|
+
offersStatusFilter: E === _.All && !R,
|
|
119
|
+
offersVendorFilter: m,
|
|
120
|
+
isVendorFilterPaused: le,
|
|
121
|
+
labels: Se,
|
|
122
|
+
onFiltersChange: L
|
|
123
|
+
}), { clearAll: He, filterByVendor: Ue } = z, We = Ne[0], Ge = oe(We?.id), Ke = Ge ? We?.desc ? "desc" : "asc" : void 0, B = R ? _.All : E, qe = b(() => {
|
|
124
|
+
let e = re(B, k ?? !1);
|
|
106
125
|
return {
|
|
107
|
-
...
|
|
126
|
+
...z.query,
|
|
108
127
|
...e,
|
|
109
|
-
limit:
|
|
110
|
-
pagination_token:
|
|
111
|
-
status__in:
|
|
112
|
-
duplicate_match_status:
|
|
128
|
+
limit: R ? S : D,
|
|
129
|
+
pagination_token: R ? void 0 : Ie,
|
|
130
|
+
status__in: R ? void 0 : e.status__in ?? z.query.status__in,
|
|
131
|
+
duplicate_match_status: R ? "suspected" : void 0,
|
|
113
132
|
counterpart_name__icontains: N || void 0,
|
|
114
|
-
sort:
|
|
115
|
-
order:
|
|
133
|
+
sort: Ge,
|
|
134
|
+
order: Ke
|
|
116
135
|
};
|
|
117
136
|
}, [
|
|
118
|
-
|
|
137
|
+
z.query,
|
|
119
138
|
D,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
139
|
+
Ie,
|
|
140
|
+
R,
|
|
141
|
+
B,
|
|
123
142
|
k,
|
|
124
143
|
N,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
]), { organizationId:
|
|
128
|
-
...
|
|
129
|
-
enabled: c &&
|
|
144
|
+
Ge,
|
|
145
|
+
Ke
|
|
146
|
+
]), { organizationId: Je } = r(), V = JSON.stringify([Je, qe]), H = fe({
|
|
147
|
+
...qe,
|
|
148
|
+
enabled: c && d !== void 0 && !R,
|
|
130
149
|
pollWhileOcrProcessing: !0
|
|
131
|
-
}),
|
|
132
|
-
...
|
|
133
|
-
enabled: c &&
|
|
134
|
-
maxPages:
|
|
135
|
-
}),
|
|
136
|
-
...
|
|
137
|
-
data: { data:
|
|
138
|
-
isLoading:
|
|
139
|
-
isFetching:
|
|
140
|
-
} :
|
|
150
|
+
}), U = de({
|
|
151
|
+
...qe,
|
|
152
|
+
enabled: c && R,
|
|
153
|
+
maxPages: ye
|
|
154
|
+
}), W = R ? {
|
|
155
|
+
...U,
|
|
156
|
+
data: { data: U.payables },
|
|
157
|
+
isLoading: U.isResolving,
|
|
158
|
+
isFetching: U.isFetching || U.isResolving
|
|
159
|
+
} : H, G = (W.data?.data ?? []).filter((e) => e.ocr_status !== "processing"), K = h(), q = y(async (t, n, r, i) => {
|
|
141
160
|
let a = u(t, n, i);
|
|
142
161
|
if (a.length) try {
|
|
143
|
-
await
|
|
162
|
+
await K.mutateAsync({
|
|
144
163
|
verdict: n,
|
|
145
164
|
targets: a.map((e) => ({
|
|
146
165
|
payableId: t.id,
|
|
147
166
|
duplicateId: e.id,
|
|
148
167
|
matchedPayableId: e.matched_payable_id,
|
|
149
|
-
removeBy:
|
|
168
|
+
removeBy: p(t.status)
|
|
150
169
|
}))
|
|
151
170
|
}), e.success(r);
|
|
152
171
|
} catch {
|
|
153
172
|
e.error(w.actionFailedToast);
|
|
154
173
|
}
|
|
155
|
-
}, [
|
|
174
|
+
}, [K, w.actionFailedToast]), J = b(() => ({
|
|
156
175
|
delete: {
|
|
157
176
|
action: w.deleteAction,
|
|
158
177
|
title: w.deleteConfirmTitle,
|
|
@@ -177,70 +196,77 @@ function xe({ enabled: c = !0, canPay: l, canReadVendors: d = !0, isVendorFilter
|
|
|
177
196
|
backButton: w.cancelConfirmBackButton,
|
|
178
197
|
toast: w.confirmedToast
|
|
179
198
|
}
|
|
180
|
-
}), [w]),
|
|
181
|
-
P && (await
|
|
199
|
+
}), [w]), Ye = P?.removeBy ?? "cancel", Xe = y(async () => {
|
|
200
|
+
P && (await q(P.payable, a.Remove, J[P.removeBy].toast), F(void 0));
|
|
182
201
|
}, [
|
|
183
|
-
|
|
202
|
+
q,
|
|
184
203
|
P,
|
|
185
|
-
|
|
186
|
-
]),
|
|
187
|
-
I && (await
|
|
204
|
+
J
|
|
205
|
+
]), Ze = y(async () => {
|
|
206
|
+
I && (await q(I.payable, a.Keep, w.dismissedToast, I.originalPayableId), Ve(void 0));
|
|
188
207
|
}, [
|
|
189
|
-
|
|
208
|
+
q,
|
|
190
209
|
w.dismissedToast,
|
|
191
210
|
I
|
|
192
|
-
]), [
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}, [
|
|
196
|
-
let
|
|
211
|
+
]), [Qe, $e] = x(V);
|
|
212
|
+
me(() => {
|
|
213
|
+
W.isFetching || $e(V);
|
|
214
|
+
}, [W.isFetching, V]);
|
|
215
|
+
let et = W.data?.data.length, tt = et === 0, nt = pe({ enabled: c && tt }), rt = !tt || (nt.data?.count ?? 1) > 0, Y = b(() => T === C.PossibleDuplicates ? xe(G, w) : /* @__PURE__ */ new Map(), [
|
|
197
216
|
T,
|
|
198
|
-
|
|
217
|
+
G,
|
|
199
218
|
w
|
|
200
|
-
]),
|
|
201
|
-
if (
|
|
219
|
+
]), it = b(() => {
|
|
220
|
+
if (Y.size === 0) return G;
|
|
202
221
|
let e = /* @__PURE__ */ new Map();
|
|
203
|
-
return
|
|
204
|
-
let r =
|
|
222
|
+
return G.forEach((t, n) => {
|
|
223
|
+
let r = Y.get(t.id)?.key;
|
|
205
224
|
r !== void 0 && !e.has(r) && e.set(r, n);
|
|
206
|
-
}),
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
};
|
|
214
|
-
}).sort((e, t) => e.order - t.order || e.leads - t.leads || e.index - t.index).map(({ payable: e }) => e);
|
|
215
|
-
}, [K, X]), { vendorNames: nt, lookup: rt } = le({
|
|
216
|
-
payables: G.data?.data,
|
|
225
|
+
}), G.map((t, n) => ({
|
|
226
|
+
payable: t,
|
|
227
|
+
index: n,
|
|
228
|
+
order: e.get(Y.get(t.id)?.key ?? "") ?? n
|
|
229
|
+
})).sort((e, t) => e.order - t.order || l(e.payable, t.payable) || e.index - t.index).map(({ payable: e }) => e);
|
|
230
|
+
}, [G, Y]), { vendorNames: X, lookup: at } = ue({
|
|
231
|
+
payables: W.data?.data,
|
|
217
232
|
enabled: c,
|
|
218
|
-
canReadVendors:
|
|
219
|
-
isPaused:
|
|
220
|
-
}),
|
|
221
|
-
let
|
|
233
|
+
canReadVendors: m,
|
|
234
|
+
isPaused: le
|
|
235
|
+
}), ot = y((e) => {
|
|
236
|
+
let t = e.title || (e.vendorCounterpartId ? X.get(e.vendorCounterpartId) ?? "" : "");
|
|
237
|
+
return {
|
|
238
|
+
key: e.key,
|
|
239
|
+
label: t === e.title ? e.label : w.groupHeader({
|
|
240
|
+
vendorLabel: t,
|
|
241
|
+
invoiceNumberLabel: e.invoiceNumberLabel
|
|
242
|
+
}),
|
|
243
|
+
title: t,
|
|
244
|
+
meta: e.meta
|
|
245
|
+
};
|
|
246
|
+
}, [X, w]), Z = b(() => Ce(it.map((e) => {
|
|
247
|
+
let r = te({
|
|
222
248
|
apiStatus: e.status,
|
|
223
249
|
dueDate: e.due_date,
|
|
224
250
|
scheduledPaymentDate: e.scheduled_payment_date
|
|
225
|
-
}), i = e.amount_due ?? e.total_amount, a = e.status === "partially_paid" || e.status === "paid", c = (t) => t == null ? "" : n(t / 100, { currencyCode: e.currency ?? "USD" }), l = o(e.scheduled_payment_date,
|
|
251
|
+
}), i = e.amount_due ?? e.total_amount, a = e.status === "partially_paid" || e.status === "paid", c = (t) => t == null ? "" : n(t / 100, { currencyCode: e.currency ?? "USD" }), l = o(e.scheduled_payment_date, Ae, je), u = Y.get(e.id), d = s(e), m = ee(e) || (e.counterpart_id ? X.get(e.counterpart_id) ?? "" : ""), h = e.document_id ?? "", g = p(e.status), ne = u?.originalPayableId !== void 0 && u.originalPayableId === e.id, v = R && d && ke && u ? {
|
|
226
252
|
triggerLabel: w.menuTrigger({
|
|
227
|
-
vendorLabel:
|
|
228
|
-
invoiceNumberLabel:
|
|
253
|
+
vendorLabel: m,
|
|
254
|
+
invoiceNumberLabel: h
|
|
229
255
|
}),
|
|
230
256
|
items: [{
|
|
231
257
|
id: "not-duplicate",
|
|
232
258
|
label: w.notDuplicateAction,
|
|
233
|
-
icon:
|
|
234
|
-
disabled:
|
|
235
|
-
onSelect: () =>
|
|
259
|
+
icon: ge,
|
|
260
|
+
disabled: K.isPending,
|
|
261
|
+
onSelect: () => Ve({
|
|
236
262
|
payable: e,
|
|
237
|
-
originalPayableId:
|
|
263
|
+
originalPayableId: ne ? void 0 : u.originalPayableId
|
|
238
264
|
})
|
|
239
265
|
}, ...g ? [{
|
|
240
266
|
id: "cancel-duplicate",
|
|
241
|
-
label:
|
|
242
|
-
icon: g === "delete" ?
|
|
243
|
-
disabled:
|
|
267
|
+
label: J[g].action,
|
|
268
|
+
icon: g === "delete" ? _e : he,
|
|
269
|
+
disabled: K.isPending,
|
|
244
270
|
onSelect: () => F({
|
|
245
271
|
payable: e,
|
|
246
272
|
removeBy: g
|
|
@@ -249,126 +275,122 @@ function xe({ enabled: c = !0, canPay: l, canReadVendors: d = !0, isVendorFilter
|
|
|
249
275
|
} : void 0;
|
|
250
276
|
return {
|
|
251
277
|
rowKey: e.id,
|
|
252
|
-
vendorLabel:
|
|
253
|
-
vendorLookup:
|
|
254
|
-
invoiceNumberLabel:
|
|
278
|
+
vendorLabel: m,
|
|
279
|
+
vendorLookup: m || !e.counterpart_id ? void 0 : Te(at),
|
|
280
|
+
invoiceNumberLabel: h,
|
|
255
281
|
issueDateLabel: t(e.issued_at),
|
|
256
282
|
dueDateLabel: t(e.due_date),
|
|
257
283
|
dueDateTone: r.isOverdue ? "danger" : "default",
|
|
258
284
|
scheduledDateLabel: l.label,
|
|
259
285
|
scheduledDateExact: l.absoluteLabel,
|
|
260
|
-
scheduledDateIsGap:
|
|
286
|
+
scheduledDateIsGap: B === _.Scheduled,
|
|
261
287
|
paidDateLabel: t(e.paid_at?.slice(0, 10)),
|
|
262
288
|
amountDueLabel: c(i),
|
|
263
289
|
amountPaidLabel: a ? c(e.amount_paid) : "",
|
|
264
|
-
amountPaidIsGap:
|
|
290
|
+
amountPaidIsGap: B === _.Paid,
|
|
265
291
|
amountScheduledLabel: c(e.amount_to_pay ?? i),
|
|
266
292
|
totalAmountLabel: c(e.total_amount),
|
|
267
|
-
attachment: e.file_id ? { label:
|
|
293
|
+
attachment: e.file_id ? { label: Oe } : void 0,
|
|
268
294
|
status: r.status,
|
|
269
295
|
statusTone: r.tone,
|
|
270
296
|
addedOnLabel: t(e.created_at?.slice(0, 10)),
|
|
271
|
-
...u ? {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
...u.originalPayableId !== void 0 && !_ ? {
|
|
277
|
-
isNested: !0,
|
|
278
|
-
groupedRowLabel: w.copyRow
|
|
279
|
-
} : {}
|
|
280
|
-
} : {},
|
|
281
|
-
...re ? { menu: re } : {},
|
|
282
|
-
...!z && !u && d ? {
|
|
283
|
-
rowTone: "warning",
|
|
284
|
-
rowNote: Te
|
|
297
|
+
...u ? { group: ot(u) } : {},
|
|
298
|
+
...v ? { menu: v } : {},
|
|
299
|
+
...!R && !u && d ? {
|
|
300
|
+
marker: "duplicate",
|
|
301
|
+
rowNote: De
|
|
285
302
|
} : {},
|
|
286
|
-
onOpen: () =>
|
|
303
|
+
onOpen: () => Ee(e.id, f(e.status))
|
|
287
304
|
};
|
|
288
|
-
}), [
|
|
289
|
-
|
|
290
|
-
X,
|
|
291
|
-
w,
|
|
305
|
+
}), w), [
|
|
306
|
+
it,
|
|
292
307
|
Y,
|
|
293
|
-
|
|
308
|
+
w,
|
|
309
|
+
J,
|
|
310
|
+
K.isPending,
|
|
311
|
+
ke,
|
|
312
|
+
R,
|
|
294
313
|
De,
|
|
295
|
-
z,
|
|
296
|
-
Te,
|
|
297
|
-
Ee,
|
|
298
314
|
Oe,
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
315
|
+
Ae,
|
|
316
|
+
je,
|
|
317
|
+
Ee,
|
|
318
|
+
B,
|
|
319
|
+
X,
|
|
320
|
+
at,
|
|
321
|
+
ot
|
|
322
|
+
]), st = b(() => R ? we(Z, S) : [], [Z, R]), Q = Math.min(ze, Math.max(0, st.length - 1)), ct = R ? st[Q] ?? [] : Z, $ = y((e) => {
|
|
305
323
|
let t = e;
|
|
306
|
-
|
|
324
|
+
Me(t), Pe((e) => {
|
|
307
325
|
let n = e[0]?.id;
|
|
308
|
-
return n ?
|
|
309
|
-
}),
|
|
310
|
-
}, [
|
|
311
|
-
$(
|
|
312
|
-
}, [
|
|
313
|
-
M(""),
|
|
314
|
-
}, [
|
|
315
|
-
|
|
316
|
-
}, [
|
|
317
|
-
|
|
318
|
-
}, [
|
|
319
|
-
|
|
326
|
+
return n ? v(t).some((e) => ae(e) === n) ? e : be : e;
|
|
327
|
+
}), L();
|
|
328
|
+
}, [L]), lt = y((e) => {
|
|
329
|
+
$(_.All), M(""), Ue(e);
|
|
330
|
+
}, [Ue, $]), ut = y(() => {
|
|
331
|
+
M(""), Be(""), He(), L();
|
|
332
|
+
}, [He, L]), dt = y((e) => {
|
|
333
|
+
Pe((t) => typeof e == "function" ? e(t) : e), L();
|
|
334
|
+
}, [L]), ft = y((e) => {
|
|
335
|
+
Fe(e), L();
|
|
336
|
+
}, [L]), pt = y(() => {
|
|
337
|
+
R ? A(Q + 1) : O(H.data?.next_pagination_token ?? void 0);
|
|
320
338
|
}, [
|
|
321
339
|
Q,
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
]),
|
|
325
|
-
|
|
340
|
+
R,
|
|
341
|
+
H.data?.next_pagination_token
|
|
342
|
+
]), mt = y(() => {
|
|
343
|
+
R ? A(Math.max(0, Q - 1)) : O(H.data?.prev_pagination_token ?? void 0);
|
|
326
344
|
}, [
|
|
327
345
|
Q,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
]),
|
|
331
|
-
|
|
332
|
-
}, [
|
|
346
|
+
R,
|
|
347
|
+
H.data?.prev_pagination_token
|
|
348
|
+
]), ht = y(() => {
|
|
349
|
+
W.refetch();
|
|
350
|
+
}, [W.refetch]);
|
|
333
351
|
return {
|
|
334
|
-
rows:
|
|
335
|
-
isLoading:
|
|
336
|
-
isError:
|
|
337
|
-
onRetry:
|
|
352
|
+
rows: ct,
|
|
353
|
+
isLoading: W.isLoading || !R && k === void 0 || V !== Qe || tt && nt.isLoading || (et ?? 0) > 0 && ct.length === 0,
|
|
354
|
+
isError: W.isError,
|
|
355
|
+
onRetry: ht,
|
|
338
356
|
selectedFilterTabId: E,
|
|
339
357
|
onFilterTabChange: $,
|
|
340
|
-
showVendorBills:
|
|
341
|
-
clearQueryConstraints:
|
|
358
|
+
showVendorBills: lt,
|
|
359
|
+
clearQueryConstraints: ut,
|
|
342
360
|
searchValue: j,
|
|
343
361
|
onSearchChange: M,
|
|
344
|
-
hasAnyBills:
|
|
345
|
-
isSearchActive: N.length > 0 ||
|
|
346
|
-
filterBarProps:
|
|
347
|
-
visibleColumns:
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
362
|
+
hasAnyBills: rt,
|
|
363
|
+
isSearchActive: N.length > 0 || z.isFilterActive,
|
|
364
|
+
filterBarProps: z.filterBarProps,
|
|
365
|
+
visibleColumns: R ? [
|
|
366
|
+
g.AddedOn,
|
|
367
|
+
g.DueDate,
|
|
368
|
+
g.AmountDue,
|
|
369
|
+
g.Status
|
|
370
|
+
] : v(E),
|
|
371
|
+
keepsColumnOrder: R,
|
|
372
|
+
isSortable: !R,
|
|
373
|
+
pageInfo: R ? w.pageInfo({
|
|
374
|
+
billCount: Z.length,
|
|
375
|
+
invoiceCount: new Set(Z.map((e) => e.group?.key ?? e.rowKey)).size
|
|
376
|
+
}) : void 0,
|
|
377
|
+
showAddPanelWhenEmpty: !R && ie(E),
|
|
378
|
+
sorting: Ne,
|
|
379
|
+
onSortingChange: dt,
|
|
380
|
+
pageSize: R ? S : D,
|
|
381
|
+
pageSizeOptions: R ? [S] : void 0,
|
|
382
|
+
onPageSizeChange: ft,
|
|
383
|
+
hasNextPage: R ? Q < st.length - 1 : !!H.data?.next_pagination_token,
|
|
384
|
+
hasPrevPage: R ? Q > 0 : !!H.data?.prev_pagination_token,
|
|
385
|
+
onNextPage: pt,
|
|
386
|
+
onPrevPage: mt,
|
|
365
387
|
cancelConfirmation: {
|
|
366
388
|
open: !!P,
|
|
367
|
-
copy: se(
|
|
368
|
-
onConfirm: () => void
|
|
389
|
+
copy: se(J[Ye], Ye),
|
|
390
|
+
onConfirm: () => void Xe(),
|
|
369
391
|
onCancel: () => F(void 0),
|
|
370
|
-
isPending:
|
|
371
|
-
cancelButtonLabel:
|
|
392
|
+
isPending: K.isPending,
|
|
393
|
+
cancelButtonLabel: J[Ye].backButton
|
|
372
394
|
},
|
|
373
395
|
keepConfirmation: {
|
|
374
396
|
open: !!I,
|
|
@@ -378,25 +400,52 @@ function xe({ enabled: c = !0, canPay: l, canReadVendors: d = !0, isVendorFilter
|
|
|
378
400
|
confirmButton: w.notDuplicateConfirmButton,
|
|
379
401
|
presentation: {
|
|
380
402
|
alignment: "center",
|
|
381
|
-
icon:
|
|
403
|
+
icon: ge,
|
|
382
404
|
actionWidth: "equal"
|
|
383
405
|
}
|
|
384
406
|
},
|
|
385
|
-
onConfirm: () => void
|
|
386
|
-
onCancel: () =>
|
|
387
|
-
isPending:
|
|
407
|
+
onConfirm: () => void Ze(),
|
|
408
|
+
onCancel: () => Ve(void 0),
|
|
409
|
+
isPending: K.isPending,
|
|
388
410
|
cancelButtonLabel: w.notDuplicateConfirmBackButton
|
|
389
411
|
}
|
|
390
412
|
};
|
|
391
413
|
}
|
|
392
|
-
function
|
|
414
|
+
function Ce(e, t) {
|
|
415
|
+
let n = /* @__PURE__ */ new Map();
|
|
416
|
+
for (let t of e) {
|
|
417
|
+
if (!t.group) continue;
|
|
418
|
+
let e = n.get(t.group.key) ?? [];
|
|
419
|
+
e.push(t.status), n.set(t.group.key, e);
|
|
420
|
+
}
|
|
421
|
+
return e.map((e) => {
|
|
422
|
+
if (!e.group) return e;
|
|
423
|
+
let r = m({
|
|
424
|
+
statuses: n.get(e.group.key) ?? [],
|
|
425
|
+
statusLabels: t.statusLabels,
|
|
426
|
+
labels: {
|
|
427
|
+
showMore: t.showMore,
|
|
428
|
+
showLess: t.showLess,
|
|
429
|
+
statusSummary: t.statusSummary
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
return r ? {
|
|
433
|
+
...e,
|
|
434
|
+
group: {
|
|
435
|
+
...e.group,
|
|
436
|
+
collapse: r
|
|
437
|
+
}
|
|
438
|
+
} : e;
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
function we(e, t) {
|
|
393
442
|
let n = [], r = [];
|
|
394
443
|
return e.forEach((i, a) => {
|
|
395
444
|
let o = i.group !== void 0 && i.group.key === e[a - 1]?.group?.key;
|
|
396
445
|
r.length >= t && !o && (n.push(r), r = []), r.push(i);
|
|
397
446
|
}), r.length && n.push(r), n;
|
|
398
447
|
}
|
|
399
|
-
function
|
|
400
|
-
return e ===
|
|
448
|
+
function Te(e) {
|
|
449
|
+
return e === le.Settled ? void 0 : e;
|
|
401
450
|
}
|
|
402
|
-
export { C as BillDuplicateView,
|
|
451
|
+
export { C as BillDuplicateView, Se as useBillsTable };
|