Employees
Employees
{{ $employees->total() }} staff members
Add Employee
{{-- KPI strip --}} @php $totalEarned = array_sum($commissions); $totalPaid = $employees->getCollection()->sum(fn($e) => $e->employeePayments->sum('amount')); $totalOwed = round($totalEarned - $totalPaid, 2); $activeCount = $employees->getCollection()->where('status', 'active')->count(); @endphp
Total Staff
{{ $employees->total() }}
{{ $activeCount }} active
Services Done
{{ number_format(array_sum($washCounts)) }}
All time
Commission Earned
KSh {{ number_format($totalEarned, 0) }}
Accrued total
Balance Owed
KSh {{ number_format($totalOwed, 0) }}
Unpaid commissions
{{-- Filter --}}
Clear
{{-- Table --}}
@if($employees->isEmpty())

👥

No employees found

Try adjusting your filters or add a new employee.

@else
@foreach($employees as $emp) @php $role = $emp->roles->first()?->name ?? 'No Role'; $washes = $washCounts[$emp->id] ?? 0; $earned = $commissions[$emp->id] ?? 0; $paid = $emp->employeePayments->sum('amount'); $owed = round($earned - $paid, 2); @endphp @endforeach
Employee Role Status Services Comm. Earned Comm. Paid Balance Actions
{{ strtoupper(substr($emp->name, 0, 1)) }}
{{ $emp->name }}
{{ $emp->email }}
@if($emp->telephone)
{{ $emp->telephone }}
@endif
{{ $role }} {{ ucfirst($emp->status) }} {{ number_format($washes) }} KSh {{ number_format($earned, 2) }} KSh {{ number_format($paid, 2) }} @if($owed > 0) KSh {{ number_format($owed, 2) }} @else ✓ Settled @endif
Commissions Edit @if($emp->id !== auth()->id())
@csrf @method('DELETE')
@endif
@if($employees->hasPages())
{{ $employees->appends(request()->query())->links() }}
@endif @endif