@extends('layouts.app') @section('title', 'Children Fees') @section('page-title', 'Children Fee Details') @section('content')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Summary --}}

Total Due

₹{{ number_format($invoices->whereIn('status', ['pending','overdue','partial'])->sum('balance'), 2) }}

Total Paid

₹{{ number_format($invoices->sum('paid_amount'), 2) }}

Total Invoices

{{ $invoices->count() }}

{{-- Invoices --}}

Children's Invoices

@forelse($invoices as $invoice) @empty @endforelse
Child Fee Type Total Balance Due Status Actions
{{ $invoice->student?->name }}

{{ $invoice->student?->studentProfile?->class_?->full_name }}

{{ $invoice->feeStructure->name }} ₹{{ number_format($invoice->total, 2) }} ₹{{ number_format($invoice->balance, 2) }} {{ $invoice->due_date->format('d M Y') }} @php $sc = ['paid'=>'bg-green-100 text-green-700','partial'=>'bg-blue-100 text-blue-700','pending'=>'bg-yellow-100 text-yellow-700','overdue'=>'bg-red-100 text-red-700']; @endphp {{ ucfirst($invoice->status) }}
@if($invoice->balance > 0) @endif @foreach($invoice->payments->where('status', 'success')->take(1) as $p) @endforeach
No invoices found.
{{-- Payment Modal --}}

Make Payment

@foreach($invoices->where('status', '!=', 'paid') as $invoice)
@csrf
Child:{{ $invoice->student?->name }}
Fee:{{ $invoice->feeStructure->name }}
Balance:₹{{ number_format($invoice->balance, 2) }}
Payment powered by Razorpay. Your transaction is secure and encrypted.
@endforeach
@endsection