{{ __('Tenants') }}

{{-- Month/Year Filter Bar --}}
{{ __('Filter Statistics') }}
@if($month === 'all') {{ __('Showing all-time collections and profit') }} @else {{ __('Showing statistics for') }} {{ \Carbon\Carbon::create($year, $month, 1)->format('F Y') }} @endif
{{-- ── Reseller Module KPI Summary ── --}}
{{-- Total Collections --}}
{{ __('Total Collections') }}

Ksh {{ number_format($resellers->sum('total_collected'), 2) }}

{{-- Total Reseller Profit --}}
{{ __('Tenant profit') }}

Ksh {{ number_format($resellers->sum('total_profit'), 2) }}

{{-- Total Paid Out (Cash) --}}
{{ __('Total Paid Out (Cash)') }}

Ksh {{ number_format($resellers->sum('total_payout'), 2) }}

{{-- Active Resellers --}}
{{ __('Active tenants') }}

{{ $resellers->where('status', 'active')->count() }}

{{-- Suspended Resellers --}}
{{ __('Suspended') }}

{{ $resellers->where('status', 'suspended')->count() }}

{{ __('All tenants') }}
{{ __('Create tenant') }}
@if(session('success')) @endif
@forelse($resellers as $reseller) @empty @endforelse
{{ __('Name') }} {{ __('Email / Phone') }} {{ __('Company') }} {{ __('Commission') }} @if($month === 'all') {{ __('Total Collection') }} @else {{ __('Collection') }} ({{ $months[$month] }}) @endif @if($month === 'all') {{ __('Total Profit') }} @else {{ __('Profit') }} ({{ $months[$month] }}) @endif {{ __('Wallet Balance') }} {{ __('Status') }} {{ __('Actions') }}
{{ $reseller->user->name ?? 'N/A' }}
ID: #{{ $reseller->id }}
{{ $reseller->user->email ?? 'N/A' }}
{{ $reseller->phone ?? 'N/A' }}
{{ $reseller->company ?? 'N/A' }} {{ $reseller->commission_percentage }}% Ksh {{ number_format($reseller->totalCollections(), 2) }} Ksh {{ number_format($reseller->totalProfit(), 2) }} Ksh {{ number_format($reseller->balance, 2) }} {{ __($reseller->status) }}
@csrf @method('DELETE')
{{ __('No tenants yet.') }}