Earned Commission Report

Generated: {{ $filters['generated_at'] }} @if($filters['date_from'] || $filters['date_to'])  |  Period: {{ $filters['date_from'] ? \Carbon\Carbon::parse($filters['date_from'])->format('d M Y') : 'All' }} — {{ $filters['date_to'] ? \Carbon\Carbon::parse($filters['date_to'])->format('d M Y') : 'All' }} @endif @if($filters['revenue_type'])  |  Type: {{ ucfirst(str_replace('_', ' ', $filters['revenue_type'])) }} @endif
{{-- Summary Cards --}}
Total Records
{{ $totals['count'] }}
Total Revenue
BHD {{ number_format($totals['amount'], 2) }}
Total Commission Earned
BHD {{ number_format($totals['commission'], 2) }}
{{-- Detail Table --}} @forelse($rows as $i => $t) @php $commission = $t->type === 'commission' ? $t->amount : $t->amount * 0.10; $typeKey = str_replace(' ', '_', strtolower($t->type)); $badgeClass = in_array($typeKey, ['subscription','promotion','supplier_purchase','commission']) ? 'badge-' . str_replace('_purchase','',$typeKey) : 'badge-default'; @endphp @empty @endforelse @if($rows->count()) @endif
# Ref Number Business Category Revenue Type Total Amount Commission Date
{{ $i + 1 }} {{ $t->transaction_number ?? 'N/A' }} {{ optional($t->business)->business_name ?? 'Platform' }} {{ optional(optional($t->business)->category)->name ?? 'N/A' }} {{ ucfirst(str_replace('_', ' ', $t->type)) }} BHD {{ number_format($t->amount, 2) }} BHD {{ number_format($commission, 2) }} {{ $t->created_at->format('d M Y, H:i') }}
No records found for the selected filters.
Totals: BHD {{ number_format($totals['amount'], 2) }} BHD {{ number_format($totals['commission'], 2) }}