@extends('layouts.master') @section('page_title', 'Fee Collection Report') @section('content')
Fee Collection Report Filters

Fee Collection Report

Period: {{ Carbon\Carbon::parse($startDate)->format('M d, Y') }} - {{ Carbon\Carbon::parse($endDate)->format('M d, Y') }}

Generated: {{ Carbon\Carbon::now()->format('M d, Y g:i A') }}

Total Students: {{ $feeCollections->count() }}

${{ number_format($feeCollections->sum('total_paid'), 2) }}

Total Collected

{{ $feeCollections->count() }}

Students Paid

${{ $feeCollections->count() > 0 ? number_format($feeCollections->avg('total_paid'), 2) : '0.00' }}

Average Payment

{{ $feeCollections->sum('payment_count') }}

Total Transactions

@if($classSummary->count() > 0)
Summary by Class
@foreach($classSummary as $summary) @endforeach
Class Students Total Collected Average per Student
{{ $summary->class_name }} {{ $summary->student_count }} ${{ number_format($summary->total_collected, 2) }} ${{ number_format($summary->avg_payment, 2) }}
Total {{ $classSummary->sum('student_count') }} ${{ number_format($classSummary->sum('total_collected'), 2) }} ${{ $classSummary->count() > 0 ? number_format($classSummary->avg('avg_payment'), 2) : '0.00' }}
@endif
Detailed Fee Collections
@if($feeCollections->count() > 0)
@foreach($feeCollections as $collection) @endforeach
Student ID Student Name Class Section Amount Paid Payments First Payment Last Payment
{{ $collection->student_id }} {{ $collection->student_name }} {{ $collection->class_name }} {{ $collection->section_name ?? 'N/A' }} ${{ number_format($collection->total_paid, 2) }} {{ $collection->payment_count }} {{ Carbon\Carbon::parse($collection->first_payment)->format('M d, Y') }} {{ Carbon\Carbon::parse($collection->last_payment)->format('M d, Y') }}
Grand Total ${{ number_format($feeCollections->sum('total_paid'), 2) }} {{ $feeCollections->sum('payment_count') }}
@else
No Data Found
No fee collections found for the selected criteria and date range.
@endif
@endsection