@extends('layouts.main') @section('css') @endsection @section('breadcrumb') @endsection @section('content') {{-- ── Pegawai Info ── --}}
{{ $pegawai->nama }}
NIP: {{ $pegawai->nip }}  |  {{ ucwords($pegawai->jenis_pegawai) }}  |  {{ $pegawai->unit_kerja_nama }}  |  Periode {{ $periode }}
{{-- ── 4 Summary Cards ── --}}
@foreach ([ ['icon'=>'uil-chart-bar-alt','color'=>'primary', 'label'=>'Total P2 Bruto', 'val'=>$grandTotals['bruto']], ['icon'=>'uil-arrow-growth', 'color'=>'success', 'label'=>'P2 Setelah Rasio', 'val'=>$grandTotals['ratio']], ['icon'=>'uil-receipt', 'color'=>'warning', 'label'=>'Pajak', 'val'=>$grandTotals['tax']], ['icon'=>'uil-money-bill', 'color'=>'danger', 'label'=>'P2 Setelah Pajak', 'val'=>$grandTotals['netto']], ] as $card)
{{ $card['label'] }}
Rp {{ number_format($card['val'], 2, ',', '.') }}
@endforeach
{{-- ── Month Accordion ── --}}
@foreach ($monthSections as $month => $sec)

{{-- Nav Tabs --}}
{{-- Tab: Poin --}}
@php $exportPoinRouteName = request()->routeIs('remunerasi.p2.*') ? 'remunerasi.p2.detail.export-poin' : 'pleno-penunjang.rasio-p2.detail.export-poin'; $exportPoinUrl = route($exportPoinRouteName, array_merge(request()->query(), ['nip' => $pegawai->nip, 'bulan' => $month])); // Rasio unit efektif bulan ini < 100% → Nominal (Rp) kena potongan Rasio, beri flag visual $rasioAffected = $sec['bruto'] > 0 && ($sec['rasio'] / $sec['bruto']) < 0.999; @endphp @if ($isAdmin) @endif
@php $catOpen = false; $catColor = '#1565c0'; @endphp @foreach ($sec['rows'] as $row) @if ($row['type'] === 'cat') @if ($catOpen) @endif @php $catOpen = true; $catColor = $row['color']; @endphp @elseif ($row['type'] === 'sub') @elseif ($row['type'] === 'item') @elseif ($row['type'] === 'stot') @elseif ($row['type'] === 'tot') @endif @endforeach @if ($catOpen) @endif
# Kegiatan Poin Total Poin Remun Poin P2 Nominal (Rp)
{{ $row['label'] }}
{{ $row['label'] }} @if (!is_null($row['limit'])) Maks: {{ (int) $row['limit'] }} @endif
{{ $row['no'] }} {{ $row['label'] }} @if ($row['cut_zero']) ↓Limit @elseif ($row['cut_partial']) ↓Batas @elseif ($row['zero']) ↓P1 @elseif ($row['p1_partial'] ?? false) ↓P1~ @endif @if (!empty($row['formula']))
@foreach ($row['formula'] as $fStep) @if ($loop->last)
{{ $fStep }}
@else
• {{ $fStep }}
@endif @endforeach
@endif
{{ number_format($row['pt'], 2, ',', '.') }} {{ number_format($row['pr'], 2, ',', '.') }} {{ number_format($row['pp'], 2, ',', '.') }} {{ $row['br'] > 0 ? number_format($row['br'], 2, ',', '.') : '-' }}
{{ $row['label'] }} {{ number_format($row['pt'], 2, ',', '.') }} {{ number_format($row['pr'], 2, ',', '.') }} {{ number_format($row['pp'], 2, ',', '.') }} {{ $row['br'] > 0 ? number_format($row['br'], 2, ',', '.') : '-' }}
{{ $row['label'] }} {{ number_format($row['pt'], 2, ',', '.') }} {{ number_format($row['pr'], 2, ',', '.') }} {{ number_format($row['pp'], 2, ',', '.') }} {{ $row['br'] > 0 ? number_format($row['br'], 2, ',', '.') : '-' }}
{{-- /tab Poin --}} {{-- Tab: Detail P2 --}}
@if ($sec['p2_formula']) @php $p2f = $sec['p2_formula']; $ks = $sec['kegiatan_split'] ?? null; $ks660 = $ks['pengali660'] ?? null; $ksBiasa = $ks['pengaliBiasa'] ?? null; $adhocPp = (float) ($ks660['pp'] ?? 0); $adhocBr = (float) ($ks660['br'] ?? 0); $hasAdhocPoin = $adhocPp > 0; // Pengali status PNS/CPNS/PPPK — nilainya sudah baku dihitung backend per item; // diturunkan di sini agar bisa ditampilkan sebagai langkah formula yang eksplisit. $pengaliLabel = 'PNS'; if (!empty($p2f['bruto']['steps'][0]) && preg_match('/Pengali\s+(\S+)/', $p2f['bruto']['steps'][0], $m)) { $pengaliLabel = $m[1]; } $pengaliMultiplier = $hasAdhocPoin ? round($adhocBr / ($adhocPp * 110000), 4) : 1.0; // Sejak Adhoc dikeluarkan dari pool Fungsional/Tugas Tambahan di PerhitunganKegiatanService, // $p2f['fungsional']['poin']/['total'] SUDAH BERSIH (tidak mengandung poin Adhoc lagi) — // tidak perlu dikurangi lagi di sini. $fHarga = (float) ($p2f['fungsional']['harga'] ?? 0); $fNominalCorrected = (float) ($p2f['fungsional']['total'] ?? 0); // Pool "Pengali Jabatan" hanya bisa diklik akurat jika tidak dibagi lagi dengan kuota Jabatan Tugas Tambahan $fPoolIsExclusive = empty($p2f['tambahan']['poin_tridharma']); // Dipakai di box "Jabatan Tugas Tambahan" DAN di ringkasan "P2 (Bruto)" — pakai harga jabatan $tNominalOriginal = (float) ($p2f['tambahan']['total'] ?? 0); // P2 (Bruto) = jumlah LANGSUNG dari Adhoc + Fungsional + Tugas Tambahan (masing-masing pakai // harga jabatan sendiri, sama seperti box di bawah). Sejak Adhoc dikeluarkan dari pool // Fungsional/Tugas Tambahan di PerhitunganKegiatanService, jumlah ini SUDAH SAMA PERSIS // dengan $sec['bruto'] (nilai riil yang sesungguhnya dipakai di seluruh halaman & export). // adhocBr sudah termasuk pengali, jadi dibagi dulu supaya tidak dihitung ganda saat ditampilkan x pengali. $pengaliDivisor = $pengaliMultiplier > 0 ? $pengaliMultiplier : 1; $adhocBrPre = $adhocBr / $pengaliDivisor; // Result akhir SELALU pakai total utuh satu orang ($sec['*_whole_person']) — BUKAN // $sec['bruto']/['rasio']/['tax']/['netto'], karena field itu ikut terpotong kalau // halaman sedang difilter ke satu unit pembayaran (?unit=), sedangkan langkah-langkah // rumus yang ditampilkan di atas selalu utuh satu orang — supaya keduanya konsisten. $brutoSumTotal = $sec['bruto_whole_person'] ?? $sec['bruto']; $ratioSumTotal = $sec['ratio_whole_person'] ?? $sec['rasio']; $taxSumTotal = $sec['tax_whole_person'] ?? $sec['tax']; $nettoSumTotal = $sec['netto_whole_person'] ?? $sec['netto']; // % untuk teks narasi saja (hasil akhir tetap pakai nilai riil di atas, bukan hasil kali ulang) $effRasioPercent = ($brutoSumTotal > 0) ? ($ratioSumTotal / $brutoSumTotal) * 100 : 100; $pajakPercent = ($ratioSumTotal > 0) ? ($taxSumTotal / $ratioSumTotal) * 100 : 0; $golonganLabel = ''; if (!empty($p2f['tax']['steps'][0]) && preg_match('/Golongan\s+(\S+)/', $p2f['tax']['steps'][0], $mGol)) { $golonganLabel = ' Golongan '.$mGol[1]; } @endphp
{{-- Kiri: Langkah Perhitungan --}}
@foreach (['poin' => 'Pemotongan Poin', 'bruto' => 'P2 (Bruto)', 'ratio' => 'P2 (Rasio)', 'tax' => 'P2 (Pajak)', 'net' => 'P2 (Netto)'] as $fKey => $fLabel) @if ($fKey === 'bruto' && $hasAdhocPoin)
{{ $fLabel }}
  • (P2 Kegiatan Adhoc + P2 Jabatan Fungsional{{ !empty($p2f['tambahan']) ? ' + P2 Jabatan Tugas Tambahan' : '' }}) x Pengali {{ $pengaliLabel }}
  • (Rp. {{ number_format($adhocBrPre, 2, ',', '.') }} + Rp. {{ number_format($fNominalCorrected, 2, ',', '.') }}{{ !empty($p2f['tambahan']) ? ' + Rp. '.number_format($tNominalOriginal, 2, ',', '.') : '' }}) x {{ $pengaliMultiplier }}
  • Rp. {{ number_format($brutoSumTotal, 2, ',', '.') }}
@elseif ($fKey === 'ratio' && $hasAdhocPoin)
{{ $fLabel }}
  • P2 (Bruto) x Rasio
  • Rp. {{ number_format($brutoSumTotal, 2, ',', '.') }} x {{ number_format($effRasioPercent, 0, ',', '.') }}%
  • Rp. {{ number_format($ratioSumTotal, 2, ',', '.') }}
@elseif ($fKey === 'tax' && $hasAdhocPoin)
{{ $fLabel }}
  • P2 (Rasio) x Pajak{{ $golonganLabel }}
  • Rp. {{ number_format($ratioSumTotal, 2, ',', '.') }} x {{ number_format($pajakPercent, 0, ',', '.') }}%
  • Rp. {{ number_format($taxSumTotal, 2, ',', '.') }}
@elseif ($fKey === 'net' && $hasAdhocPoin)
{{ $fLabel }}
  • P2 (Rasio) - P2 (Pajak)
  • Rp. {{ number_format($ratioSumTotal, 2, ',', '.') }} - Rp. {{ number_format($taxSumTotal, 2, ',', '.') }}
  • Rp. {{ number_format($nettoSumTotal, 2, ',', '.') }}
@elseif (!empty($p2f[$fKey]['steps']))
{{ $fLabel }}
    @foreach ($p2f[$fKey]['steps'] as $step)
  • last) class="formula-result" @endif>{{ $step }}
  • @endforeach
@endif @endforeach
{{-- Kanan: Detail Jabatan --}}
@if ($sec['is_dosen']) {{-- Adhoc (Pengali 660) --}} @if ($hasAdhocPoin)
Adhoc
Kegiatan: Tim Adhoc / Kepanitiaan Adhoc
Tarif Tetap: Rp. 660.000,00
  • (Jumlah Bulan Menjabat / Total Bulan Menjabat) x Poin Kegiatan Adhoc x Rp. 660.000
  • (1 / 6) x {{ number_format($adhocPp, 2, ',', '.') }} x 660.000
  • Rp. {{ number_format($adhocBrPre, 2, ',', '.') }}
@endif {{-- Jabatan Fungsional --}} @if (!empty($p2f['fungsional'])) @php $fSteps = $p2f['fungsional']['steps'] ?? []; // Baris "poin saja" (sebelum baris formula/kalkulasi/hasil) — ini yang bisa diklik $fPoinLineIndex = count($fSteps) - 4; @endphp
Jabatan Fungsional
Jabatan: {{ $p2f['fungsional']['jabatan'] ?? '-' }}
Grade: {{ $p2f['fungsional']['grade'] ?? '-' }}
Harga Jabatan: {{ number_format($fHarga, 2, ',', '.') }}
    @foreach ($fSteps as $stepIdx => $step) @php $isMilestone = !$loop->last && (($stepIdx + 1) % 3 === 0); @endphp
  • last) class="formula-result" @endif> @if ($stepIdx === $fPoinLineIndex && $fPoolIsExclusive) {{ $step }} @elseif ($isMilestone) {{ $step }} @else {{ $step }} @endif
  • @endforeach
@endif {{-- Jabatan Tugas Tambahan --}} @if (!empty($p2f['tambahan'])) @php $tSteps = $p2f['tambahan']['steps'] ?? []; $hasTriDharmaSplit = isset($p2f['tambahan']['poin_tridharma']); $tKuota = (float) ($p2f['tambahan']['poin'] ?? 28); $tPoinSkp = (float) ($p2f['tambahan']['poin_skp'] ?? 0); $tPoinTriDharma = (float) ($p2f['tambahan']['poin_tridharma'] ?? 0); // Baris "penurunan poin" sebelum formula valuasi (3 baris terakhir selalu formula/kalkulasi/hasil) $tPoinDerivationSteps = array_slice($tSteps, 0, max(0, count($tSteps) - 3)); $tValuationSteps = array_slice($tSteps, -3); @endphp
Jabatan Tugas Tambahan
Jabatan: {{ $p2f['tambahan']['jabatan'] ?? '-' }}
Grade: {{ $p2f['tambahan']['grade'] ?? '-' }}
Harga Jabatan: {{ number_format($p2f['tambahan']['harga'] ?? 0, 2, ',', '.') }}
    @if ($hasTriDharmaSplit)
  • Poin Maksimal Jabatan Tugas Tambahan
  • {{ number_format($tKuota, 2, ',', '.') }}
  • Poin Maksimal Jabatan Tugas Tambahan - Poin SKP
  • {{ number_format($tKuota, 2, ',', '.') }} - {{ number_format($tPoinSkp, 2, ',', '.') }}
  • {{ number_format($tPoinTriDharma, 2, ',', '.') }}
  • Poin SKP + Poin Tri Dharma
  • {{ number_format($tPoinSkp, 2, ',', '.') }} + {{ number_format($tPoinTriDharma, 2, ',', '.') }}
  • {{ number_format($tPoinSkp + $tPoinTriDharma, 2, ',', '.') }}
  • @else @foreach ($tPoinDerivationSteps as $step) @php $isTMilestone = !$loop->last && (($loop->index + 1) % 3 === 0); @endphp
  • @if ($isTMilestone){{ $step }}@else{{ $step }}@endif
  • @endforeach @endif @foreach ($tValuationSteps as $step)
  • last) class="formula-result" @endif>{{ $step }}
  • @endforeach
@endif @else {{-- Tendik: single jabatan --}}
Jabatan
Jabatan: {{ $p2f['jabatan'] ?? '-' }}
Grade: {{ $p2f['grade'] ?? '-' }}
Harga Jabatan: {{ number_format($p2f['harga'] ?? 0, 2, ',', '.') }}
@endif
@else
Data perhitungan tidak tersedia.
@endif
{{-- /tab Detail P2 --}} {{-- Tab: P2 Per Unit --}}
@php $totalPoinP2Full = (float) ($sec['total_poin_p2'] ?? 0); // Pakai total bruto UTUH satu orang (bukan $sec['bruto'], yang ikut terpotong // kalau halaman sedang difilter ke satu unit pembayaran via ?unit=) — supaya // formula rasio-poin di bawah tetap sepadan skalanya dengan $totalPoinP2Full // (yang juga utuh satu orang), berapa pun unit yang sedang difilter. $p2BrutoFull = (float) ($sec['bruto_whole_person'] ?? $sec['bruto'] ?? 0); @endphp @foreach ($sec['units'] as $u) @php $uAdhocPoin = collect($u['adhoc_kegiatan'] ?? [])->sum('poin_p2'); $uPoin = (float) ($u['poin']['p2'] ?? 0) + $uAdhocPoin; $uRasio = (float) ($u['rasio'] ?? 1); $uTax = (float) ($u['p2']['tax'] ?? 0); $uNetto = (float) ($u['p2']['netto'] ?? 0); $fmt = fn ($v) => number_format($v, 2, ',', '.'); // Poin & Total Poin dipakai dalam skala yang sama (full, termasuk Adhoc unit ybs), // sehingga hasil kali di baris formula SELALU persis sama dengan hasil akhir yang ditampilkan, // dan jumlah seluruh unit selalu persis sama dengan P2 Bruto/Rasio total. $uBruto = $totalPoinP2Full > 0 ? ($uPoin / $totalPoinP2Full) * $p2BrutoFull : 0; $uRatio = $uBruto * $uRasio; $uItems = $u['items'] ?? []; $uItemsSum = collect($uItems)->sum('poin_p2'); $uAdhocList = $u['adhoc_kegiatan'] ?? []; $uAdhocSum = collect($uAdhocList)->sum('poin_p2'); $uResidu = $uPoin - $uItemsSum - $uAdhocSum; $poinModalId = 'unitPoinModal-' . $month . '-' . $u['id']; @endphp
{{ $u['nama'] }}
{{-- Formula: bruto per unit --}}
P2 Bruto
  • (Poin P2 {{ $u['nama'] }} / Total Poin P2) × P2 Bruto
  • ({{ $fmt($uPoin) }} / {{ $fmt($totalPoinP2Full) }}) × Rp. {{ $fmt($p2BrutoFull) }}
  • Rp. {{ $fmt($uBruto) }}
{{-- Formula: setelah rasio --}}
P2 (Rasio)
  • P2 Bruto × Rasio
  • Rp. {{ $fmt($uBruto) }} × {{ number_format($uRasio * 100, 0) }}%
  • Rp. {{ $fmt($uRatio) }}
@endforeach
{{-- /tab P2 Per Unit --}}
{{-- /tab-content --}}
@endforeach
{{-- ── Grand Total ── --}}
Total Keseluruhan P2 Per Unit (Seluruh Periode)
@foreach ($grandUnits as $uid => $gu) @endforeach
Unit Kerja Rasio P2 Bruto Setelah Rasio Pajak P2 Setelah Pajak
[{{ $uid }}]{{ $gu['nama'] }} {{ number_format(($gu['rasio'] ?? 1) * 100, 0) }}% Rp {{ number_format($gu['bruto'], 2, ',', '.') }} Rp {{ number_format($gu['ratio'], 2, ',', '.') }} Rp {{ number_format($gu['tax'], 2, ',', '.') }} Rp {{ number_format($gu['netto'], 2, ',', '.') }}
TOTAL SELURUH UNIT Rp {{ number_format($grandTotals['bruto'], 2, ',', '.') }} Rp {{ number_format($grandTotals['ratio'], 2, ',', '.') }} Rp {{ number_format($grandTotals['tax'], 2, ',', '.') }} Rp {{ number_format($grandTotals['netto'], 2, ',', '.') }}
{{-- Legend --}}
↓P1 Poin P2 = 0 karena habis terpotong P1 12 poin ↓P1~ Poin P2 terpotong sebagian oleh P1 12 poin Sebagian poin terpotong P1 (nominal lebih kecil dari bruto)
{{-- Modals: Rincian Poin Kegiatan (Pengali 660 / Pengali Jabatan) per bulan --}} @foreach ($monthSections as $month => $sec) @php $ksModal = $sec['kegiatan_split'] ?? null; $ksModal660 = $ksModal['pengali660'] ?? null; $ksModalBiasa = $ksModal['pengaliBiasa'] ?? null; $fmtKsModal = fn ($v) => number_format((float) $v, 2, ',', '.'); @endphp @foreach ([ ['id' => 'kegiatanSplitModal660-' . $month, 'label' => 'Pengali 660', 'data' => $ksModal660, 'color' => '#1565c0'], ['id' => 'kegiatanSplitModalBiasa-' . $month, 'label' => 'Pengali Jabatan', 'data' => $ksModalBiasa, 'color' => '#1565c0'], ] as $ksm) @if (!empty($ksm['data']['items'])) @endif @endforeach @endforeach @endsection @section('js') @endsection