@extends('layouts.student') @section('title', 'Fee Statement') @section('content')

Student Fee Statement

{{-- =================== Student Info =================== --}}
Student Details

Registration Number: {{ $student->registration_number }}

Name: {{ $student->first_name }} {{ $student->last_name }}

Programme: {{ $programme->description }}

Mode: {{ $programme->attendance_mode }}

Duration: {{ $programme->duration }}

Status: {{ $programme->status }}

{{-- =================== Transactions Table =================== --}}
Transaction History
@php $runningBalance = 0; @endphp @foreach ($transactions as $tx) @php $debit = $tx->debit ?? 0; $credit = $tx->credit ?? 0; $runningBalance += ($debit - $credit); @endphp @endforeach
Date Description Debit ($) Credit ($) Running Balance ($)
{{ \Carbon\Carbon::parse($tx->date)->format('d M Y') }} {{ $tx->description }} {{ $debit > 0 ? number_format($debit, 2) : '' }} {{ $credit > 0 ? number_format($credit, 2) : '' }} {{ number_format($runningBalance, 2) }}
{{-- =================== Final Balance =================== --}}
@php $balanceClass = $runningBalance > 0 ? 'text-danger' : 'text-success'; @endphp
Total Balance: ${{ number_format($runningBalance, 2) }}
{{-- =================== PDF Download Button =================== --}}
@endsection