Hide invoices with status 'pending'

This commit is contained in:
ernstmul committed 2024-10-16 13:35:59 +02:00
1 parent 009618260b
commit a6c07f5cab
1 file changed
+16 -6
@@ -45,12 +45,22 @@
onMount(request);
async function request() {
invoiceList = await sdk.forConsole.billing.listInvoices($page.params.organization, [
Query.limit(limit),
Query.offset(offset),
Query.notEqual('from', $organization.billingCurrentInvoiceDate),
Query.orderDesc('$createdAt')
]);
const unfilteredInvoiceList = await sdk.forConsole.billing.listInvoices(
$page.params.organization,
[
Query.limit(limit),
Query.offset(offset),
Query.notEqual('from', $organization.billingCurrentInvoiceDate),
Query.orderDesc('$createdAt')
]
);
const filteredInvoices = unfilteredInvoiceList.invoices.filter(
(invoice) => invoice.status !== 'pending'
);
invoiceList = {
invoices: filteredInvoices,
total: filteredInvoices.length
};
}
function retryPayment(invoice: Invoice) {