@extends('admin-layouts.vertical', ['title' => 'Fees Report']) {{-- @section('css') @vite(['node_modules/simple-datatables/dist/style.css']) @endsection --}} @section('content')

Fees Report

{{-- Success Message --}} @if (session('success')) @endif {{-- Error Messages --}} @if ($errors->any()) @endif {{-- Filter Form --}}
Report Filters
@csrf
Clear Filters
{{-- Report Results --}} @if($reports->count() > 0) {{-- Summary Statistics --}}
{{ $summary['total_records'] }}

Total Records

₹{{ number_format($summary['total_fees'], 2) }}

Total Fees

₹{{ number_format($summary['total_paid'], 2) }}

Total Paid

₹{{ number_format($summary['total_pending'], 2) }}

Total Pending

{{-- Report Table --}}
@foreach($reports as $report) @php $paidAmount = $report->subPayments->where('status', 'completed')->sum('amount'); $remainingAmount = $report->fees_amount - $paidAmount; @endphp @endforeach
S.No Student Name Academic Year Term Class Section Fees Amount Paid Amount Remaining Status Due Date
{{ $loop->iteration }} {{ $report->student->student_name ?? 'N/A' }} {{ \Carbon\Carbon::parse($report->academicYear->from_date)->format('Y') }} - {{ \Carbon\Carbon::parse($report->academicYear->to_date)->format('Y') }} {{ $report->term->term_name ?? '-' }} {{ $report->classRoom->class_name ?? '-' }} {{ $report->section->sec_name ?? '-' }} ₹{{ number_format($report->fees_amount, 2) }} ₹{{ number_format($paidAmount, 2) }} ₹{{ number_format($remainingAmount, 2) }} @switch($report->status) @case('paid') Paid @break @case('partially_paid') Partially Paid @break @case('overdue') Overdue @break @default Pending @endswitch {{ $report->due_date ? $report->due_date->format('d-m-Y') : '-' }}
{{-- Export Options --}}
@elseif($request->isMethod('post') || $request->has('generate_report'))
No Records Found

No fees records match your selected criteria. Please adjust your filters and try again.

@endif
@endsection @section('scripts') @endsection