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

Total Due

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

Total Paid

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

Invoices

{{ $invoices->count() }}

{{-- Invoices --}}

My Invoices

@forelse($invoices as $invoice) @empty @endforelse
Invoice # Fee Type Amount Paid Balance Due Date Status Actions
{{ $invoice->invoice_number }} {{ $invoice->feeStructure->name }} ₹{{ number_format($invoice->total, 2) }} ₹{{ number_format($invoice->paid_amount, 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') as $payment) Receipt @endforeach

No fee invoices found.

{{-- Payment Modal --}}

Make Payment

@foreach($invoices->where('status', '!=', 'paid') as $invoice)
@csrf
Fee Type: {{ $invoice->feeStructure->name }}
Total: ₹{{ number_format($invoice->total, 2) }}
Already Paid: ₹{{ number_format($invoice->paid_amount, 2) }}
Balance Due: ₹{{ number_format($invoice->balance, 2) }}
This is a simulated payment for demo purposes. In production, this will connect to Razorpay/Stripe.
@endforeach
@endsection