{{-- Header --}}

{{ $lokasi['nama'] }}

LAPORAN CCR

{{-- Data Table --}} @php $base_cols = [ ["key" => "no", "label" => "No", "width" => "30px"], ["key" => "lemdikdasmen", "label" => "LEMDIKDASMEN", "width" => "160px"], ["key" => "piutang", "label" => "Piutang", "width" => "70px"], ["key" => "byr_thnseb_rev", "label" => "Pembayaran TS Rev", "width" => "70px"], ["key" => "byr_thnseb_bulan", "label" => "Pembayaran TS Bulan", "width" => "70px"], ["key" => "byr_thnseb_ytm", "label" => "Pembayaran TS YTM", "width" => "70px"], ["key" => "ccr_ts_rev", "label" => "CCR TS Rev (%)", "width" => "60px"], ["key" => "ccr_ts_bulan", "label" => "CCR TS Bulan (%)", "width" => "60px"], ["key" => "ccr_ts_ytm", "label" => "CCR TS YTM (%)", "width" => "60px"], ["key" => "tagihan_rev", "label" => "Tagihan TB Rev", "width" => "70px"], ["key" => "tagihan_bulan", "label" => "Tagihan TB Bulan", "width" => "70px"], ["key" => "tagihan_ytm", "label" => "Tagihan TB YTM", "width" => "70px"], ["key" => "byr_rev", "label" => "Pembayaran TB Rev", "width" => "70px"], ["key" => "byr_bulan", "label" => "Pembayaran TB Bulan", "width" => "70px"], ["key" => "byr_ytm", "label" => "Pembayaran TB YTM", "width" => "70px"], ["key" => "ccr_tb_rev", "label" => "CCR TB Rev (%)", "width" => "60px"], ["key" => "ccr_tb_bulan", "label" => "CCR TB Bulan (%)", "width" => "60px"], ["key" => "ccr_tb_ytm", "label" => "CCR TB YTM (%)", "width" => "60px"], ["key" => "ccr_total", "label" => "CCR Total (%)", "width" => "60px"], ]; $numeric_keys = [ "piutang", "byr_thnseb_rev", "byr_thnseb_bulan", "byr_thnseb_ytm", "tagihan_rev", "tagihan_bulan", "tagihan_ytm", "byr_rev", "byr_bulan", "byr_ytm", "ccr_ts_rev", "ccr_ts_bulan", "ccr_ts_ytm", "ccr_tb_rev", "ccr_tb_bulan", "ccr_tb_ytm", "ccr_total" ]; $totals = array_fill_keys($numeric_keys, 0); @endphp {{-- @foreach ($base_cols as $col) @endforeach --}} @foreach ($data as $i => $row) @php $piutang = floatval($row['piutang'] ?? 0); $byr_thnseb_rev = floatval($row['byr_thnseb_rev'] ?? 0); $byr_thnseb_bulan = floatval($row['byr_thnseb_bulan'] ?? 0); $byr_thnseb_ytm = floatval($row['byr_thnseb_ytm'] ?? 0); $tagihan_rev = floatval($row['tagihan_rev'] ?? 0); $tagihan_bulan = floatval($row['tagihan_bulan'] ?? 0); $tagihan_ytm = floatval($row['tagihan_ytm'] ?? 0); $byr_rev = floatval($row['byr_rev'] ?? 0); $byr_bulan = floatval($row['byr_bulan'] ?? 0); $byr_ytm = floatval($row['byr_ytm'] ?? 0); $row['no'] = $i + 1; $row['lemdikdasmen'] = ($row['kode_jur'] ?? '-') . ' - ' . ($row['nama'] ?? '-'); $row['ccr_ts_rev'] = $piutang != 0 ? ($byr_thnseb_rev / $piutang) * 100 : 0; $row['ccr_ts_bulan'] = $piutang != 0 ? ($byr_thnseb_bulan / $piutang) * 100 : 0; $row['ccr_ts_ytm'] = $piutang != 0 ? ($byr_thnseb_ytm / $piutang) * 100 : 0; $row['ccr_tb_rev'] = $tagihan_rev != 0 ? ($byr_rev / $tagihan_rev) * 100 : 0; $row['ccr_tb_bulan'] = $tagihan_bulan != 0 ? ($byr_bulan / $tagihan_bulan) * 100 : 0; $row['ccr_tb_ytm'] = $tagihan_ytm != 0 ? ($byr_ytm / $tagihan_ytm) * 100 : 0; $denominator = $piutang + $tagihan_ytm; $row['ccr_total'] = $denominator != 0 ? (($byr_ytm + $byr_thnseb_ytm) / $denominator) * 100 : 0; @endphp @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 --}} @php $ccr_ts_rev_total = $totals['piutang'] != 0 ? ($totals['byr_thnseb_rev'] / $totals['piutang']) * 100 : 0; $ccr_ts_bulan_total = $totals['piutang'] != 0 ? ($totals['byr_thnseb_bulan'] / $totals['piutang']) * 100 : 0; $ccr_ts_ytm_total = $totals['piutang'] != 0 ? ($totals['byr_thnseb_ytm'] / $totals['piutang']) * 100 : 0; $ccr_tb_rev_total = $totals['tagihan_rev'] != 0 ? ($totals['byr_rev'] / $totals['tagihan_rev']) * 100 : 0; $ccr_tb_bulan_total = $totals['tagihan_bulan'] != 0 ? ($totals['byr_bulan'] / $totals['tagihan_bulan']) * 100 : 0; $ccr_tb_ytm_total = $totals['tagihan_ytm'] != 0 ? ($totals['byr_ytm'] / $totals['tagihan_ytm']) * 100 : 0; $ccr_total_denominator = $totals['piutang'] + $totals['tagihan_ytm']; $ccr_total_total = $ccr_total_denominator != 0 ? (($totals['byr_ytm'] + $totals['byr_thnseb_ytm']) / $ccr_total_denominator) * 100 : 0; @endphp
No JURUSAN Piutang Periode Tahun Sebelumnya Periode Tahun berjalan ({{ $nama_bulan }}) CCR Total
Pembayaran CCR Tagihan Pembayaran CCR
Bulan Sebelumnya Bulan Berjalan YTM Bulan Sebelumnya Bulan Berjalan YTM Bulan Sebelumnya Bulan Berjalan YTM Bulan Sebelumnya Bulan Berjalan YTM Bulan Sebelumnya Bulan Berjalan YTM
{{ $col['label'] }}
{{ $is_numeric ? App\Helper\SaiHelpers::number_format_decimal($value, $export_type, 0, 2) : $value }} {{ substr($key, 0, 3) == 'ccr' ? '%' : '' }}
Total {{ App\Helper\SaiHelpers::number_format_decimal($totals['piutang'], $export_type, 0, 2) }} {{ App\Helper\SaiHelpers::number_format_decimal($totals['byr_thnseb_rev'], $export_type, 0, 2) }} {{ App\Helper\SaiHelpers::number_format_decimal($totals['byr_thnseb_bulan'], $export_type, 0, 2) }} {{ App\Helper\SaiHelpers::number_format_decimal($totals['byr_thnseb_ytm'], $export_type, 0, 2) }} {{ App\Helper\SaiHelpers::number_format_decimal($ccr_ts_rev_total, $export_type, 0, 2) }}% {{ App\Helper\SaiHelpers::number_format_decimal($ccr_ts_bulan_total, $export_type, 0, 2) }}% {{ App\Helper\SaiHelpers::number_format_decimal($ccr_ts_ytm_total, $export_type, 0, 2) }}% {{ App\Helper\SaiHelpers::number_format_decimal($totals['tagihan_rev'], $export_type, 0, 2) }} {{ App\Helper\SaiHelpers::number_format_decimal($totals['tagihan_bulan'], $export_type, 0, 2) }} {{ App\Helper\SaiHelpers::number_format_decimal($totals['tagihan_ytm'], $export_type, 0, 2) }} {{ App\Helper\SaiHelpers::number_format_decimal($totals['byr_rev'], $export_type, 0, 2) }} {{ App\Helper\SaiHelpers::number_format_decimal($totals['byr_bulan'], $export_type, 0, 2) }} {{ App\Helper\SaiHelpers::number_format_decimal($totals['byr_ytm'], $export_type, 0, 2) }} {{ App\Helper\SaiHelpers::number_format_decimal($ccr_tb_rev_total, $export_type, 0, 2) }}% {{ App\Helper\SaiHelpers::number_format_decimal($ccr_tb_bulan_total, $export_type, 0, 2) }}% {{ App\Helper\SaiHelpers::number_format_decimal($ccr_tb_ytm_total, $export_type, 0, 2) }}% {{ App\Helper\SaiHelpers::number_format_decimal($ccr_total_total, $export_type, 0, 2) }}%