@extends('distributor.layouts.app') @section('title', 'My Commissions') @section('content')

Total Earnings

৳{{ number_format($totalEarnings, 2) }}

This Month

৳{{ number_format($monthlyEarnings, 2) }}

Total Transactions

{{ $commissions->total() }}

Average per Transaction

৳{{ $commissions->total() > 0 ? number_format($totalEarnings / $commissions->total(), 2) : '0.00' }}

PV Bonus

৳{{ number_format($summary['pv_bonus'] ?? 0, 2) }}

Earnings by Type

@php $types = [ 'pv_bonus' => ['label' => 'PV Bonus', 'color' => 'bg-red-500'], 'sponsor_bonus' => ['label' => 'Sponsor Bonus', 'color' => 'bg-orange-500'], 'matching_bonus' => ['label' => 'Matching Bonus', 'color' => 'bg-green-500'], 'generation_bonus' => ['label' => 'Generation Bonus', 'color' => 'bg-purple-500'], 'rank_bonus' => ['label' => 'Rank Bonus', 'color' => 'bg-yellow-500'], ]; $total = $totalEarnings ?: 1; @endphp @foreach($types as $key => $info) @php $amount = $summary[$key] ?? 0; @endphp
{{ $info['label'] }} ৳{{ number_format($amount, 2) }}
@endforeach

Earnings Breakdown

Recent Commissions

@if($commissions->count() == 0)

No commissions earned yet

Start sponsoring and building your team to earn bonuses!

@else
@foreach($commissions as $commission) @endforeach
Date Type From Amount Description
{{ $commission->created_at->format('d M, Y') }}
{{ $commission->created_at->diffForHumans() }}
{{ $commission->getTypeText() }} @if($commission->fromUser) {{ $commission->fromUser->name }} ({{ $commission->fromUser->user_code ?? 'N/A' }}) @else System @endif +৳{{ number_format($commission->amount, 2) }} @if($commission->commission_type == 'pv_bonus') Product PV Earnings from Order @else {{ $commission->description ?? 'Commission earned' }} @endif @if($commission->order_id)
Order #{{ $commission->order?->order_number ?? $commission->order_id }} @endif @if($commission->pv_matched)
PV: {{ number_format($commission->pv_matched, 2) }} @endif @if($commission->generation_level > 0)
Level: {{ $commission->generation_level }} @endif
{{ $commissions->links('vendor.pagination.tailwind') }}
@endif
@endsection @push('scripts') @endpush