{/* Page header (concept scene 15): title + invoice actions */}
{t('title')}
{t('rot_rut_payout_action')}
{/* Toolbar: one status chip-picker (founder direction: the status
views live behind a filter chip, not a seg), sök, FyPicker far
right. Counts ride as row annotations and on the trigger. */}
{isLoading ? (
{[1, 2, 3].map((i) => (
))}
) : filteredInvoices.length === 0 ? (
searchTerm ? (
}
title={t('no_search_results_title')}
description={t('no_search_results_description', { term: searchTerm })}
/>
) : invoices.length === 0 ? (
) : (
}
title={t('no_category_title')}
description={t('no_category_description')}
/>
)
) : (
{visibleInvoices.map((invoice) => {
const status = statusDescriptor(invoice)
const isCreditNote = !!invoice.credited_invoice_id
const docType = (invoice as Invoice & { document_type?: string }).document_type || 'invoice'
const displayedTotal = getDisplayTotal(
{ total: Number(invoice.total), currency: invoice.currency, ore_rounding: invoice.ore_rounding },
{ ore_rounding: oreRounding },
).displayed
const number = invoice.is_self_billed
? invoiceDisplayNumber(invoice)
: invoice.invoice_number
// Doc-type marker only where the view doesn't already imply it.
const typeMarker =
activeTab === 'all'
? docType === 'proforma'
? t('badge_proforma')
: docType === 'delivery_note'
? t('badge_delivery_note')
: invoice.is_self_billed
? t('badge_self_billed')
: null
: null
return (
router.push(`/invoices/${invoice.id}`)}
>
e.stopPropagation()}
>
{number ?? '·'}
{(invoice.customer as { name: string })?.name ?? '-'}
{invoice.due_date && !isCreditNote && invoice.status !== 'draft'
? formatDate(invoice.due_date)
: ''}
{formatCurrency(displayedTotal, invoice.currency)}
{typeMarker && (
{typeMarker}
)}
)
})}
)}
{!isLoading && visibleCount < sortedInvoices.length && (
setVisibleCount((count) => count + INITIAL_VISIBLE_ROWS)}
>
{tCommon('load_more')}
)}
{showNewInvoice && (
{
if (!open) closeNewInvoice()
}}
/>
)}
{showRotRutPayout && (
{
if (!open) closeRotRutPayout()
}}
/>
)}
)
}