@extends('admin.layouts.app') @section('content') @php $selectedClubIds = $selectedClubIds ?? []; $maxRevenueCard = max(1, collect($revenueCards ?? [])->max('value') ?: 1); $selectionLabel = $selectionLabel ?? 'Rede completa'; $dashboardClubPayload = $clubs->map(function ($club) { return [ 'id' => (int) $club->id, 'name' => $club->name, 'url' => route('admin.clubs.show', $club), 'is_selected' => (bool) $club->is_selected, 'lessons_revenue' => $club->lessons_revenue, 'reservations_revenue' => $club->reservations_revenue, 'bar_revenue' => $club->bar_revenue, 'store_revenue' => $club->store_revenue, 'total_revenue' => $club->total_revenue, 'lessons_revenue_raw' => (float) $club->lessons_revenue_raw, 'reservations_revenue_raw' => (float) $club->reservations_revenue_raw, 'bar_revenue_raw' => (float) $club->bar_revenue_raw, 'store_revenue_raw' => (float) $club->store_revenue_raw, 'total_revenue_raw' => (float) $club->total_revenue_raw, 'bookings_count' => (int) $club->bookings_count, 'orders_count' => (int) $club->orders_count, 'users_count' => (int) $club->users_count, ]; })->values(); @endphp
Backoffice financeiro

Dashboard

{{ $selectionLabel ?: 'Sem clubes selecionados' }} · {{ $range['label'] ?? 'Período atual' }}

Faturação agregada {{ $totals['revenue'] ?? 'EUR 0,00' }} {{ number_format((int)($totals['clubs'] ?? 0), 0, ',', ' ') }} clube{{ (int)($totals['clubs'] ?? 0) === 1 ? '' : 's' }} selecionado{{ (int)($totals['clubs'] ?? 0) === 1 ? '' : 's' }}
Filtro rápido

Clubes e período

Atualiza automaticamente
@foreach($clubs as $club) @php $clubId = (int) $club->id; $isSelected = in_array($clubId, $selectedClubIds, true); @endphp @endforeach
@foreach($revenueCards as $card) @php $width = max(6, min(100, (($card['value'] ?? 0) / $maxRevenueCard) * 100)); @endphp
{{ $card['label'] }}
{{ $card['formatted'] }}

{{ $card['description'] }}

@endforeach
Bookings {{ number_format((int)($totals['bookings'] ?? 0), 0, ',', ' ') }}
Encomendas {{ number_format((int)($totals['orders'] ?? 0), 0, ',', ' ') }}
Utilizadores novos {{ number_format((int)($totals['users'] ?? 0), 0, ',', ' ') }}
Clubes ativos na vista {{ number_format((int)($totals['clubs'] ?? 0), 0, ',', ' ') }}
Composição

Faturação por clube

@endsection @push('styles') @endpush @push('scripts') @endpush