@extends('layouts.dashboard')
@section('title', __('messages.reports'))
@section('header', __('messages.reports'))
@section('sidebar')
{{ __('messages.dashboard') }}
{{ __('messages.payments') }}
{{ __('messages.reports') }}
{{ __('messages.settings') }}
@endsection
@section('content')
{{ __('messages.total_revenue') }}
{{ number_format($totalRevenue ?? 0, 0) }} TZS
{{ __('messages.pending_payments') }}
{{ number_format($pendingPayments ?? 0, 0) }} TZS
{{ __('messages.overdue_payments') }}
{{ number_format($overduePayments ?? 0, 0) }} TZS
{{ __('messages.total_payments') }}
{{ $paymentCount ?? 0 }}
{{ __('messages.payments_by_type') }}
@if(($paymentsByType ?? collect())->count() > 0)
@foreach($paymentsByType as $item)
{{ ucfirst($item->type) }}
{{ number_format($item->total, 0) }} TZS
@endforeach
@else
{{ __('messages.no_data') }}
@endif
{{ __('messages.payments_by_method') }}
@if(($paymentsByMethod ?? collect())->count() > 0)
@foreach($paymentsByMethod as $item)
{{ ucfirst(str_replace('_', ' ', $item->payment_method)) }}
{{ number_format($item->total, 0) }} TZS
@endforeach
@else
{{ __('messages.no_data') }}
@endif
@if(isset($monthlyRevenue) && count($monthlyRevenue) > 0)
{{ __('messages.monthly_revenue_trend') }}
@foreach($monthlyRevenue as $month)
{{ $month['month'] }}
{{ number_format($month['revenue'], 0) }} TZS
@php
$maxRevenue = collect($monthlyRevenue)->max('revenue');
$percentage = $maxRevenue > 0 ? ($month['revenue'] / $maxRevenue) * 100 : 0;
@endphp
@endforeach
@endif
@if(isset($topTenants) && $topTenants->count() > 0)
{{ __('messages.top_tenants_by_payment') }}
| {{ __('messages.tenant') }} |
{{ __('messages.total_paid') }} |
@foreach($topTenants as $item)
|
{{ $item->tenant->full_name ?? 'N/A' }}
|
{{ number_format($item->total, 0) }} TZS
|
@endforeach
@endif
@if(isset($recentPayments) && $recentPayments->count() > 0)
{{ __('messages.recent_payments') }}
| {{ __('messages.payment_number') }} |
{{ __('messages.date') }} |
{{ __('messages.tenant') }} |
{{ __('messages.amount') }} |
{{ __('messages.status') }} |
@foreach($recentPayments as $payment)
| {{ $payment->payment_number }} |
{{ $payment->payment_date->format('M d, Y') }} |
{{ $payment->tenant->full_name ?? 'N/A' }} |
{{ number_format($payment->amount, 0) }} {{ $payment->currency }} |
{{ ucfirst($payment->status) }}
|
@endforeach
@endif
@endsection