@extends('layouts.student') @section('title','Receipt') @section('breadcrumb') @endsection @section('student-content') @php function studentReceiptWords($n) { $n = (int) round($n); $ones = ['','One','Two','Three','Four','Five','Six','Seven','Eight','Nine','Ten','Eleven', 'Twelve','Thirteen','Fourteen','Fifteen','Sixteen','Seventeen','Eighteen','Nineteen']; $tens = ['','','Twenty','Thirty','Forty','Fifty','Sixty','Seventy','Eighty','Ninety']; if ($n === 0) return 'Zero'; $w = ''; if ($n >= 10000000) { $w .= studentReceiptWords((int)($n/10000000)).' Crore '; $n %= 10000000; } if ($n >= 100000) { $w .= studentReceiptWords((int)($n/100000)).' Lakh '; $n %= 100000; } if ($n >= 1000) { $w .= studentReceiptWords((int)($n/1000)).' Thousand '; $n %= 1000; } if ($n >= 100) { $w .= $ones[(int)($n/100)].' Hundred '; $n %= 100; } if ($n >= 20) { $w .= $tens[(int)($n/10)]; $n %= 10; if($n) $w .= '-'.$ones[$n]; $w .= ' '; } elseif ($n > 0) { $w .= $ones[$n].' '; } return trim($w); } $student = optional($payment->student); $institute = optional($student->institute ?? null); $course = optional($student->course ?? null); $session = optional($payment->academicSession ?? null); $amtWords = studentReceiptWords($payment->amount_paid).' Only'; // Address string $addrParts = array_filter([ $institute->address ?? null, $institute->city ?? null, $institute->state ?? null, ]); $instAddress = implode(', ', $addrParts); if (!empty($institute->pincode)) { $instAddress .= ' – ' . $institute->pincode; } // Meta line $metaParts = array_filter([ ($institute->phone ?? null) ? 'TEL: ' . $institute->phone : null, ($institute->email ?? null) ? $institute->email : null, ($institute->website ?? null) ? $institute->website : null, ]); $instMeta = implode(' | ', $metaParts); $logoInit = strtoupper(substr($institute->name ?? 'E', 0, 1)); $onlineModes = ['online', 'upi', 'neft', 'rtgs']; $txnLabel = in_array(strtolower($payment->payment_mode), $onlineModes) ? 'Txn ID' : 'Cheque/DD'; $cashierName = optional($payment->cashier)->name ?? 'System'; @endphp
{{-- Copy Label --}}
Student Copy
{{-- Header --}}
@if($institute && $institute->logo) Logo @else
{{ $logoInit }}
@endif
{{ $institute->name ?? config('app.name') }}
@if($instAddress)
{{ $instAddress }}
@endif @if($instMeta)
{{ $instMeta }}
@endif
@if($institute && $institute->logo) Logo @else
{{ $logoInit }}
@endif
{{-- Title Strip --}}
No. {{ $payment->receipt_no }}
Fee Receipt
Date: {{ $payment->payment_date->format('d M Y') }}
{{-- Body --}}
{{-- Student Info Grid --}}
Student Name {{ strtoupper($student->name ?? '—') }}
Enrollment No. {{ $student->enrollment_no ?? '—' }}
Father's Name {{ strtoupper($student->father_name ?? '—') }}
Course / Class {{ $course->name ?? '—' }}
Semester {{ $student->current_semester ?? '—' }}
Academic Session {{ $session->name ?? '—' }}
{{-- Amount Box --}}
Amount Paid
₹ {{ number_format($payment->amount_paid, 2) }}
{{ $amtWords }}
{{-- Payment Mode --}}
Mode: {{ strtoupper($payment->payment_mode) }}
@if($payment->cheque_no)
{{ $txnLabel }}: {{ $payment->cheque_no }}
@endif @if($payment->bank_name)
Bank: {{ $payment->bank_name }}
@endif
@if($payment->remarks)
Remarks: {{ $payment->remarks }}
@endif {{-- Note --}}
Note: Fees once deposited will not be refunded or transferred. This is a computer generated receipt. No signature required.
{{-- Footer --}}
{{-- Actions --}}
Download PDF Back
@endsection