Daily Commissions
{{-- Header --}}

Daily Commissions

{{ \Carbon\Carbon::parse($date)->format('l, d M Y') }}
@if(session('success'))
{{ session('success') }}
@endif {{-- Date filter --}} {{-- KPI cards --}}
Total Earned
KSh {{ number_format($summary['total_earned'], 2) }}
Total Paid
KSh {{ number_format($summary['total_paid'], 2) }}
Balance Owed
KSh {{ number_format($summary['balance'], 2) }}
Staff Active
{{ $employees->count() }}
{{-- Main table --}}
Staff Commission Summary
@forelse($employees as $emp) @php $earned = $commissions[$emp->id] ?? 0; $paid = $emp->employeePayments->sum('amount'); $balance = round($earned - $paid, 2); $empBreakdown = $breakdown[$emp->id] ?? []; @endphp @empty @endforelse @if($employees->isNotEmpty()) @php $tE = array_sum($commissions); $tP = $employees->sum(fn($e) => $e->employeePayments->sum('amount')); $tB = round($tE - $tP, 2); @endphp @endif
Employee Earned Paid Balance Action
{{ strtoupper(substr($emp->name, 0, 1)) }}
{{ $emp->name }}
{{ $emp->display_role }}
@if(count($empBreakdown))
@foreach($empBreakdown as $line)
{{ $line['sale_date'] }} · {{ $line['service_name'] }} · KSh {{ number_format($line['amount'], 2) }}
@endforeach
@endif
KSh {{ number_format($earned, 2) }} KSh {{ number_format($paid, 2) }} @if($balance > 0) KSh {{ number_format($balance, 2) }} @elseif($balance < 0) KSh {{ number_format($balance, 2) }} @else Settled @endif
No commission data for this date.
Totals KSh {{ number_format($tE, 2) }} KSh {{ number_format($tP, 2) }} KSh {{ number_format($tB, 2) }}
@push('modals') {{-- Work Log Modal --}}

Work Log

{{ \Carbon\Carbon::parse($date)->format('d M Y') }}

Date & Time Service Client Vehicle Sale Commission
Total Commission
{{-- Pay Modal --}}

Commission Payment

Date & Time Service Client Vehicle Sale Commission
Total Earned
@csrf
@endpush @push('scripts') @endpush