{{ __('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')
| {{ __('Receipt') }} | {{ __('Date') }} | {{ __('Type') }} | {{ __('Direction') }} | {{ __('Amount') }} | {{ __('Contestant') }} | {{ __('By') }} |
@forelse ($transactions as $t)
| {{ $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'] }} |
@empty
| {{ __('No data.') }} |
@endforelse
@elseif ($tab === 'performance')
| {{ __('Show') }} | {{ __('Episodes') }} | {{ __('Status') }} |
@forelse ($performance as $row)
| {{ $row['title'] }} |
{{ $row['episodes'] }} |
{{ ucfirst($row['status']) }} |
@empty
| {{ __('No data.') }} |
@endforelse
@elseif ($tab === 'contestants')
| # | {{ __('Contestant') }} | {{ __('Participations') }} | {{ __('Points') }} | {{ __('Earnings') }} | {{ __('Outstanding') }} |
@forelse ($contestants as $c)
| {{ $c['contestant_number'] }} |
{{ $c['name'] }} |
{{ $c['participations'] }} |
{{ number_format($c['total_points']) }} |
{{ number_format($c['total_earnings'], 2) }} |
{{ number_format($c['outstanding'], 2) }} |
@empty
| {{ __('No data.') }} |
@endforelse
@elseif ($tab === 'prizes')
| {{ __('Title') }} | {{ __('Contestant') }} | {{ __('Amount') }} | {{ __('Paid') }} | {{ __('Outstanding') }} | {{ __('Status') }} |
@forelse ($prizes as $p)
| {{ $p['title'] }} |
{{ $p['contestant'] ?? '-' }} |
{{ $p['currency'] }} {{ number_format($p['amount'], 2) }} |
{{ number_format($p['paid'], 2) }} |
{{ number_format($p['outstanding'], 2) }} |
{{ ucfirst($p['status']) }} |
@empty
| {{ __('No data.') }} |
@endforelse
@else
| {{ __('Date') }} | {{ __('Contestant') }} | {{ __('Amount') }} | {{ __('Method') }} | {{ __('Status') }} | {{ __('Receipt') }} |
@forelse ($payments as $p)
| {{ 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'] ?? '-' }} |
@empty
| {{ __('No data.') }} |
@endforelse
@endif