@extends('layouts.app', ['title' => 'Kunden Umsätze']) @section('content')

Kunden Umsätze

@if(session('msg'))
{{ session('msg') }}
@endif {{-- Statistik --}} @php $totalBg = $customers->sum('projects_sum_budget_total_tax'); $totalSmall = $customers->sum(fn($c) => $c->orders_repair_sum_budget_total_tax + $c->orders_spare_sum_budget_total_tax); $totalAll = $totalBg + $totalSmall; $countActive = $customers->filter(fn($c) => $c->projects_sum_budget_total_tax > 0 || ($c->orders_repair_sum_budget_total_tax + $c->orders_spare_sum_budget_total_tax) > 0)->count(); @endphp
Gesamtumsatz

{{ number_format($totalAll, 2, ',', '.') }} €

Bauvorhaben

{{ number_format($totalBg, 2, ',', '.') }} €

Kleine Aufträge

{{ number_format($totalSmall, 2, ',', '.') }} €

{{-- Suche --}}
{{-- Tabelle --}}
@forelse($customers->filter(fn($c) => $c->projects_sum_budget_total_tax > 0 || ($c->orders_repair_sum_budget_total_tax + $c->orders_spare_sum_budget_total_tax) > 0) as $item) @empty @endforelse
Auftraggeber Bauvorhaben Kleine Aufträge
{{ $item->name }} @if($item->projects_sum_budget_total_tax > 0) {{ number_format($item->projects_sum_budget_total_tax, 2, ',', '.') }} € @else @endif @php $small = $item->orders_repair_sum_budget_total_tax + $item->orders_spare_sum_budget_total_tax; @endphp @if($small > 0) {{ number_format($small, 2, ',', '.') }} € @else @endif
Keine Daten vorhanden
Gesamt ({{ $countActive }} Kunden) {{ number_format($totalBg, 2, ',', '.') }} € {{ number_format($totalSmall, 2, ',', '.') }} €
@endsection