@tesouro/embedded-components-react 0.5.263 → 0.5.265
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/README.md +29 -29
- package/dist/index.d.ts +24 -33
- package/dist/lib/ReceivablesWidget.d.ts +24 -33
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +18 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +49 -131
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/permissions.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +73 -90
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +128 -170
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +18 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +127 -292
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -40,27 +40,7 @@ function w() {
|
|
|
40
40
|
...m()
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
function T(e) {
|
|
44
|
-
return e === "quotes" ? "quote" : e === "credit_notes" ? "credit_note" : "invoice";
|
|
45
|
-
}
|
|
46
|
-
function E(e) {
|
|
47
|
-
return e === "quote" ? "quotes" : e === "credit_note" ? "credit_notes" : "invoices";
|
|
48
|
-
}
|
|
49
|
-
function D(e) {
|
|
50
|
-
return (e?.length ? e : [
|
|
51
|
-
"invoices",
|
|
52
|
-
"quotes",
|
|
53
|
-
"credit_notes"
|
|
54
|
-
]).filter((e, t, n) => [
|
|
55
|
-
"invoices",
|
|
56
|
-
"quotes",
|
|
57
|
-
"credit_notes"
|
|
58
|
-
].includes(e) && n.indexOf(e) === t);
|
|
59
|
-
}
|
|
60
|
-
function O({ defaultTab: e, enabledTabs: t }) {
|
|
61
|
-
return e && t.includes(e) ? e : t[0] ?? "invoices";
|
|
62
|
-
}
|
|
63
|
-
function k(e, n) {
|
|
43
|
+
function T(e, n) {
|
|
64
44
|
let r = t(e);
|
|
65
45
|
return r ? new Intl.DateTimeFormat(void 0, {
|
|
66
46
|
day: "numeric",
|
|
@@ -68,58 +48,28 @@ function k(e, n) {
|
|
|
68
48
|
year: "numeric"
|
|
69
49
|
}).format(r) : n;
|
|
70
50
|
}
|
|
71
|
-
function
|
|
51
|
+
function E({ amount: t, currency: n, fallback: r }) {
|
|
72
52
|
return t == null || !n ? r : new Intl.NumberFormat(void 0, {
|
|
73
53
|
currency: n,
|
|
74
54
|
style: "currency"
|
|
75
55
|
}).format(t / 10 ** e(n));
|
|
76
56
|
}
|
|
77
|
-
function
|
|
57
|
+
function D(t, n) {
|
|
78
58
|
let r = Number(t);
|
|
79
59
|
if (!Number.isFinite(r)) return;
|
|
80
60
|
let i = n ? e(n) : 2;
|
|
81
61
|
return Math.round(r * 10 ** i);
|
|
82
62
|
}
|
|
83
|
-
function
|
|
63
|
+
function O(e, t) {
|
|
84
64
|
return e.document_id || t.untitledDocument;
|
|
85
65
|
}
|
|
86
|
-
function
|
|
66
|
+
function k(e, t) {
|
|
87
67
|
return e === "quote" ? t.quoteType : e === "credit_note" ? t.creditNoteType : t.invoiceType;
|
|
88
68
|
}
|
|
89
|
-
function
|
|
69
|
+
function A(e) {
|
|
90
70
|
return e === "paid" || e === "accepted" || e === "issued" || e === "recurring" ? "success" : e === "draft" || e === "issuing" ? "neutral" : e === "overdue" || e === "partially_paid" ? "warning" : e === "failed" || e === "declined" || e === "expired" || e === "uncollectible" || e === "canceled" || e === "deleted" ? "danger" : "info";
|
|
91
71
|
}
|
|
92
|
-
function
|
|
93
|
-
let t = e.status === "draft", n = e.status === "issued", r = e.type === "invoice", i = e.type === "quote", a = e.type === "credit_note", o = r && [
|
|
94
|
-
"issued",
|
|
95
|
-
"overdue",
|
|
96
|
-
"partially_paid"
|
|
97
|
-
].includes(e.status);
|
|
98
|
-
return {
|
|
99
|
-
edit: t && !a,
|
|
100
|
-
accept: i && n,
|
|
101
|
-
cancel: ![
|
|
102
|
-
"paid",
|
|
103
|
-
"canceled",
|
|
104
|
-
"deleted",
|
|
105
|
-
"uncollectible"
|
|
106
|
-
].includes(e.status) && !t,
|
|
107
|
-
clone: !a && e.status !== "deleted",
|
|
108
|
-
decline: i && n,
|
|
109
|
-
delete: t,
|
|
110
|
-
issue: t,
|
|
111
|
-
markPaid: o,
|
|
112
|
-
markUncollectible: o,
|
|
113
|
-
recordPayment: o,
|
|
114
|
-
send: [
|
|
115
|
-
"issued",
|
|
116
|
-
"accepted",
|
|
117
|
-
"overdue",
|
|
118
|
-
"partially_paid"
|
|
119
|
-
].includes(e.status) && !a
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
function I(e, t, n) {
|
|
72
|
+
function j(e, t, n) {
|
|
123
73
|
let r = e.counterpart_name || (e.counterpart_id ? t.names.get(e.counterpart_id) : void 0);
|
|
124
74
|
return r ? {
|
|
125
75
|
customerLabel: r,
|
|
@@ -132,46 +82,34 @@ function I(e, t, n) {
|
|
|
132
82
|
customerState: "missing"
|
|
133
83
|
};
|
|
134
84
|
}
|
|
135
|
-
var
|
|
85
|
+
var M = {
|
|
136
86
|
names: /* @__PURE__ */ new Map(),
|
|
137
87
|
isResolving: !1
|
|
138
88
|
};
|
|
139
|
-
function
|
|
140
|
-
return e.map((e) => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}),
|
|
156
|
-
amountDueLabel: A({
|
|
157
|
-
amount: i,
|
|
158
|
-
currency: e.currency,
|
|
159
|
-
fallback: t.notAvailable
|
|
160
|
-
}),
|
|
161
|
-
actions: {
|
|
162
|
-
...F(e),
|
|
163
|
-
...n ? {} : { recordPayment: !1 }
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
});
|
|
89
|
+
function N({ receivables: e, messages: t, customerNames: n = M }) {
|
|
90
|
+
return e.map((e) => ({
|
|
91
|
+
id: e.id,
|
|
92
|
+
type: e.type,
|
|
93
|
+
documentLabel: e.document_id || t.pendingValue,
|
|
94
|
+
...j(e, n, t),
|
|
95
|
+
status: e.status,
|
|
96
|
+
statusTone: A(e.status),
|
|
97
|
+
issueDateLabel: T(e.issue_date, t.pendingValue),
|
|
98
|
+
dueDateLabel: T(e.type === "invoice" ? e.due_date : void 0, t.pendingValue),
|
|
99
|
+
totalLabel: E({
|
|
100
|
+
amount: e.total_amount,
|
|
101
|
+
currency: e.currency,
|
|
102
|
+
fallback: ""
|
|
103
|
+
})
|
|
104
|
+
}));
|
|
167
105
|
}
|
|
168
|
-
function
|
|
106
|
+
function P(e) {
|
|
169
107
|
if (e.memo || e.footer) return {
|
|
170
108
|
opening: e.memo || void 0,
|
|
171
109
|
closing: e.footer || void 0
|
|
172
110
|
};
|
|
173
111
|
}
|
|
174
|
-
function
|
|
112
|
+
function F({ values: e, counterpart: t, addresses: n }) {
|
|
175
113
|
let r = n?.length && t?.id === e.customerId ? t : void 0, i = e.billingAddressId || r?.default_billing_address_id || (n?.length === 1 ? n[0].id : ""), a = e.shippingAddressId || r?.default_shipping_address_id || "";
|
|
176
114
|
return {
|
|
177
115
|
billingAddressId: i,
|
|
@@ -179,7 +117,7 @@ function B({ values: e, counterpart: t, addresses: n }) {
|
|
|
179
117
|
shippingAddressId: a
|
|
180
118
|
};
|
|
181
119
|
}
|
|
182
|
-
function
|
|
120
|
+
function I({ values: e, billingAddressId: t, messages: r, willIssue: i = !1, hasStartedRecurrence: a = !1 }) {
|
|
183
121
|
let o = {};
|
|
184
122
|
e.customerId ? t || (o.customerId = r.customerAddressRequired) : o.customerId = r.customerRequired;
|
|
185
123
|
let s = e.customerEmail.trim();
|
|
@@ -193,24 +131,24 @@ function V({ values: e, billingAddressId: t, messages: r, willIssue: i = !1, has
|
|
|
193
131
|
let f = x(e, r);
|
|
194
132
|
return f && (o.discount = f), o;
|
|
195
133
|
}
|
|
196
|
-
function
|
|
134
|
+
function L(e) {
|
|
197
135
|
return Object.keys(e).length > 0;
|
|
198
136
|
}
|
|
199
|
-
function
|
|
200
|
-
return !
|
|
201
|
-
values:
|
|
137
|
+
function R(e, t) {
|
|
138
|
+
return !L(I({
|
|
139
|
+
values: V(e),
|
|
202
140
|
billingAddressId: e.type === "invoice" ? e.counterpart_billing_address?.id ?? void 0 : void 0,
|
|
203
141
|
messages: t,
|
|
204
142
|
willIssue: !0
|
|
205
143
|
}));
|
|
206
144
|
}
|
|
207
|
-
function
|
|
145
|
+
function z({ bankAccountId: e, bankAccountType: t }) {
|
|
208
146
|
return {
|
|
209
147
|
bank_account_id: e || void 0,
|
|
210
148
|
bank_account_type: e && t || void 0
|
|
211
149
|
};
|
|
212
150
|
}
|
|
213
|
-
function
|
|
151
|
+
function B({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById: r }) {
|
|
214
152
|
let a = e.lineItems.filter((e) => !i(e)).map((t) => o({
|
|
215
153
|
lineItem: t,
|
|
216
154
|
currency: e.currency,
|
|
@@ -225,7 +163,7 @@ function G({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById
|
|
|
225
163
|
memo: e.openingNote,
|
|
226
164
|
footer: e.closingNote,
|
|
227
165
|
discount: y(e) ?? void 0,
|
|
228
|
-
...
|
|
166
|
+
...z(e)
|
|
229
167
|
};
|
|
230
168
|
return e.type === "quote" ? {
|
|
231
169
|
...s,
|
|
@@ -240,7 +178,7 @@ function G({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById
|
|
|
240
178
|
type: "invoice"
|
|
241
179
|
};
|
|
242
180
|
}
|
|
243
|
-
function
|
|
181
|
+
function V(e, t) {
|
|
244
182
|
let n = e.type === "quote" ? "quote" : "invoice", i = u(e.line_items), a = e.type === "invoice" ? e : void 0, o = e.line_items.map((n) => c({
|
|
245
183
|
lineItem: n,
|
|
246
184
|
currency: e.currency,
|
|
@@ -251,8 +189,8 @@ function K(e, t) {
|
|
|
251
189
|
type: n,
|
|
252
190
|
customerId: e.counterpart_id,
|
|
253
191
|
currency: e.currency,
|
|
254
|
-
issueDate:
|
|
255
|
-
dueDate: e.type === "quote" ?
|
|
192
|
+
issueDate: K(e.issue_date),
|
|
193
|
+
dueDate: e.type === "quote" ? K(e.expiry_date) : "",
|
|
256
194
|
openingNote: e.memo ?? "",
|
|
257
195
|
closingNote: e.footer ?? "",
|
|
258
196
|
...e.type === "invoice" ? _(e.payment_terms) : {},
|
|
@@ -261,7 +199,7 @@ function K(e, t) {
|
|
|
261
199
|
...b(e.discount, e.currency),
|
|
262
200
|
lineItems: o.length > 0 ? o : [r(e.currency)],
|
|
263
201
|
bankAccountId: e.bank_account_id ?? "",
|
|
264
|
-
bankAccountType:
|
|
202
|
+
bankAccountType: H(e.bank_account_type),
|
|
265
203
|
billingAddressId: e.counterpart_billing_address?.id ?? "",
|
|
266
204
|
shippingAddressId: e.counterpart_shipping_address?.id ?? "",
|
|
267
205
|
paymentReminderId: a?.payment_reminder_id ?? "",
|
|
@@ -269,10 +207,10 @@ function K(e, t) {
|
|
|
269
207
|
attachments: p(e)
|
|
270
208
|
};
|
|
271
209
|
}
|
|
272
|
-
function
|
|
210
|
+
function H(e) {
|
|
273
211
|
return e === "BANK_DETAILS" || e === "INTERNAL" || e === "EXTERNAL" ? e : "";
|
|
274
212
|
}
|
|
275
|
-
function
|
|
213
|
+
function U({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChanges: r }) {
|
|
276
214
|
let i = {
|
|
277
215
|
counterpart_billing_address_id: t,
|
|
278
216
|
counterpart_shipping_address_id: n || null,
|
|
@@ -282,7 +220,7 @@ function J({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChang
|
|
|
282
220
|
memo: e.openingNote,
|
|
283
221
|
footer: e.closingNote,
|
|
284
222
|
discount: y(e),
|
|
285
|
-
...
|
|
223
|
+
...z(e)
|
|
286
224
|
};
|
|
287
225
|
return e.type === "quote" ? { quote: {
|
|
288
226
|
...i,
|
|
@@ -298,7 +236,7 @@ function J({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChang
|
|
|
298
236
|
attachments: f(e.attachments) ?? null
|
|
299
237
|
} };
|
|
300
238
|
}
|
|
301
|
-
function
|
|
239
|
+
function W({ values: e, originalLineItems: t, originalCurrency: n, unitNamesById: r, units: o }) {
|
|
302
240
|
let l = u(t), d = a(e.taxRate, l), f = (e, t, n) => s({
|
|
303
241
|
lineItem: e,
|
|
304
242
|
currency: t,
|
|
@@ -324,7 +262,7 @@ function Y({ values: e, originalLineItems: t, originalCurrency: n, unitNamesById
|
|
|
324
262
|
...v.length ? { remove: v } : {}
|
|
325
263
|
};
|
|
326
264
|
}
|
|
327
|
-
function
|
|
265
|
+
function G({ values: e, originalLineItems: t, changes: n }) {
|
|
328
266
|
let r = e.lineItems.filter((e) => !i(e)).map((e) => e.id);
|
|
329
267
|
if (!t) return { created: r };
|
|
330
268
|
let a = new Set(t.map((e) => e.id));
|
|
@@ -333,20 +271,20 @@ function X({ values: e, originalLineItems: t, changes: n }) {
|
|
|
333
271
|
replaced: n?.replace?.map((e) => e.id) ?? []
|
|
334
272
|
};
|
|
335
273
|
}
|
|
336
|
-
function
|
|
274
|
+
function K(e) {
|
|
337
275
|
return e?.slice(0, 10) ?? "";
|
|
338
276
|
}
|
|
339
|
-
function
|
|
277
|
+
function q(e, t) {
|
|
340
278
|
let n = {};
|
|
341
279
|
return e.to.trim() || (n.to = t.sendToRequired), e.subject.trim() || (n.subject = t.sendSubjectRequired), e.body.trim() || (n.body = t.sendBodyRequired), n;
|
|
342
280
|
}
|
|
343
|
-
function
|
|
281
|
+
function J(e) {
|
|
344
282
|
return Object.keys(e).length > 0;
|
|
345
283
|
}
|
|
346
|
-
function
|
|
284
|
+
function Y(e) {
|
|
347
285
|
return e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
348
286
|
}
|
|
349
|
-
function
|
|
287
|
+
function X(e, t) {
|
|
350
288
|
return {
|
|
351
289
|
...C,
|
|
352
290
|
to: e?.counterpart_contact?.email ?? "",
|
|
@@ -354,25 +292,5 @@ function te(e, t) {
|
|
|
354
292
|
body: t.sendBodyDefault
|
|
355
293
|
};
|
|
356
294
|
}
|
|
357
|
-
function ne(e = "all") {
|
|
358
|
-
let t = [
|
|
359
|
-
"draft",
|
|
360
|
-
"issued",
|
|
361
|
-
"failed",
|
|
362
|
-
"accepted",
|
|
363
|
-
"expired",
|
|
364
|
-
"declined",
|
|
365
|
-
"recurring",
|
|
366
|
-
"partially_paid",
|
|
367
|
-
"paid",
|
|
368
|
-
"overdue",
|
|
369
|
-
"uncollectible",
|
|
370
|
-
"canceled"
|
|
371
|
-
];
|
|
372
|
-
return e !== "all" && !t.includes(e) && t.push(e), t.map((e) => ({
|
|
373
|
-
value: e,
|
|
374
|
-
label: e.split("_").map((e) => `${e.slice(0, 1).toUpperCase()}${e.slice(1)}`).join(" ")
|
|
375
|
-
}));
|
|
376
|
-
}
|
|
377
295
|
//#endregion
|
|
378
|
-
export { C as EMPTY_RECEIVABLE_SEND_VALUES,
|
|
296
|
+
export { C as EMPTY_RECEIVABLE_SEND_VALUES, P as buildReceivableNotesView, N as buildReceivableRows, w as createEmptyReceivableFormValues, r as createLineItem, X as defaultSendValues, T as formatDate, E as formatMoney, D as fromMajorUnits, O as getDocumentTitle, k as getDocumentTypeLabel, A as getStatusTone, L as hasReceivableFormErrors, J as hasSendErrors, R as isReceivableReadyToIssue, B as receivableFormValuesToCreatePayload, W as receivableFormValuesToLineItemChanges, U as receivableFormValuesToUpdatePayload, V as receivableToFormValues, F as resolveCounterpartAddresses, Y as splitEmailList, G as submittedLineItemRows, I as validateReceivableForm, q as validateSendValues };
|
|
@@ -39,6 +39,7 @@ var e = {
|
|
|
39
39
|
bankAccountCreated: "Bank Account \"{name}\" has been created.",
|
|
40
40
|
bankAccountCreateFailed: "Failed to create Bank Account.",
|
|
41
41
|
untitledDocument: "Untitled document",
|
|
42
|
+
pendingValue: "Pending",
|
|
42
43
|
unknownCustomer: "-",
|
|
43
44
|
notAvailable: "Not available",
|
|
44
45
|
invoiceType: "Invoice",
|
|
@@ -2,109 +2,92 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import "
|
|
7
|
-
import { buildReceivableRows as t, statusFilterOptions as n, typeForTab as r } from "./helpers.js";
|
|
8
|
-
import { useReceivablesQuery as i } from "../../../../data-access/dist/index12.js";
|
|
5
|
+
import { buildReceivableRows as e } from "./helpers.js";
|
|
6
|
+
import { useReceivablesQuery as t } from "../../../../data-access/dist/index12.js";
|
|
9
7
|
import "../../../../data-access/dist/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { useCallback as l, useEffect as u, useMemo as d, useState as f } from "react";
|
|
8
|
+
import { useInvoicesFilter as n } from "./useInvoicesFilter.js";
|
|
9
|
+
import { useReceivableCustomerNames as r } from "./useReceivableCustomerNames.js";
|
|
10
|
+
import { useReceivableStatusCards as i } from "./useReceivableStatusCards.js";
|
|
11
|
+
import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
|
|
15
12
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
13
|
+
var l = [], u = [{
|
|
14
|
+
id: "dueDateLabel",
|
|
15
|
+
desc: !0
|
|
16
|
+
}];
|
|
17
|
+
function d({ initialCounterpartId: d, messages: p, statusLabels: m, filterLabels: h, enabled: g = !0, visible: _ = g }) {
|
|
18
|
+
let [v, y] = c(u), [b, x] = c(10), [S, C] = c(), [w, T] = c(""), [E, D] = c(""), O = a(() => C(void 0), []), k = n({
|
|
19
|
+
initialCounterpartId: d,
|
|
20
|
+
search: w,
|
|
21
|
+
onSearchChange: T,
|
|
22
|
+
onFiltersChange: O,
|
|
23
|
+
statusLabels: m,
|
|
24
|
+
labels: h
|
|
25
|
+
});
|
|
26
|
+
o(() => {
|
|
29
27
|
let e = setTimeout(() => {
|
|
30
|
-
|
|
28
|
+
D(w), C(void 0);
|
|
31
29
|
}, 300);
|
|
32
30
|
return () => clearTimeout(e);
|
|
33
|
-
}, [
|
|
34
|
-
let
|
|
35
|
-
enabled:
|
|
36
|
-
type:
|
|
37
|
-
limit:
|
|
38
|
-
pagination_token:
|
|
39
|
-
search_text:
|
|
40
|
-
...
|
|
41
|
-
...
|
|
42
|
-
sort:
|
|
43
|
-
order:
|
|
31
|
+
}, [w]);
|
|
32
|
+
let A = v[0]?.id, j = A ? f[A] : void 0, M = v[0] ? v[0].desc ? "desc" : "asc" : void 0, N = t({
|
|
33
|
+
enabled: g,
|
|
34
|
+
type: "invoice",
|
|
35
|
+
limit: b,
|
|
36
|
+
pagination_token: S,
|
|
37
|
+
search_text: E || void 0,
|
|
38
|
+
...k.query,
|
|
39
|
+
...j ? {
|
|
40
|
+
sort: j,
|
|
41
|
+
order: M
|
|
44
42
|
} : {}
|
|
45
|
-
}),
|
|
46
|
-
enabled:
|
|
47
|
-
visible:
|
|
48
|
-
statusFilter:
|
|
49
|
-
messages:
|
|
50
|
-
statusLabels:
|
|
51
|
-
}),
|
|
52
|
-
receivables:
|
|
53
|
-
messages:
|
|
54
|
-
|
|
55
|
-
customerNames: Y
|
|
43
|
+
}), P = i({
|
|
44
|
+
enabled: g,
|
|
45
|
+
visible: _,
|
|
46
|
+
statusFilter: k.cardStatus,
|
|
47
|
+
messages: p,
|
|
48
|
+
statusLabels: m
|
|
49
|
+
}), F = N.data?.data ?? l, I = s(() => new Map(F.map((e) => [e.id, e])), [F]), L = a((e) => I.get(e), [I]), R = r(F), z = s(() => e({
|
|
50
|
+
receivables: F,
|
|
51
|
+
messages: p,
|
|
52
|
+
customerNames: R
|
|
56
53
|
}), [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}, []), te = l(() => O(H.data?.next_pagination_token ?? void 0), [H.data?.next_pagination_token]), ne = l(() => O(H.data?.prev_pagination_token ?? void 0), [H.data?.prev_pagination_token]), re = l(() => {
|
|
69
|
-
H.refetch();
|
|
70
|
-
}, [H]);
|
|
54
|
+
R,
|
|
55
|
+
p,
|
|
56
|
+
F
|
|
57
|
+
]), B = a((e) => {
|
|
58
|
+
let t = typeof e == "function" ? e(v) : e;
|
|
59
|
+
y(t[0] && Object.hasOwn(f, t[0].id) ? t : u), C(void 0);
|
|
60
|
+
}, [v]), V = a((e) => {
|
|
61
|
+
x(e), C(void 0);
|
|
62
|
+
}, []), H = a(() => C(N.data?.next_pagination_token ?? void 0), [N.data?.next_pagination_token]), U = a(() => C(N.data?.prev_pagination_token ?? void 0), [N.data?.prev_pagination_token]), W = a(() => {
|
|
63
|
+
N.refetch();
|
|
64
|
+
}, [N]);
|
|
71
65
|
return {
|
|
72
|
-
rows:
|
|
73
|
-
isLoading:
|
|
74
|
-
isError:
|
|
75
|
-
sorting:
|
|
76
|
-
onSortingChange:
|
|
77
|
-
pageSize:
|
|
78
|
-
onPageSizeChange:
|
|
79
|
-
hasNextPage: !!
|
|
80
|
-
hasPrevPage: !!
|
|
81
|
-
onNextPage:
|
|
82
|
-
onPrevPage:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
onStatusCardSelect: L.selectStatusCard,
|
|
90
|
-
invoicesFilterBar: F ? L.filterBar : void 0,
|
|
91
|
-
isFiltering: Z,
|
|
92
|
-
onRetry: re,
|
|
93
|
-
getReceivableById: K
|
|
66
|
+
rows: z,
|
|
67
|
+
isLoading: N.isLoading,
|
|
68
|
+
isError: N.isError,
|
|
69
|
+
sorting: v,
|
|
70
|
+
onSortingChange: B,
|
|
71
|
+
pageSize: b,
|
|
72
|
+
onPageSizeChange: V,
|
|
73
|
+
hasNextPage: !!N.data?.next_pagination_token,
|
|
74
|
+
hasPrevPage: !!N.data?.prev_pagination_token,
|
|
75
|
+
onNextPage: H,
|
|
76
|
+
onPrevPage: U,
|
|
77
|
+
statusCards: P,
|
|
78
|
+
onStatusCardSelect: k.selectStatusCard,
|
|
79
|
+
filterBar: k.filterBar,
|
|
80
|
+
isFiltering: k.isFiltering,
|
|
81
|
+
onRetry: W,
|
|
82
|
+
getReceivableById: L
|
|
94
83
|
};
|
|
95
84
|
}
|
|
96
|
-
var
|
|
85
|
+
var f = {
|
|
97
86
|
documentLabel: "document_id",
|
|
98
87
|
status: "status",
|
|
99
88
|
issueDateLabel: "issue_date",
|
|
100
89
|
dueDateLabel: "due_date",
|
|
101
90
|
totalLabel: "total_amount"
|
|
102
|
-
}
|
|
103
|
-
id: "dueDateLabel",
|
|
104
|
-
desc: !0
|
|
105
|
-
}], _ = [];
|
|
106
|
-
function v(e) {
|
|
107
|
-
return e === "invoices" ? g : _;
|
|
108
|
-
}
|
|
91
|
+
};
|
|
109
92
|
//#endregion
|
|
110
|
-
export {
|
|
93
|
+
export { d as useReceivablesTable };
|