@extends('layouts.app') @section('content')
@include('layouts.left-menu')

Record Payment

@include('session-messages') @if(!$activeProfile)
No Active Payment Profile

This student doesn't have an active payment profile. Please create one first through the promotions system.

Back to Payments @else

Student Information

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

Class: {{ $activeProfile->promotion->schoolClass->class_name ?? 'N/A' }}

Section: {{ $activeProfile->promotion->section->section_name ?? 'N/A' }}

Payment Type: @if($activeProfile->payment_type == 0) Free Student @elseif($activeProfile->payment_type == 1) Monthly Payment @else Annual Payment @endif

Session: {{ $activeProfile->schoolSession->session_name ?? 'N/A' }}

Total Amount Owed

{{ number_format($activeProfile->total_amount_owed, 2) }} PKR

Already Paid

{{ number_format($activeProfile->total_amount_paid, 2) }} PKR

Remaining Balance

{{ number_format($activeProfile->balance_remaining, 2) }} PKR

@if($activeProfile->balance_remaining <= 0) Back to Payments @else

Record New Payment

@csrf
PKR @error('amount_paid')
{{ $message }}
@enderror
Maximum you can enter: {{ number_format($activeProfile->balance_remaining, 2) }} PKR
@if(!$activeProfile->admission_fee_paid)
@endif @if($activeProfile->payment_type == 1)
admission_fee_paid ? 'checked' : '' }} required>
@endif @if($activeProfile->payment_type == 2)
admission_fee_paid ? 'checked' : '' }} required>
@endif
@error('transaction_type')
{{ $message }}
@enderror
@error('payment_method')
{{ $message }}
@enderror
@error('transaction_date')
{{ $message }}
@enderror

Cancel
@endif @if($activeProfile->transactions && $activeProfile->transactions->count() > 0)
Recent Payments
@foreach($activeProfile->transactions->take(5) as $transaction) @endforeach
Receipt # Date Type Amount Method
{{ $transaction->transaction_number }} {{ $transaction->transaction_date->format('d M Y') }} @if($transaction->transaction_type == 1) Admission @elseif($transaction->transaction_type == 2) Monthly @else Annual @endif {{ number_format($transaction->amount_paid, 2) }} PKR @if($transaction->payment_method == 1) Cash @elseif($transaction->payment_method == 2) Cheque @elseif($transaction->payment_method == 3) Bank Transfer @else Online @endif
@endif @endif
@include('layouts.footer')
@endsection