{{ __('Reports & Analytics') }}

@can('reports.export')
@endcan
{{-- Financial summary --}}
@php $cards = [ ['label' => __('Income'), 'value' => $summary['income'], 'color' => 'text-emerald-300'], ['label' => __('Expenses'), 'value' => $summary['expenses'], 'color' => 'text-red-300'], ['label' => __('Net Income'), 'value' => $summary['net_income'], 'color' => 'text-gold-300'], ['label' => __('Prizes Committed'), 'value' => $summary['prizes_committed'], 'color' => 'text-amber-300'], ['label' => __('Payments Completed'), 'value' => $summary['payments_completed'], 'color' => 'text-sky-300'], ['label' => __('Outstanding'), 'value' => $summary['outstanding_balances'], 'color' => 'text-fuchsia-300'], ]; @endphp @foreach ($cards as $card)

{{ $card['label'] }}

{{ number_format($card['value'], 2) }}

@endforeach
{{-- Tabs --}}
@foreach (['financial' => __('Transaction History'), 'performance' => __('Show Performance'), 'contestants' => __('Top Contestants'), 'prizes' => __('Prize Commitments'), 'payments' => __('Payments')] as $key => $label) @endforeach
@if ($tab === 'financial') @forelse ($transactions as $t) @empty @endforelse
{{ __('Receipt') }}{{ __('Date') }}{{ __('Type') }}{{ __('Direction') }}{{ __('Amount') }}{{ __('Contestant') }}{{ __('By') }}
{{ $t['receipt_number'] }} {{ optional($t['date'])->format('M j, Y H:i') }} {{ $t['type_label'] }} {{ ucfirst($t['direction']) }} {{ $t['currency'] }} {{ number_format($t['amount'], 2) }} {{ $t['contestant'] ?? '-' }} {{ $t['created_by'] }}
{{ __('No data.') }}
@elseif ($tab === 'performance') @forelse ($performance as $row) @empty @endforelse
{{ __('Show') }}{{ __('Episodes') }}{{ __('Status') }}
{{ $row['title'] }} {{ $row['episodes'] }} {{ ucfirst($row['status']) }}
{{ __('No data.') }}
@elseif ($tab === 'contestants') @forelse ($contestants as $c) @empty @endforelse
#{{ __('Contestant') }}{{ __('Participations') }}{{ __('Points') }}{{ __('Earnings') }}{{ __('Outstanding') }}
{{ $c['contestant_number'] }} {{ $c['name'] }} {{ $c['participations'] }} {{ number_format($c['total_points']) }} {{ number_format($c['total_earnings'], 2) }} {{ number_format($c['outstanding'], 2) }}
{{ __('No data.') }}
@elseif ($tab === 'prizes') @forelse ($prizes as $p) @empty @endforelse
{{ __('Title') }}{{ __('Contestant') }}{{ __('Amount') }}{{ __('Paid') }}{{ __('Outstanding') }}{{ __('Status') }}
{{ $p['title'] }} {{ $p['contestant'] ?? '-' }} {{ $p['currency'] }} {{ number_format($p['amount'], 2) }} {{ number_format($p['paid'], 2) }} {{ number_format($p['outstanding'], 2) }} {{ ucfirst($p['status']) }}
{{ __('No data.') }}
@else @forelse ($payments as $p) @empty @endforelse
{{ __('Date') }}{{ __('Contestant') }}{{ __('Amount') }}{{ __('Method') }}{{ __('Status') }}{{ __('Receipt') }}
{{ optional($p['date'])->format('M j, Y') }} {{ $p['contestant'] }} {{ $p['currency'] }} {{ number_format($p['amount'], 2) }} {{ ucwords(str_replace('_', ' ', $p['method'])) }} {{ ucfirst($p['status']) }} {{ $p['receipt_number'] ?? '-' }}
{{ __('No data.') }}
@endif