@extends('layouts.app') @section('title', 'Commission Programs') @section('content')

Commission Programs

Manage how agents earn commissions on their sales

@foreach($programs as $program)

{{ $program->name }}

@if($program->is_default) Default @endif
{{ $program->agents_count }}

{{ $program->description }}

View Agents → @if(!$program->is_default && $program->is_active)
@csrf @method('PATCH')
@endif
@if($program->type === 'progressive')
Cycle resets monthly
@csrf
@endif
@endforeach

Commission Rate Tiers

Used by Performance & Progressive programs

@foreach($performanceTiers as $tier)
{{ $tier->commission_rate }}%
{{ $tier->name }}
@if($tier->min_sales_amount > 0) ≥ RM {{ number_format($tier->min_sales_amount) }} @else Starting tier @endif
@endforeach

@if($selectedProgram) {{ $programs->firstWhere('id', $selectedProgram)?->name ?? 'All' }} Agents @else All Agents @endif

@if($selectedProgram) @endif
@if($agents->count() > 0)
@foreach($agents as $agent) @endforeach
Agent Program Current Rate Details Actions
@if($agent->profile_photo_url) @else
{{ $agent->initials }}
@endif
{{ $agent->name }}
{{ $agent->coupon_code }}
@if($agent->commissionProgram) {{ $agent->commissionProgram->name }} @else Not assigned @endif {{ number_format($agent->getPersonalCommissionRate(), 2) }}% @if($agent->isLegacyProgram())
Fixed Rate: {{ $agent->legacy_commission_rate }}%
@if($agent->legacy_program_note)
{{ $agent->legacy_program_note }}
@endif @elseif($agent->isProgressiveProgram())
Cycle Sales: RM {{ number_format($agent->current_cycle_sales ?? 0, 2) }}
@if($agent->getSalesToNextProgressiveTier()) RM {{ number_format($agent->getSalesToNextProgressiveTier(), 2) }} to next tier @else Max tier reached @endif
@else
Tier: {{ $agent->performanceTier?->name ?? 'Basic' }}
Based on last month sales
@endif
Change Program
{{ $agents->links() }}
@else

No agents found

@if($selectedProgram) No agents are assigned to this program yet. @else No agents match your search criteria. @endif

@endif
@endsection