@forelse($invoices as $invoice)
@php
$demandeNames = $invoice->items
->map(fn ($item) => $item->brief?->project?->name)
->filter()
->unique()
->values();
@endphp
| {{ $invoice->number }} |
@if($demandeNames->count() > 1)
{{ $demandeNames->implode(' · ') }}
@else
{{ $demandeNames->first() ?? $invoice->project?->name ?? '—' }}
@endif
|
{{ $invoice->project->client?->name ?? ($invoice->items->first()?->brief?->project?->client?->name ?? '—') }} |
{{ $invoice->generated_at?->format('d/m/Y H:i') }} |
{{ number_format((float) $invoice->total_amount, 2, ',', ' ') }} |
|
@empty
|
@if (($search ?? '') !== '')
Aucune facture ne correspond a « {{ $search }} ».
@else
Aucune facture pour le moment.
@endif
|
@endforelse