@extends('layouts.admin') @section('page-title', 'Referral Commissions') @section('content')

Referral Commissions

Track referral commissions from employees and promoters

Total Commissions

{{ $stats['total'] }}

Total Paid

${{ number_format($stats['total_commission'], 2) }}

Pending

{{ $stats['pending'] }}

Credited

{{ $stats['credited'] }}

All Referrals

@forelse($commissions as $commission) @empty @endforelse
Referrer Type Order Customer Order Total Commission (5%) Status Date
@if($commission->referrable instanceof \App\Models\Employee) {{ strtoupper(substr($commission->referrable->first_name, 0, 1).substr($commission->referrable->last_name, 0, 1)) }} @else {{ strtoupper(substr($commission->referrable->name, 0, 2)) }} @endif
@if($commission->referrable instanceof \App\Models\Employee) {{ $commission->referrable->first_name }} {{ $commission->referrable->last_name }} @else {{ $commission->referrable->name }} @endif
@if($commission->referrable instanceof \App\Models\Employee) Employee @else Promoter @endif {{ $commission->order->order_number ?? 'N/A' }} {{ $commission->customer->name ?? 'N/A' }} ${{ number_format($commission->order_total, 2) }} ${{ number_format($commission->commission_amount, 2) }} {{ ucfirst($commission->status) }} {{ $commission->created_at->format('M d, Y') }}

No referral commissions yet

@if(isset($commissions) && $commissions->hasPages())
{{ $commissions->links() }}
@endif
@endsection