{{-- Header --}}

{{ $lokasi['nama'] }}

LAPORAN WRITE OFF TAGIHAN MAHASISWA

{{-- Data Table --}} @php // Define base columns $base_cols = [ ["key" => "no", "label" => "No", "width" => "30px"], ["key" => "no_bukti", "label" => "No Bukti", "width" => "100px"], ["key" => "nim", "label" => "NIM", "width" => "100px"], ["key" => "nama", "label" => "Nama", "width" => "180px"], ["key" => "kode_pp", "label" => "PP", "width" => "90px"], ["key" => "kelas", "label" => "Kelas", "width" => "90px"], ["key" => "jurusan", "label" => "Jurusan", "width" => "90px"], ["key" => "angkatan", "label" => "Angkatan", "width" => "90px"], ["key" => "bulan", "label" => "Bulan", "width" => "60px"], ["key" => "keterangan", "label" => "Keterangan", "width" => "180px"], ]; // Add dynamic kode_params and total foreach ($kode_params as $param) { $base_cols[] = [ "key" => $param['key'], "label" => $param['label'], "width" => "90px" ]; } $base_cols[] = ["key" => "total", "label" => "Total", "width" => "90px"]; $paramKeys = array_map(fn($p) => $p['key'], $kode_params); // Merge with "total" $numeric_keys = array_merge($paramKeys, ["total"]); // Initialize totals with zeros $totals = array_fill_keys($numeric_keys, 0); @endphp @foreach ($base_cols as $col) @endforeach @foreach ($data as $i => $row) @foreach ($base_cols as $col) @php $key = $col['key']; $value = $row[$key] ?? ''; $is_numeric = in_array($key, $numeric_keys); if ($is_numeric) $totals[$key] += floatval($value); @endphp @endforeach @endforeach {{-- Totals --}} @foreach ($base_cols as $col) @if (in_array($col['key'], $numeric_keys)) @endif @endforeach
{{ $col['label'] }}
{{ $is_numeric ? App\Helper\SaiHelpers::number_format_decimal($value, $export_type) : $value }}
Total {{ App\Helper\SaiHelpers::number_format_decimal($totals[$col['key']], $export_type) }}