@forelse($invoices as $invoice) @php $demandeNames = $invoice->items ->map(fn ($item) => $item->brief?->project?->name) ->filter() ->unique() ->values(); @endphp @empty @endforelse
Numero Demande client Client Date Montant total Actions
{{ $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, ',', ' ') }}
@if (($search ?? '') !== '') Aucune facture ne correspond a « {{ $search }} ». @else Aucune facture pour le moment. @endif
{{ $invoices->links() }}