@extends('layouts.app') @section('title', 'Create Payout') @section('content')

Create Payout

Select agents to create payouts for their approved commissions

Back

Payout Settings

@csrf
RM

Agents must have at least this amount in approved commissions to be eligible for payout.

@if($eligibleAgents->count() > 0)
@csrf

Eligible Agents

{{ $eligibleAgents->count() }} agent(s) with RM {{ number_format($minimumPayout, 2) }}+ in approved commissions

@foreach($eligibleAgents as $agent) @endforeach
Agent Commissions Amount Bank Details
{{ $agent->name }}
{{ $agent->coupon_code }}
{{ $agent->performanceTier->name ?? 'Basic' }}
{{ $agent->commission_count }} RM {{ number_format($agent->available_amount, 2) }} @if($agent->bank_name)
{{ $agent->bank_name }}
{{ $agent->bank_account_number }}
{{ $agent->bank_account_name }}
@else Not provided @endif
Total (All Eligible): RM {{ number_format($eligibleAgents->sum('available_amount'), 2) }}
@else

No eligible agents

No agents have approved commissions meeting the minimum payout of RM {{ number_format($minimumPayout, 2) }}.

@endif @if(isset($belowMinimumAgents) && $belowMinimumAgents->count() > 0)

Below Minimum Threshold

{{ $belowMinimumAgents->count() }} agent(s) have commissions below RM {{ number_format($minimumPayout, 2) }}

@foreach($belowMinimumAgents as $agent) @endforeach
Agent Commissions Amount Needs
{{ $agent->name }}
{{ $agent->coupon_code }}
{{ $agent->commission_count }} RM {{ number_format($agent->available_amount, 2) }} RM {{ number_format($minimumPayout - $agent->available_amount, 2) }} more
@endif
@endsection