{{-- ── Header ── --}}
M.D.S
Loan / Advance Summary Report
@if($selectedEmployee) Employee:   {{ $selectedEmployee->first_name }} {{ $selectedEmployee->last_name }} @endif @if($selectedDepartment)  |  Dept: {{ $selectedDepartment->name }} @endif
@if(empty($reportData['departments']))

No records found.

@else @php $n = fn($v) => $v ? number_format($v, 0) : '-'; $n0 = fn($v) => number_format($v, 0); @endphp @foreach($reportData['departments'] as $deptName => $deptData) {{-- Department Header --}} @foreach($deptData['rows'] as $row) @endforeach {{-- Dept Totals --}} @endforeach {{-- Grand Totals --}}
Name Designation Card No Opening Payments Deductions Balance
{{ $deptName }}
{{ $row['employee_name'] }} {{ $row['designation'] }} {{ $row['card_no'] }} {{ $n($row['opening']) }} {{ $n($row['payments']) }} {{ $n($row['deductions']) }} {{ $n($row['balance']) }}
Dept. Totals ==> {{ $n($deptData['totals']['opening']) }} {{ $n0($deptData['totals']['payments']) }} {{ $n0($deptData['totals']['deductions']) }} {{ $n0($deptData['totals']['balance']) }}
GRAND TOTALS ==> {{ $n($reportData['grand']['opening']) }} {{ $n0($reportData['grand']['payments']) }} {{ $n0($reportData['grand']['deductions']) }} {{ $n0($reportData['grand']['balance']) }}
@endif