@extends('layouts.main') @section('css') @endsection @section('breadcrumb') @endsection @section('content') {{-- ── Pegawai Info ── --}} @if (request()->routeIs('lainnya.simulasi-p2-mengajar-2026.*') || request()->boolean('force_standar'))
Simulasi P2 Mengajar 2026: Perhitungan pada rincian pegawai ini menggunakan {{ $aturanBaru ? 'Aturan Baru (Periode 401)' : 'Aturan Standar (Sebelum Periode 401)' }}. @if (request()->boolean('data_api')) Data API Aktif @endif
@if (request()->routeIs('lainnya.simulasi-p2-mengajar-2026.*') || request()->has('data_api'))
boolean('data_api') ? 'checked' : '' }} style="cursor:pointer;width:2em;height:1em;">
@endif
@endif
{{ $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)

@php $hasAdhocInMonth = collect($sec['units'])->contains(fn ($u) => !empty($u['adhoc_kegiatan'])); @endphp {{-- Nav Tabs --}}
{{-- Tab: Poin --}}
@php $exportPoinRouteName = request()->routeIs('lainnya.simulasi-p2-mengajar-2026.*') ? 'lainnya.simulasi-p2-mengajar-2026.detail.export-poin' : (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])); @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 (!empty($row['is_api'])) Data API @endif @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']; $adhoc = $sec['adhoc'] ?? null; $hasAdhocDetail = $hasAdhocInMonth && $adhoc; @endphp
{{-- Kiri: Langkah Perhitungan --}}
@foreach (['poin' => 'Pemotongan Poin', 'bruto' => 'P2 (Bruto)', 'ratio' => 'P2 (Rasio)'] as $fKey => $fLabel) @if (!empty($p2f[$fKey]['steps'])) @php $steps = $p2f[$fKey]['steps']; $stepsCount = count($steps); $effRasio = ($hasAdhocInMonth && $sec['bruto'] > 0) ? ($sec['rasio'] / $sec['bruto']) * 100 : 100; @endphp
{{ $fLabel }}
    @foreach ($steps as $stepIdx => $step) @php $isLast = $loop->last; $displayStep = $step; // Baris hasil biasa; untuk P2 (Bruto) dengan Adhoc, // baris bruto mentah bukan hasil akhir (disusul pengurangan Adhoc). $isResult = $isLast; $isAturanBaruDetail = !empty($adhoc['is_aturan_baru']); if ($hasAdhocInMonth && !$isAturanBaruDetail) { if ($fKey === 'bruto' && $isLast && $hasAdhocDetail) { $isResult = false; } elseif ($fKey === 'ratio') { if ($isLast) { $displayStep = 'Rp. ' . number_format($sec['rasio'], 2, ',', '.'); } elseif ($stepIdx === $stepsCount - 2) { $displayStep = 'Rp. ' . number_format($sec['bruto'], 2, ',', '.') . ' * ' . number_format($effRasio, 0, ',', '.') . '%'; } } } @endphp
  • {{ $displayStep }}
  • @endforeach @if ($fKey === 'bruto' && $hasAdhocDetail && empty($adhoc['is_aturan_baru']))
  • P2 (Bruto) − P2 Adhoc
  • Rp. {{ number_format($sec['p2_total_bruto'], 2, ',', '.') }} − Rp. {{ number_format($adhoc['potongan'], 2, ',', '.') }}
  • Rp. {{ number_format($sec['bruto'], 2, ',', '.') }}
  • @endif
@endif @endforeach
{{-- Kanan: Detail Jabatan --}}
@if ($sec['is_dosen']) {{-- Jabatan Tugas Tambahan --}} @if (!empty($p2f['tambahan']))
Jabatan Tugas Tambahan
Jabatan: {{ $p2f['tambahan']['jabatan'] ?? '-' }}
Grade: {{ $p2f['tambahan']['grade'] ?? '-' }}
Harga Jabatan: Rp. {{ number_format($p2f['tambahan']['harga'] ?? 0, 2, ',', '.') }}
    @foreach ($p2f['tambahan']['steps'] as $step)
  • last) class="formula-result" @endif>{{ $step }}
  • @endforeach
@endif {{-- Jabatan Fungsional --}} @if (!empty($p2f['fungsional']))
Jabatan Fungsional
Jabatan: {{ $p2f['fungsional']['jabatan'] ?? '-' }}
Grade: {{ $p2f['fungsional']['grade'] ?? '-' }}
Harga Jabatan: Rp. {{ number_format($p2f['fungsional']['harga'] ?? 0, 2, ',', '.') }}
    @foreach ($p2f['fungsional']['steps'] as $step)
  • last) class="formula-result" @endif>{{ $step }}
  • @endforeach
@endif {{-- Adhoc --}} @if ($hasAdhocDetail) @if (!empty($adhoc['is_aturan_baru']))
Adhoc
Poin P2 Adhoc Total: {{ number_format($adhoc['poin_total'], 2, ',', '.') }}
Poin P2 Adhoc Masuk JTT: {{ number_format($adhoc['poin_jtt'], 2, ',', '.') }}
@if (!empty($adhoc['poin_jf'])) Poin P2 Adhoc Masuk JF: {{ number_format($adhoc['poin_jf'], 2, ',', '.') }}
@endif Sisa Poin P2 Adhoc: {{ number_format($adhoc['poin_sisa'], 2, ',', '.') }}
Nilai per Poin (Adhoc): Rp. {{ number_format($adhoc['nilai_per_poin'], 2, ',', '.') }}
  • Sisa Poin P2 Adhoc × Nilai per Poin Adhoc
  • (1 / {{ $adhoc['pembagi'] ?? 6 }}) × {{ number_format($adhoc['poin_sisa'], 2, ',', '.') }} × Rp. 660.000,00
  • Rp. {{ number_format($adhoc['p2_adhoc'], 2, ',', '.') }}
@else @php $selisihPerPoin = $adhoc['nilai_per_poin_normal'] - $adhoc['nilai_per_poin_adhoc']; @endphp
Adhoc
Poin P2 Adhoc: {{ number_format($adhoc['poin'], 2, ',', '.') }}
Nilai per Poin (Normal): Rp. {{ number_format($adhoc['nilai_per_poin_normal'], 2, ',', '.') }}
Nilai per Poin (Adhoc): Rp. {{ number_format($adhoc['nilai_per_poin_adhoc'], 2, ',', '.') }}
  • Poin P2 Adhoc × (Nilai per Poin Normal − Nilai per Poin Adhoc)
  • {{ number_format($adhoc['poin'], 2, ',', '.') }} × (Rp. {{ number_format($adhoc['nilai_per_poin_normal'], 2, ',', '.') }} − Rp. {{ number_format($adhoc['nilai_per_poin_adhoc'], 2, ',', '.') }})
  • {{ number_format($adhoc['poin'], 2, ',', '.') }} × Rp. {{ number_format($selisihPerPoin, 2, ',', '.') }}
  • Rp. {{ number_format($adhoc['potongan'], 2, ',', '.') }}
@endif @endif @else {{-- Tendik: single jabatan --}}
Jabatan
Jabatan: {{ $p2f['jabatan'] ?? '-' }}
Grade: {{ $p2f['grade'] ?? '-' }}
Harga Jabatan: Rp. {{ number_format($p2f['harga'] ?? 0, 2, ',', '.') }}
@endif
@else
Data perhitungan tidak tersedia.
@endif
{{-- /tab Detail P2 --}} {{-- Tab: P2 Per Unit --}}
@foreach ($sec['units'] as $u) @php $uPoin = (float) ($u['poin']['p2'] ?? 0); $uRasio = (float) ($u['rasio'] ?? 1); $uBruto = (float) ($u['p2']['bruto'] ?? 0); $uRatio = (float) ($u['p2']['ratio'] ?? 0); $uTax = (float) ($u['p2']['tax'] ?? 0); $uNetto = (float) ($u['p2']['netto'] ?? 0); $tPoin = $sec['total_poin_p2'] > 0 ? $sec['total_poin_p2'] : 1; $fmt = fn ($v) => number_format($v, 2, ',', '.'); $brutoBase = $hasAdhocInMonth ? $sec['rasio'] : $sec['p2_total_bruto']; $expectedBruto = ($uPoin / $tPoin) * $brutoBase; $selisih = round($uBruto - $expectedBruto, 2); @endphp
{{ $u['nama'] }}
{{-- Formula: bruto per unit --}}
P2 Bruto
  • (Poin P2 {{ $u['nama'] }} / Total Poin P2) × P2 Bruto
  • ({{ $fmt($uPoin) }} / {{ $fmt($tPoin) }}) × Rp. {{ $fmt($brutoBase) }} @if ($selisih != 0) @php $modalId = 'adhocModal-' . $month . '-' . $u['id']; @endphp {{ $selisih > 0 ? '+' : '−' }} Rp. {{ $fmt(abs($selisih)) }} @endif
  • 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: Penyesuaian Tim Adhoc per bulan per unit --}} @foreach ($monthSections as $month => $sec) @foreach ($sec['units'] as $u) @if (!empty($u['adhoc_kegiatan'])) @php $modalId = 'adhocModal-' . $month . '-' . $u['id']; $fmtRp = fn ($v) => 'Rp. ' . number_format($v, 2, ',', '.'); $tPoinM = $sec['total_poin_p2'] > 0 ? $sec['total_poin_p2'] : 1; @endphp @endif @endforeach @endforeach @endsection @section('js') @endsection