@extends('layouts.portal') @section('title', 'Pending Commission Payments') @section('page_title', 'Pending Commission Payments') @section('page_subtitle', 'Process Agent Commissions & Payments') @section('sidebar') @include('admin.partials.sidebar', ['active' => 'commission-reports']) @endsection @push('styles') @endpush @section('content')
@php $totalPaid = $statusBreakdown->where('status', 'paid')->first()->total ?? 0; $totalPending = $statusBreakdown->where('status', 'pending')->first()->total ?? 0; $totalCancelled = $statusBreakdown->where('status', 'cancelled')->first()->total ?? 0; $countPaid = $statusBreakdown->where('status', 'paid')->first()->count ?? 0; $countPending = $statusBreakdown->where('status', 'pending')->first()->count ?? 0; $countCancelled = $statusBreakdown->where('status', 'cancelled')->first()->count ?? 0; @endphp

Paid Commissions

RM{{ number_format($totalPaid, 2) }}

{{ $countPaid }} transactions

Pending Commissions

RM{{ number_format($totalPending, 2) }}

{{ $countPending }} transactions

Cancelled

RM{{ number_format($totalCancelled, 2) }}

{{ $countCancelled }} transactions

Filter Commissions

Reset All
Clear

Monthly Commission Trend

Commission by Level

Top 10 Performing Agents

@forelse($topAgents ?? [] as $index => $agent) @empty @endforelse
Rank Agent Total Earned Transactions
@if($index < 3) @else {{ $index + 1 }} @endif {{ $agent->name }} RM{{ number_format($agent->total_earned ?? 0, 2) }} {{ $agent->commissions_count ?? 0 }}
No data available

Recent Commissions

@forelse($recentCommissions as $commission) @empty @endforelse
Date Agent Level Amount Status
{{ $commission->created_at->format('M d, Y') }} {{ $commission->user->name ?? 'N/A' }} L{{ $commission->level }} RM{{ number_format($commission->amount, 2) }} {{ ucfirst($commission->status) }}
No recent commissions found

All Commissions

View Withdrawals
@if($allCommissions->count() > 0)
@foreach($allCommissions as $commission) @endforeach
ID Will ID Client Name Agent Level Amount Status Date Action
@if($commission->status === 'pending') @endif #{{ $commission->id }} @if($commission->will_id) #{{ $commission->will_id }} @else N/A @endif @if($commission->client)

{{ $commission->client->first_name ?? '' }} {{ $commission->client->last_name ?? '' }}

{{ $commission->client->email ?? '' }}
@else N/A @endif
{{ $commission->user->name ?? 'N/A' }} L{{ $commission->level }} RM{{ number_format($commission->amount, 2) }} {{ ucfirst($commission->status) }} {{ $commission->created_at->format('M d, Y') }} @if($commission->status === 'pending')
@csrf
@endif
{{ $allCommissions->links() }}
@else

No commissions found

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