@extends('layouts.app') @section('title', 'Collect Fees') @section('content')

Collect Fees

Search a student, allocate the payment across outstanding fees and issue a receipt

@if ($student)

M-Pesa STK Push

Send a simulated STK prompt to the payer's phone. The credit lands in Incoming Payments and is reconciled (receipt issued) there.

@if ($student)
@csrf
@else

Search and select a student above to send an STK push.

@endif

{{ $student->full_name }}

{{ $student->admission_no }} · {{ $student->class_name }} {{ $student->stream }} · {{ $student->category }}

@if ($invoice)

Balance due: KES {{ number_format($invoice->total_balance, 2) }}

@endif
@if ($invoice && $invoice->total_balance > 0) @php $openItems = $items->where('balance', '>', 0)->values(); @endphp
@csrf @foreach ($openItems as $i => $it) @endforeach
Votehead Balance Amount to apply
{{ $it->votehead_name }} {{ number_format($it->balance, 2) }}
@else

No outstanding balance for this student.

@endif
@elseif ($q !== '')

No student found matching "{{ $q }}".

@endif

Recent Receipts

@foreach ($recentReceipts as $r) @endforeach
Receipt No. Student Date Mode Amount
{{ $r->receipt_no }} {{ $r->student_name }} {{ $r->date }} {{ $r->mode }} KES {{ number_format($r->amount, 2) }}
@endsection @push('scripts') @endpush