@foreach($end_users as $end_user)
{{ $client_label }}: {{ $end_user->name }}
@csrf {{-- --}} @php $totals = []; @endphp @foreach($end_user->invoiceProjects as $project) @php if(!empty($project->complaint)){ $totals[] = !empty($project->complaint->total) ? $project->complaint->total : 0; } @endphp {{-- --}} @endforeach {{-- @empty @endforelse --}}
{{ __('Project') }} {{ __('City') }} {{ __('Deadline') }}{{ __('Subtotal') }} (€){{ __('Material') }} (€) {{ __('Total excl. VAT') }} (€) {{ __('Status') }}
{{ $project->title }} {{ optional($end_user)->city }} {{ $project->deadline }}{{ !empty($project->complaint) ? $project->complaint->subtotal : '' }}{{ !empty($project->complaint) ? $project->complaint->price_material : '' }} {{ !empty($project->complaint) ? $project->complaint->total : '' }} {{ __('To invoice') }}
        {{ projectGrandTotal($totals) }}  
{{ __('No result found') }}
@endforeach
{{ $end_users->links() }}