{{ $employee->name }} — Commissions
{{-- Header --}}
{{ strtoupper(substr($employee->name, 0, 1)) }}
{{ $employee->name }}
{{ $employee->roles->first()?->name ?? 'Staff' }} · {{ $employee->email }}
Edit ← Employees
{{-- KPI strip --}}
Total Earned
KSh {{ number_format($totalEarned, 2) }}
Accrued commissions
Total Paid
KSh {{ number_format($totalPaid, 2) }}
Payments made
Balance Owed
KSh {{ number_format(abs($balanceOwed), 2) }}
{{ $balanceOwed > 0 ? 'Outstanding' : 'Fully settled' }}
Commission Days
{{ $commissions->count() }}
Days with earnings
{{-- Commission history --}}
Commission History by day
@if($commissions->isEmpty())
No commission records yet.
@else
@foreach($commissions as $row) @endforeach
Date Amount
{{ \Carbon\Carbon::parse($row->date)->format('d M Y') }} KSh {{ number_format($row->total, 2) }}
Total KSh {{ number_format($totalEarned, 2) }}
@endif
{{-- Right column: payment form + payment history --}}
{{-- Record payment form --}} @if($balanceOwed > 0)
Record Payment
@csrf
@error('amount')

{{ $message }}

@enderror
@error('payment_date')

{{ $message }}

@enderror
@endif {{-- Payment history --}}
Payment History {{ $payments->count() }} records
@if($payments->isEmpty())
No payments recorded yet.
@else
@foreach($payments as $pmt) @endforeach
Date Method Amount
{{ $pmt->payment_date->format('d M Y') }} @php $method = strtolower($pmt->payment_method ?? 'cash'); @endphp {{ $pmt->payment_method ?? 'Cash' }} KSh {{ number_format($pmt->amount, 2) }}
Total Paid KSh {{ number_format($totalPaid, 2) }}
@endif