@php $schoolName = $school->school_name ?? 'BANGLADESH SCIENCE AND TECHNOLOGY MADRASAH'; $schoolAddress = $school->address ?? 'K-85/1/C, Kuratoli Masjid Road, Khilkhet, Dhaka.'; $schoolPhone = $school->phone ?? '01342821459'; $schoolEmail = $school->email ?? 'info@bstm26.com'; $principalName = $school->principal_name ?? 'Mohammad Moin Uddin Sarker Madani'; $rawLogo = $school->school_logo ?? null; $schoolLogo = null; if ($rawLogo) { $schoolLogo = str_starts_with($rawLogo, 'http') ? $rawLogo : (str_starts_with($rawLogo, 'storage/') ? asset($rawLogo) : asset('storage/' . $rawLogo)); } $paidBy = $payment->creator?->name ?: ($bill->approver?->name ?: 'MD Rakib Khan'); $categoryName = $bill->category?->name ?? 'Operating Expense'; $vendorName = $bill->vendor_name ?: ($bill->expenseVendor?->name ?? 'N/A'); $paymentDate = optional($payment->payment_date)->format('d-m-Y h:i A') ?? date('d-m-Y h:i A'); $methodName = strtoupper($payment->paid_from_method_key ?? 'Cash'); $installmentPaymentMap = $bill->payments ->where('status', 'posted') ->whereNotNull('installment_id') ->sortByDesc('payment_date') ->groupBy('installment_id') ->map(fn($items) => $items->first()) ->all(); @endphp
Back to Bill
@if($schoolLogo) School Logo @else @endif
{{ $schoolName }}
{{ $schoolAddress }}
Phone: {{ $schoolPhone }} | Email: {{ $schoolEmail }}
EXPENSE PAYMENT RECEIPT
Payment / Receipt No: {{ $payment->payment_no }}
Payment Date & Time: {{ $paymentDate }}
Voucher / Bill No: {{ $bill->bill_no }}
Paid From / Method: {{ $methodName }}
Expense Category: {{ $categoryName }}
Payment Status: {{ strtoupper($payment->status) }}
Payee / Vendor: {{ $vendorName }}
Received / Paid By: {{ $paidBy }}
PARTICULARS
SL PARTICULARS & PURPOSE CATEGORY AMOUNT
1 Payment against Bill #{{ $bill->bill_no }} @if($installment) (Installment #{{ $installment->installment_no }}) @endif @if($payment->note)
Note: {{ $payment->note }} @endif
{{ $categoryName }} {{ number_format((float)$payment->amount, 2) }}
This Payment Amount: {{ number_format((float)$payment->amount, 2) }}
Total Bill Amount: {{ number_format((float)$bill->total_amount, 2) }}
Total Paid (To Date): {{ number_format((float)$bill->paid_amount, 2) }}
Remaining Bill Due: {{ number_format((float)$bill->remaining_amount, 2) }}
@if($bill->installments && $bill->installments->count() > 0)
INSTALLMENT SCHEDULE
@foreach($bill->installments as $inst) @php $instPayment = $installmentPaymentMap[$inst->id] ?? null; $instPaidDate = $instPayment ? optional($instPayment->payment_date)->format('d-m-Y h:i A') : '-'; @endphp @endforeach
INST # DUE DATE PAID DATE AMOUNT DUE PAID AMOUNT REMAINING STATUS
#{{ $inst->installment_no }} @if($payment->installment_id === $inst->id) (Current) @endif {{ optional($inst->due_date)->format('d-m-Y') }} {{ $instPaidDate }} {{ number_format((float)$inst->amount_due, 2) }} {{ number_format((float)$inst->amount_paid, 2) }} {{ number_format((float)$inst->remaining_amount, 2) }} {{ strtoupper($inst->status) }}
@endif
Prepared By
{{ $paidBy }}
Accountant
Accounts Dept.
Verified By
Admin Officer
Principal / Headmaster
{{ $principalName }}