@php // $months => ['YYYY-MM' => 'Mar 2025', ...] // $feeTypeIdsByMonth => ['YYYY-MM' => [1,2,3], ...] // $feeTypeMap => collection keyed by id // $rows => keyed by student_id @endphp
Report
@foreach($months as $mKey => $mLabel) @php $count = count($feeTypeIdsByMonth[$mKey] ?? []); @endphp @endforeach @foreach($months as $mKey => $mLabel) @php $fts = $feeTypeIdsByMonth[$mKey] ?? []; if (count($fts) == 0) { echo ""; } else { foreach ($fts as $ftid) { echo ""; } } @endphp @endforeach @php $i = 1; @endphp @forelse($rows as $studentId => $r) @foreach($months as $mKey => $mLabel) @php $fts = $feeTypeIdsByMonth[$mKey] ?? []; if (count($fts) == 0) { echo ""; } else { foreach ($fts as $ftid) { $val = $r['month_fee'][$mKey][$ftid] ?? ''; echo ""; } } @endphp @endforeach @empty @endforelse @foreach($months as $mKey => $mLabel) @php $fts = $feeTypeIdsByMonth[$mKey] ?? []; if (count($fts) == 0) { echo ""; } else { foreach ($fts as $ftid) { echo ""; } } @endphp @endforeach
SL Student Name Class Roll Section{{ $mLabel }}Total
—" . ($feeTypeMap[$ftid]->name ?? $ftid) . "
{{ $i++ }} {{ $r['student']->student_name_english ?? ($r['student']->name ?? 'N/A') }} {{ $r['class']->name ?? 'N/A' }} {{ $r['roll'] ?? '—' }} {{ $r['section']->section_name ?? ($r['section']->name ?? '—') }}" . $val . "{{ number_format($r['total'] ?? '') }}
No students found for the selected filters.
Month Totals" . $footerTotalsPerMonth[$mKey] ?? ''. "" . $columnTotals[$mKey][$ftid] ?? '' . "{{ $grandTotal ?? '' }}