@extends('layouts.admin') @section('title', 'Financial Report') @section('page-title', 'Financial Report') @section('page-subtitle', 'Detailed financial summary and trends') @section('content')

Generate Report

@if(isset($income) && isset($expenses))

Total Income

GH₵{{ number_format($income['total'], 2) }}

{{ $income['count'] }} transactions

Total Expenses

GH₵{{ number_format($expenses['total'], 2) }}

{{ $expenses['count'] }} transactions

Net Balance

GH₵{{ number_format(abs($net), 2) }}

{{ $income['count'] + $expenses['count'] }} total transactions

Income by Type

@if($income['by_type']->count() > 0)
@foreach($income['by_type'] as $typeId => $data) @php $type = \App\Models\DonationType::find($typeId); @endphp

{{ $type?->name ?? 'Unknown Type' }}

{{ $data['count'] }} donations

GH₵{{ number_format($data['total'], 2) }}

@endforeach
@else

No income recorded in this period

@endif

Expenses by Category

@if($expenses['by_category']->count() > 0)
@foreach($expenses['by_category'] as $catId => $data) @php $category = \App\Models\ExpenseCategory::find($catId); @endphp

{{ $category?->name ?? 'Unknown Category' }}

{{ $data['count'] }} expenses

GH₵{{ number_format($data['total'], 2) }}

@endforeach
@else

No expenses recorded in this period

@endif

Financial Summary

@foreach($income['by_type'] as $typeId => $data) @php $type = \App\Models\DonationType::find($typeId); @endphp @endforeach @foreach($expenses['by_category'] as $catId => $data) @php $category = \App\Models\ExpenseCategory::find($catId); @endphp @endforeach
Category Amount % of Total
Total Income GH₵{{ number_format($income['total'], 2) }} 100%
{{ $type?->name ?? 'Donations' }} GH₵{{ number_format($data['total'], 2) }} {{ $income['total'] > 0 ? round($data['total'] / $income['total'] * 100) : 0 }}%
Total Expenses GH₵{{ number_format($expenses['total'], 2) }} 100%
{{ $category?->name ?? 'Other Expenses' }} GH₵{{ number_format($data['total'], 2) }} {{ $expenses['total'] > 0 ? round($data['total'] / $expenses['total'] * 100) : 0 }}%
Net Balance GH₵{{ number_format($net, 2) }} -
@else

Select a date range above to generate a financial report

@endif
Back to Finance
@endsection