@extends('layouts.app') @section('title', $agent->name) @section('content')

{{ $agent->name }}

{{ $agent->company_name ?? 'Independent Agent' }}
Ledger @can('update', $agent) Edit @endcan @can('delete', $agent)
@csrf @method('DELETE')
@endcan
{{-- Contact Info --}}
Contact Info
Mobile {{ $agent->mobile }}
Email {{ $agent->email ?? '—' }}
Address {{ $agent->address ?? '—' }}
Company {{ $agent->company_name ?? '—' }}
Def. Rate {{ number_format($agent->commission_rate, 2) }}%
Status {{ $agent->is_active ? 'Active' : 'Inactive' }}
{{-- Financial Summary --}}
Commission Summary

{{ number_format($summary['total_generated'], 2) }}

Total Generated

{{ number_format($summary['total_paid'], 2) }}

Total Paid

{{ number_format($summary['total_due'], 2) }}

Outstanding Due

Deals: {{ $summary['total_deals'] }} | Fixed: {{ number_format($summary['by_type']['fixed'], 2) }} | Percentage: {{ number_format($summary['by_type']['percentage'], 2) }} | Per Flat: {{ number_format($summary['by_type']['per_flat'], 2) }}
{{-- Deal Links --}}
Deal Links
@forelse ($agent->dealLinks as $dl) @empty @endforelse
Sale # Customer Project Type Rate Commission Paid Due Actions
{{ $dl->sale?->agreement_number ?? 'N/A' }} {{ $dl->sale?->customer?->name ?? '—' }} {{ $dl->sale?->project?->project_name ?? '—' }} {{ ucfirst($dl->commission_type) }} {{ number_format($dl->commission_rate, 2) }} {{ number_format($dl->commission_amount, 2) }} {{ number_format($dl->paid_amount, 2) }} {{ number_format($dl->due_amount, 2) }}
No deal links yet.
{{-- Recent Payments --}}
Recent Commission Payments
@forelse ($agent->commissionPayments->take(10) as $p) @empty @endforelse
Date Sale # Method Reference Amount Reversal By
{{ $p->payment_date->format('d M Y') }} {{ $p->dealLink?->sale?->agreement_number ?? '—' }} {{ $p->paymentMethod?->method_name ?? '—' }} {{ $p->reference_number ?? '—' }} {{ number_format($p->amount, 2) }} @if ($p->is_reversal) Reversal @else — @endif {{ $p->createdBy?->name ?? '—' }}
No payments recorded yet.
@endsection