@extends('layouts.app') @section('title', 'Agent Details') @section('content')

{{ $agent->name }}

Agent Details & Performance

{{ strtoupper(substr($agent->name, 0, 2)) }}

{{ $agent->name }}

{{ $agent->status_display }}

{{ $agent->coupon_code }}

@if($agent->performanceTier)

{{ $agent->performanceTier->name }} ({{ $agent->performanceTier->commission_rate }}%)

@else

Basic (default)

@endif

{{ $agent->email }}

@if($agent->phone)

{{ $agent->phone }}

@endif
@if($agent->upline)

{{ $agent->upline->name }}

@else

None

@endif

{{ $agent->created_at->format('d M Y') }}

@if($agent->bank_name)

Banking Details

Bank: {{ $agent->bank_name }}

Account: {{ $agent->bank_account_number }}

Holder: {{ $agent->bank_account_name }}

@endif
Total Orders
{{ number_format($stats['total_orders']) }}
Total Sales
RM {{ number_format($stats['total_sales'], 2) }}
Team Size
{{ number_format($stats['team_size']) }}
Pending Commission
RM {{ number_format($stats['pending_commissions'], 2) }}
Approved Commission
RM {{ number_format($stats['approved_commissions'], 2) }}
Paid Commission
RM {{ number_format($stats['paid_commissions'], 2) }}
@if($downlines->total() > 0)

Team Members ({{ $downlines->total() }})

Show:
@foreach($downlines as $downline) @endforeach
Name Matrix ID Tier Status
{{ $downline->name }} {{ $downline->coupon_code }} {{ $downline->performanceTier->name ?? 'Basic' }} {{ $downline->status_display }}
@if($downlines->hasPages())
{{ $downlines->links() }}
@endif
@endif

Recent Orders

View All
@if($agent->orders->count() > 0)
@foreach($agent->orders as $order) @endforeach
Date Customer Total Status
{{ $order->order_date->format('d M Y') }} {{ $order->customer_name }} RM {{ number_format($order->total_amount, 2) }} {{ $order->status_display }}
@else
No orders yet
@endif

Recent Commissions

View All
@if($agent->commissions->count() > 0)
@foreach($agent->commissions as $commission) @endforeach
Date Order Amount Rate Commission Status
{{ $commission->created_at->format('d M Y') }} RM {{ number_format($commission->base_amount, 2) }} {{ $commission->commission_rate }}% RM {{ number_format($commission->commission_amount, 2) }} {{ $commission->status_display }}
@else
No commissions yet
@endif
@endsection