From 62384f0004d60f76e3b060f02e1c608084ae0518 Mon Sep 17 00:00:00 2001 From: Ariyutta Date: Tue, 29 Sep 2026 14:09:51 +0700 Subject: [PATCH] Revert ke Aturan Lama --- .../PlenoPenunjang/RasioP2Controller.php | 260 +-- app/Services/PerhitunganKegiatanService.php | 70 +- app/Services/PerhitunganP2Service.php | 49 +- .../rasio-p2/detail-new.blade.php | 1599 +++++++++-------- .../pleno-penunjang/rasio-p2/detail.blade.php | 1501 +++++++--------- 5 files changed, 1584 insertions(+), 1895 deletions(-) diff --git a/app/Http/Controllers/Perhitungan/PlenoPenunjang/RasioP2Controller.php b/app/Http/Controllers/Perhitungan/PlenoPenunjang/RasioP2Controller.php index 8a944e15..460fd310 100644 --- a/app/Http/Controllers/Perhitungan/PlenoPenunjang/RasioP2Controller.php +++ b/app/Http/Controllers/Perhitungan/PlenoPenunjang/RasioP2Controller.php @@ -25,12 +25,6 @@ use Yajra\DataTables\DataTables; class RasioP2Controller extends Controller { - /** - * Rubrik id kegiatan Tim Adhoc / Kepanitiaan Adhoc dosen yang dihargai - * dengan tarif tetap Rp 660.000 (bukan proporsional pengali jabatan). - */ - private const ADHOC_RUBRIK_IDS = [684, 685, 686, 687, 695, 696, 697]; - public function index() { $title = 'Rasio P2'; @@ -136,11 +130,6 @@ class RasioP2Controller extends Controller } } - /** - * Ambil data Rasio P2 untuk satu unit, dengan cache singkat agar navigasi - * pagination/sorting DataTables (yang meng-hit ulang parameter filter yang sama) - * tidak perlu menghitung ulang query relasi yang berat setiap request. - */ private function getDataForUnit($unit, $request, $periode = null) { if ($periode === null) { @@ -379,7 +368,7 @@ class RasioP2Controller extends Controller return $export->download($filename); } - public function detailNew(Request $request, string $nip): View|RedirectResponse + public function detail(Request $request, string $nip): View|RedirectResponse { $team = Team::find(session('team_id')); $isAdmin = $team && $team->nama === 'Admin'; @@ -464,11 +453,6 @@ class RasioP2Controller extends Controller return (new RasioP2PoinExport($pegawai, $periode, $months[$bulan], $sec))->download($filename); } - /* ───────────────────────────────────────────────────────────────────── - * Pre-process $kegiatans menjadi flat row arrays siap render. - * Semua komputasi (subtotal, grouping, format) dilakukan di sini - * agar Blade hanya melakukan rendering murni. - * ───────────────────────────────────────────────────────────────────── */ private function prepareViewData(array $kegiatans, array $months): array { $monthSections = []; @@ -488,98 +472,61 @@ class RasioP2Controller extends Controller $monthNetto = (float) array_sum(array_map(fn ($u) => $u['p2']['netto'] ?? 0, $units)); $totalPoinRemun = (float) array_sum($kegiatan['total_poin']['poin_remunerasi'] ?? []); $totalPoinP2 = (float) array_sum($kegiatan['total_poin']['poin_p2'] ?? []); - // Poin P2 milik unit yang sedang ditampilkan saja (ikut terpotong kalau request difilter - // ?unit=) — dipakai khusus untuk badge di title accordion, BEDA dengan $totalPoinP2 di atas - // yang utuh satu orang (dipakai untuk rumus P2 Bruto/dsb). - $totalPoinP2Unit = (float) array_sum(array_map( - fn ($u) => ($u['poin']['p2'] ?? 0) + collect($u['adhoc_kegiatan'] ?? [])->sum('poin_p2'), - $units - )); $poinP2Kegiatan = (float) ($kegiatan['total_poin']['poin_p2']['kegiatan'] ?? 0); $p2TotalBruto = (float) ($kegiatan['p2']['total']['bruto'] ?? $monthBruto); + $nilaiPerPoin = $totalPoinP2 > 0 ? $p2TotalBruto / $totalPoinP2 : 0; - // Poin Adhoc (Tim Adhoc/Kepanitiaan Adhoc dosen) harus dikeluarkan dari pembagi nilai-per-poin, - // sama seperti yang sudah dilakukan di PerhitunganKegiatanService — Adhoc dihargai tarif tetap sendiri. - // Sekalian dijumlahkan bruto/ratio/tax/netto-nya di sini: scan ini jalan di atas koleksi kegiatan - // MENTAH ($kegiatan[...]), BUKAN $kegiatan['units'] — jadi nilainya SELALU utuh satu orang, - // tidak ikut terpotong walau request difilter per unit pembayaran (?unit=). - $adhocPoinP2ForNilaiPerPoin = 0.0; - $adhocBrutoWholePerson = 0.0; - $adhocRatioWholePerson = 0.0; - $adhocTaxWholePerson = 0.0; - $adhocNettoWholePerson = 0.0; - if ($isDosen) { - foreach ([ - 'penunjang_homebase', 'penunjang_luar_homebase_fakultas', 'penunjang_luar_homebase_universitas', - 'semester_antara_homebase', 'semester_antara_luar_homebase', - ] as $adhocScanType) { - foreach (collect($kegiatan[$adhocScanType] ?? []) as $adhocScanItem) { - if (in_array(data_get($adhocScanItem, 'id_rubrik'), [684, 685, 686, 687, 695, 696, 697], true)) { - $adhocPoinP2ForNilaiPerPoin += (float) data_get($adhocScanItem, 'poin_p2', 0); - $adhocBrutoWholePerson += (float) data_get($adhocScanItem, 'p2.bruto', 0); - $adhocRatioWholePerson += (float) data_get($adhocScanItem, 'p2.ratio', 0); - $adhocTaxWholePerson += (float) data_get($adhocScanItem, 'p2.tax', 0); - $adhocNettoWholePerson += (float) data_get($adhocScanItem, 'p2.netto', 0); - } - } + // Agregat kegiatan Adhoc (Tim/Kepanitiaan Adhoc dosen — tarif tetap Rp 660.000 ÷ 6, + // bukan proporsional nilai per poin). Selisih terhadap nilai proporsional inilah + // yang mengurangi P2 (Bruto) pada tab Detail P2. + $adhocItems = []; + foreach ($units as $u) { + foreach ($u['adhoc_kegiatan'] ?? [] as $ak) { + $adhocItems[] = $ak; } } - $totalPoinP2NonAdhoc = $totalPoinP2 - $adhocPoinP2ForNilaiPerPoin; - $totalPoinP2NonAdhoc = $totalPoinP2NonAdhoc > 0 ? $totalPoinP2NonAdhoc : 1; - $nilaiPerPoin = $p2TotalBruto / $totalPoinP2NonAdhoc; - // Total utuh satu orang (non-Adhoc dari PerhitunganP2Service + Adhoc dari scan di atas) — - // dipakai khusus untuk box formula "P2 (Bruto)/(Rasio)/(Pajak)/(Netto)" di tab Detail P2, - // supaya box itu SELALU konsisten dengan langkah-langkah rumus yang ditampilkan (yang juga - // utuh satu orang), walau halaman sedang difilter ke satu unit pembayaran tertentu. - $brutoWholePerson = $adhocBrutoWholePerson + (float) ($kegiatan['p2']['p2']['bruto']['total'] ?? 0); - $ratioWholePerson = $adhocRatioWholePerson + (float) ($kegiatan['p2']['p2']['ratio']['total'] ?? 0); - $taxWholePerson = $adhocTaxWholePerson + (float) ($kegiatan['p2']['p2']['tax']['total'] ?? 0); - $nettoWholePerson = $adhocNettoWholePerson + (float) ($kegiatan['p2']['p2']['net']['total'] ?? 0); + $adhocSummary = null; + if (! empty($adhocItems)) { + $adhocPoin = (float) array_sum(array_column($adhocItems, 'poin_p2')); + $adhocProporsional = (float) array_sum(array_column($adhocItems, 'bruto_proporsional')); + $adhocFixed = (float) array_sum(array_column($adhocItems, 'bruto_fixed')); - // Badge "Rasio: Rp ..." di judul accordion disamakan dengan angka yang ditampilkan di tab - // "P2 Per Unit": (Poin Unit / Total Poin P2 utuh satu orang) x P2 Bruto utuh satu orang, lalu - // dikali rasio unit tsb — BUKAN bruto riil unit ($u['p2']['bruto']) yang dihitung dari komponen - // Jabatan Fungsional/Tugas Tambahan/Adhoc miliknya sendiri. Kalau halaman difilter ke satu unit - // (?unit=), $units di sini sudah berisi satu unit itu saja, jadi otomatis jadi nilai unit tsb. - $rasioUnitDisplay = 0.0; - foreach ($units as $u) { - $uAdhocPoinForBadge = collect($u['adhoc_kegiatan'] ?? [])->sum('poin_p2'); - $uPoinForBadge = ($u['poin']['p2'] ?? 0) + $uAdhocPoinForBadge; - $uBrutoForBadge = $totalPoinP2 > 0 ? ($uPoinForBadge / $totalPoinP2) * $brutoWholePerson : 0; - $rasioUnitDisplay += $uBrutoForBadge * (float) ($u['rasio'] ?? 1); + $adhocSummary = [ + 'poin' => $adhocPoin, + 'nilai_per_poin_normal' => $nilaiPerPoin, + 'nilai_per_poin_adhoc' => $adhocPoin > 0 ? $adhocFixed / $adhocPoin : 0, + 'bruto_proporsional' => $adhocProporsional, + 'bruto_fixed' => $adhocFixed, + 'potongan' => $adhocProporsional - $adhocFixed, + 'items' => $adhocItems, + ]; } $rows = []; - $kegiatanSplit = [ - 'pengali660' => ['pt' => 0.0, 'pr' => 0.0, 'pp' => 0.0, 'br' => 0.0, 'items' => []], - 'pengaliBiasa' => ['pt' => 0.0, 'pr' => 0.0, 'pp' => 0.0, 'br' => 0.0, 'items' => []], - ]; - $tPoin = $totalPoinP2NonAdhoc; - // "P2 Bruto" yang dipakai untuk menghargai poin non-Adhoc (Grade/SKP/Presensi/Tri Dharma/dst) - // SUDAH TIDAK termasuk Adhoc (yang dihargai tarif tetap sendiri) — makanya labelnya dibedakan - // dari "Total P2 Bruto" ($sec['bruto']) yang sudah termasuk Adhoc. - $p2Label = $adhocPoinP2ForNilaiPerPoin > 0.001 ? '(P2 Bruto - P2 Adhoc)' : 'P2 Bruto'; - $p2AdhocAmount = max(0, $monthBruto - $p2TotalBruto); + $fmt2 = fn (float $v) => number_format($v, 2, ',', '.'); + $fmtRp = fn (float $v) => 'Rp. '.number_format($v, 2, ',', '.'); + $tPoin = $totalPoinP2 > 0 ? $totalPoinP2 : 1; // Grade 14-17 if ($isDosen && ($kegiatan['grade_14_17']['poin_remunerasi'] ?? 0) > 0) { $g = $kegiatan['grade_14_17']; $pp = (float) ($g['poin_p2'] ?? 0); - $br = (float) ($g['p2']['bruto'] ?? ($pp * $nilaiPerPoin)); + $br = $pp * $nilaiPerPoin; $row = $this->rowItem(1, 'Poin berdasarkan grade jabatan fungsional', (float) ($g['poin_remunerasi'] ?? 0), (float) ($g['poin_remunerasi'] ?? 0), $pp, $br, $g['cut_reason'] ?? null); - $row['formula'] = $this->buildNilaiPerPoinFormula( - 'Poin P2 Grade 14 s.d. 17', $pp, $tPoin, $p2Label, $p2TotalBruto, $monthBruto, $p2AdhocAmount, $br - ); + $row['formula'] = [ + '(Poin P2 Grade 14 s.d. 17 / Total Poin P2 Setelah Pemotongan) × P2', + '('.$fmt2($pp).' / '.$fmt2($tPoin).') × '.$fmtRp($p2TotalBruto), + $fmtRp($br), + ]; $rows[] = $this->rowCategory('Grade 14 – 17'); $rows[] = $row; $rows[] = $this->rowTotal('Total Grade 14 – 17', (float) ($g['poin_remunerasi'] ?? 0), (float) ($g['poin_remunerasi'] ?? 0), $pp, $br); - $this->accumulateKegiatanSplit($kegiatanSplit, $isDosen, null, (float) ($g['poin_remunerasi'] ?? 0), (float) ($g['poin_remunerasi'] ?? 0), $pp, $br, 'Poin berdasarkan grade jabatan fungsional'); } // SKP @@ -590,13 +537,15 @@ class RasioP2Controller extends Controller ? 'Jabatan Tugas Tambahan – '.$s['nama'] : 'Sasaran Kinerja Pegawai'; $pp = (float) ($s['poin_p2'] ?? 0); - $br = (float) ($s['p2']['bruto'] ?? ($pp * $nilaiPerPoin)); + $br = $pp * $nilaiPerPoin; $row = $this->rowItem(1, $skpNama, (float) ($s['poin_remunerasi'] ?? 0), (float) ($s['poin_remunerasi'] ?? 0), $pp, $br, $s['cut_reason'] ?? null); - $row['formula'] = $this->buildNilaiPerPoinFormula( - 'Poin P2 SKP', $pp, $tPoin, $p2Label, $p2TotalBruto, $monthBruto, $p2AdhocAmount, $br - ); + $row['formula'] = [ + '(Poin P2 SKP / Total Poin P2 Setelah Pemotongan) × P2', + '('.$fmt2($pp).' / '.$fmt2($tPoin).') × '.$fmtRp($p2TotalBruto), + $fmtRp($br), + ]; $rows[] = $this->rowCategory('SKP'); $rows[] = $row; $rows[] = $this->rowTotal('Total SKP', @@ -612,9 +561,11 @@ class RasioP2Controller extends Controller $row = $this->rowItem(1, 'Kehadiran / Presensi', (float) ($p['poin_remunerasi'] ?? 0), (float) ($p['poin_remunerasi'] ?? 0), $pp, $br, $p['cut_reason'] ?? null); - $row['formula'] = $this->buildNilaiPerPoinFormula( - 'Poin P2 Presensi', $pp, $tPoin, $p2Label, $p2TotalBruto, $monthBruto, $p2AdhocAmount, $br - ); + $row['formula'] = [ + '(Poin P2 Presensi / Total Poin P2 Setelah Pemotongan) × P2', + '('.$fmt2($pp).' / '.$fmt2($tPoin).') × '.$fmtRp($p2TotalBruto), + $fmtRp($br), + ]; $rows[] = $this->rowCategory('Presensi'); $rows[] = $row; $rows[] = $this->rowTotal('Total Presensi', @@ -623,32 +574,34 @@ class RasioP2Controller extends Controller } // Tri Dharma Luar Homebase - $this->buildJenjangRows($rows, $tlh['mengajar'] ?? [], 'Mengajar (Luar Homebase)', ['S1', 'S2', 'S3', 'MKWU'], '#0d47a1', $nilaiPerPoin, $isDosen, $kegiatanSplit); - $this->buildJenjangRows($rows, $tlh['membimbing'] ?? [], 'Membimbing (Luar Homebase)', ['Akademik', 'D3', 'PROFESI', 'S1', 'S2', 'S3'], '#0d47a1', $nilaiPerPoin, $isDosen, $kegiatanSplit); - $this->buildJenjangRows($rows, $tlh['menguji'] ?? [], 'Menguji (Luar Homebase)', ['D3', 'PROFESI', 'S1', 'S2', 'S3'], '#0d47a1', $nilaiPerPoin, $isDosen, $kegiatanSplit); + $this->buildJenjangRows($rows, $tlh['mengajar'] ?? [], 'Mengajar (Luar Homebase)', ['S1', 'S2', 'S3', 'MKWU'], '#0d47a1', $nilaiPerPoin); + $this->buildJenjangRows($rows, $tlh['membimbing'] ?? [], 'Membimbing (Luar Homebase)', ['Akademik', 'D3', 'PROFESI', 'S1', 'S2', 'S3'], '#0d47a1', $nilaiPerPoin); + $this->buildJenjangRows($rows, $tlh['menguji'] ?? [], 'Menguji (Luar Homebase)', ['D3', 'PROFESI', 'S1', 'S2', 'S3'], '#0d47a1', $nilaiPerPoin); $this->buildFlatCategoryRows($rows, $tlh, [ 'mengajarLainnya' => 'Mengajar Lainnya', 'membimbingLainnya' => 'Membimbing Lainnya', 'mengujiLainnya' => 'Menguji Lainnya', 'pengabdian' => 'Pengabdian', 'penelitian' => 'Penelitian', 'asesor' => 'Asesor', 'reviewer' => 'Reviewer', - ], 'Lainnya (Luar Homebase)', '#0d47a1', $nilaiPerPoin, $isDosen, $kegiatanSplit); + ], 'Lainnya (Luar Homebase)', '#0d47a1', $nilaiPerPoin); // Tri Dharma Homebase - $this->buildJenjangRows($rows, $thb['mengajar'] ?? [], 'Mengajar (Homebase)', ['S1', 'S2', 'S3', 'MKWU'], '#1565c0', $nilaiPerPoin, $isDosen, $kegiatanSplit); - $this->buildJenjangRows($rows, $thb['membimbing'] ?? [], 'Membimbing (Homebase)', ['Akademik', 'D3', 'PROFESI', 'S1', 'S2', 'S3'], '#1565c0', $nilaiPerPoin, $isDosen, $kegiatanSplit); - $this->buildJenjangRows($rows, $thb['menguji'] ?? [], 'Menguji (Homebase)', ['D3', 'PROFESI', 'S1', 'S2', 'S3'], '#1565c0', $nilaiPerPoin, $isDosen, $kegiatanSplit); + $this->buildJenjangRows($rows, $thb['mengajar'] ?? [], 'Mengajar (Homebase)', ['S1', 'S2', 'S3', 'MKWU'], '#1565c0', $nilaiPerPoin); + $this->buildJenjangRows($rows, $thb['membimbing'] ?? [], 'Membimbing (Homebase)', ['Akademik', 'D3', 'PROFESI', 'S1', 'S2', 'S3'], '#1565c0', $nilaiPerPoin); + $this->buildJenjangRows($rows, $thb['menguji'] ?? [], 'Menguji (Homebase)', ['D3', 'PROFESI', 'S1', 'S2', 'S3'], '#1565c0', $nilaiPerPoin); $this->buildFlatCategoryRows($rows, $thb, [ 'mengajarLainnya' => 'Mengajar Lainnya (Non-Siakad)', 'membimbingLainnya' => 'Membimbing Lainnya (Non-Siakad)', 'mengujiLainnya' => 'Menguji Lainnya (Non-Siakad)', 'pengabdian' => 'Pengabdian kepada Masyarakat', 'penelitian' => 'Penelitian', - ], 'Lainnya (Homebase)', '#1565c0', $nilaiPerPoin, $isDosen, $kegiatanSplit); - $this->buildBukuModulRows($rows, $thb, $nilaiPerPoin, $isDosen, $kegiatanSplit); + ], 'Lainnya (Homebase)', '#1565c0', $nilaiPerPoin); + $this->buildBukuModulRows($rows, $thb, $nilaiPerPoin); // Penunjang - $this->buildPenunjangRows($rows, collect($kegiatan['penunjang_luar_homebase_universitas'] ?? []), 'Penunjang (LHB – Universitas)', '#4a148c', $nilaiPerPoin, $isDosen, $kegiatanSplit); - $this->buildPenunjangRows($rows, collect($kegiatan['penunjang_luar_homebase_fakultas'] ?? []), 'Penunjang (LHB – Fakultas)', '#311b92', $nilaiPerPoin, $isDosen, $kegiatanSplit); - $this->buildPenunjangRows($rows, collect($kegiatan['penunjang_homebase'] ?? []), 'Penunjang (Homebase)', '#1a237e', $nilaiPerPoin, $isDosen, $kegiatanSplit); + $this->buildPenunjangRows($rows, collect($kegiatan['penunjang_luar_homebase_universitas'] ?? []), 'Penunjang (LHB – Universitas)', '#4a148c', $nilaiPerPoin); + $this->buildPenunjangRows($rows, collect($kegiatan['penunjang_luar_homebase_fakultas'] ?? []), 'Penunjang (LHB – Fakultas)', '#311b92', $nilaiPerPoin); + $this->buildPenunjangRows($rows, collect($kegiatan['penunjang_homebase'] ?? []), 'Penunjang (Homebase)', '#1a237e', $nilaiPerPoin); + + $kegiatanSplit = $this->computeKegiatanSplit($kegiatan, $isDosen, $nilaiPerPoin); // Semester Antara foreach (['semester_antara_homebase' => 'Semester Antara (HB)', 'semester_antara_luar_homebase' => 'Semester Antara (LHB)'] as $saKey => $saLabel) { @@ -667,7 +620,6 @@ class RasioP2Controller extends Controller $total[1] += $pr; $total[2] += $pp; $total[3] += $br; - $this->accumulateKegiatanSplit($kegiatanSplit, $isDosen, data_get($sa, 'id_rubrik'), $pt, $pr, $pp, $br, $sa->nama_kegiatan ?? '-'); } $rows[] = $this->rowTotal("Total $saLabel", ...$total); } @@ -690,10 +642,6 @@ class RasioP2Controller extends Controller 'netto' => $monthNetto, 'total_poin_remun' => $totalPoinRemun, 'total_poin_p2' => $totalPoinP2, - 'total_poin_p2_unit' => $totalPoinP2Unit, - // Dipakai KHUSUS untuk menghitung nilai-per-poin (poin Adhoc dikeluarkan karena - // Adhoc dihargai tarif tetap sendiri, bukan proporsional dari pool ini). - 'total_poin_p2_non_adhoc' => $totalPoinP2NonAdhoc, 'batas_maks' => $isDosen ? 68 : 54, 'potongan_p1' => round($totalPoinRemun - $totalPoinP2, 2), 'poin_components' => $poinComponents, @@ -702,12 +650,7 @@ class RasioP2Controller extends Controller 'rows' => $rows, 'is_dosen' => $isDosen, 'p2_formula' => $kegiatan['p2']['p2'] ?? null, - // Total utuh satu orang, tidak terpengaruh filter ?unit= (lihat komentar di atas). - 'bruto_whole_person' => $brutoWholePerson, - 'ratio_whole_person' => $ratioWholePerson, - 'tax_whole_person' => $taxWholePerson, - 'netto_whole_person' => $nettoWholePerson, - 'rasio_unit_display' => $rasioUnitDisplay, + 'adhoc' => $adhocSummary, ]; foreach ($units as $u) { @@ -740,37 +683,6 @@ class RasioP2Controller extends Controller return ['type' => 'sub', 'label' => $label, 'limit' => $limit]; } - /** - * Susun langkah formula "(Poin P2 X / Total Poin P2 Setelah Pemotongan) × P2 Bruto" untuk baris - * Grade/SKP/Presensi. Saat Adhoc ada, pembilang "P2 Bruto" dipecah eksplisit jadi (P2 Bruto - P2 Adhoc) - * dengan nilai aslinya, sebelum ditunjukkan hasil (P2 Bruto - P2 Adhoc) yang sudah dikurangi. - */ - private function buildNilaiPerPoinFormula(string $labelPoin, float $pp, float $tPoin, string $p2Label, float $p2TotalBruto, float $p2BrutoFull, float $p2AdhocAmount, float $br): array - { - $fmt2 = fn (float $v) => number_format($v, 2, ',', '.'); - $fmtRp = fn (float $v) => 'Rp. '.number_format($v, 2, ',', '.'); - $ratio = $tPoin > 0 ? $pp / $tPoin : 0; - - $steps = [ - "($labelPoin / Total Poin P2 Setelah Pemotongan) × $p2Label", - ]; - - if ($p2AdhocAmount > 0.001) { - $steps[] = '('.$fmt2($pp).' / '.$fmt2($tPoin).') × ('.$fmtRp($p2BrutoFull).' - '.$fmtRp($p2AdhocAmount).')'; - // Kalau rasionya "bersih" di 2 desimal (termasuk pas 0), tidak perlu tampilkan presisi panjang + titik-titik - $ratioText = abs($ratio - round($ratio, 2)) < 0.0000001 - ? $fmt2($ratio) - : number_format($ratio, 8, ',', '').'......'; - $steps[] = $ratioText.' × '.$fmtRp($p2TotalBruto); - } else { - $steps[] = '('.$fmt2($pp).' / '.$fmt2($tPoin).') × '.$fmtRp($p2TotalBruto); - } - - $steps[] = $fmtRp($br); - - return $steps; - } - private function rowItem(int $no, string $label, float $pt, float $pr, float $pp, float $br, ?string $cutReason = null): array { $cutZero = $pt > 0.001 && $pr < 0.001; @@ -805,7 +717,7 @@ class RasioP2Controller extends Controller ]; } - private function buildJenjangRows(array &$rows, array $data, string $catLabel, array $jenjangList, string $color = '#1565c0', float $nilaiPerPoin = 0.0, bool $isDosen = false, array &$split = []): void + private function buildJenjangRows(array &$rows, array $data, string $catLabel, array $jenjangList, string $color = '#1565c0', float $nilaiPerPoin = 0.0): void { $hasData = false; foreach ($jenjangList as $j) { @@ -838,7 +750,6 @@ class RasioP2Controller extends Controller $subTot[1] += $pr; $subTot[2] += $pp; $subTot[3] += $br; - $this->accumulateKegiatanSplit($split, $isDosen, data_get($keg, 'id_rubrik'), $pt, $pr, $pp, $br, $keg->nama_kegiatan ?? '-'); } $rows[] = $this->rowSubtotal("Subtotal $subLabel", ...$subTot); $catTot[0] += $subTot[0]; @@ -849,7 +760,7 @@ class RasioP2Controller extends Controller $rows[] = $this->rowTotal("Total $catLabel", ...$catTot); } - private function buildFlatCategoryRows(array &$rows, array $data, array $cats, string $catLabel, string $color = '#1565c0', float $nilaiPerPoin = 0.0, bool $isDosen = false, array &$split = []): void + private function buildFlatCategoryRows(array &$rows, array $data, array $cats, string $catLabel, string $color = '#1565c0', float $nilaiPerPoin = 0.0): void { $hasData = false; foreach (array_keys($cats) as $k) { @@ -884,7 +795,6 @@ class RasioP2Controller extends Controller $subTot[1] += $pr; $subTot[2] += $pp; $subTot[3] += $br; - $this->accumulateKegiatanSplit($split, $isDosen, data_get($keg, 'id_rubrik'), $pt, $pr, $pp, $br, $nama); } $rows[] = $this->rowSubtotal("Subtotal $subLabel", ...$subTot); $catTot[0] += $subTot[0]; @@ -895,7 +805,7 @@ class RasioP2Controller extends Controller $rows[] = $this->rowTotal("Total $catLabel", ...$catTot); } - private function buildBukuModulRows(array &$rows, array $thb, float $nilaiPerPoin = 0.0, bool $isDosen = false, array &$split = []): void + private function buildBukuModulRows(array &$rows, array $thb, float $nilaiPerPoin = 0.0): void { $allItems = collect($thb['buku_ajar'] ?? [])->merge(collect($thb['modul'] ?? [])); if ($allItems->isEmpty()) { @@ -914,12 +824,11 @@ class RasioP2Controller extends Controller $total[1] += $pr; $total[2] += $pp; $total[3] += $br; - $this->accumulateKegiatanSplit($split, $isDosen, data_get($keg, 'id_rubrik'), $pt, $pr, $pp, $br, $nama); } $rows[] = $this->rowTotal('Total Buku Ajar / Modul (HB)', ...$total); } - private function buildPenunjangRows(array &$rows, Collection $items, string $catLabel, string $color, float $nilaiPerPoin = 0.0, bool $isDosen = false, array &$split = []): void + private function buildPenunjangRows(array &$rows, Collection $items, string $catLabel, string $color, float $nilaiPerPoin = 0.0): void { if ($items->isEmpty()) { return; @@ -943,7 +852,6 @@ class RasioP2Controller extends Controller $subTot[1] += $pr; $subTot[2] += $pp; $subTot[3] += $br; - $this->accumulateKegiatanSplit($split, $isDosen, data_get($p, 'id_rubrik'), $pt, $pr, $pp, $br, $p->kegiatan?->nama_kegiatan ?? '-'); } $rows[] = $this->rowSubtotal("Subtotal $katNama", ...$subTot); $catTot[0] += $subTot[0]; @@ -954,31 +862,35 @@ class RasioP2Controller extends Controller $rows[] = $this->rowTotal("Total $catLabel", ...$catTot); } - /** - * Tambahkan poin & nominal satu item kegiatan ke bucket "Pengali 660" - * (Tim Adhoc/Kepanitiaan Adhoc dosen, tarif tetap Rp 660.000÷6) atau - * "Pengali Biasa" (proporsional terhadap harga jabatan/nilai per poin), - * tergantung id_rubrik kegiatan tersebut. - */ - private function accumulateKegiatanSplit(array &$split, bool $isDosen, mixed $idRubrik, float $pt, float $pr, float $pp, float $br, string $nama = '-'): void + private function computeKegiatanSplit(array $kegiatan, bool $isDosen, float $nilaiPerPoin): array { - if (empty($split)) { - return; + $adhocRubrikIds = [684, 685, 686, 687, 695, 696, 697]; + $pengali660 = ['pt' => 0.0, 'pr' => 0.0, 'pp' => 0.0, 'br' => 0.0]; + $pengaliBiasa = ['pt' => 0.0, 'pr' => 0.0, 'pp' => 0.0, 'br' => 0.0]; + + foreach (['penunjang_luar_homebase_universitas', 'penunjang_luar_homebase_fakultas', 'penunjang_homebase'] as $key) { + foreach (collect($kegiatan[$key] ?? []) as $p) { + [$pt, $pr, $pp, $br] = $this->extractPoin($p, $nilaiPerPoin); + $isAdhoc = $isDosen && in_array(data_get($p, 'id_rubrik'), $adhocRubrikIds, true); + + if ($isAdhoc) { + $pengali660['pt'] += $pt; + $pengali660['pr'] += $pr; + $pengali660['pp'] += $pp; + $pengali660['br'] += $br; + } else { + $pengaliBiasa['pt'] += $pt; + $pengaliBiasa['pr'] += $pr; + $pengaliBiasa['pp'] += $pp; + $pengaliBiasa['br'] += $br; + } + } } - $bucket = ($isDosen && in_array($idRubrik, self::ADHOC_RUBRIK_IDS, true)) ? 'pengali660' : 'pengaliBiasa'; - - $split[$bucket]['pt'] += $pt; - $split[$bucket]['pr'] += $pr; - $split[$bucket]['pp'] += $pp; - $split[$bucket]['br'] += $br; - - if ($pp > 0.001) { - $split[$bucket]['items'][] = ['nama' => $nama, 'pp' => $pp, 'br' => $br]; - } + return ['pengali660' => $pengali660, 'pengaliBiasa' => $pengaliBiasa]; } - public function detail(Request $request, $nip): View|RedirectResponse + public function detailNew(Request $request, $nip): View|RedirectResponse { $team = Team::find(session('team_id')); $unit = $request->unit ?? $team->unit_kerja_id ?? null; diff --git a/app/Services/PerhitunganKegiatanService.php b/app/Services/PerhitunganKegiatanService.php index ce9958d6..5d3b5f4a 100644 --- a/app/Services/PerhitunganKegiatanService.php +++ b/app/Services/PerhitunganKegiatanService.php @@ -1099,27 +1099,6 @@ class PerhitunganKegiatanService $totalPoin[$detail->bulan]['poin_p2']['skp'] += $kegiatans[$detail->bulan]['skp']['poin_p2']; /* End Pengurangan Poin */ - /* Begin Hitung Poin Adhoc (Tim Adhoc/Kepanitiaan Adhoc dosen) - * Adhoc selalu dihargai tarif tetap Rp 660.000÷6, terlepas dari harga jabatan pegawai. - * Poin-nya harus dikeluarkan dari pool Fungsional/Tugas Tambahan SEBELUM dihitung P2, - * supaya poin Adhoc tidak ikut "menumpang" & mengencerkan nilai per poin pegawai lain. */ - $adhocPoinRemunerasi = 0.0; - $adhocPoinP2 = 0.0; - if ($detail->jenis_pegawai === 'dosen') { - foreach ([ - 'penunjang_homebase', 'penunjang_luar_homebase_fakultas', 'penunjang_luar_homebase_universitas', - 'semester_antara_homebase', 'semester_antara_luar_homebase', - ] as $adhocScanType) { - foreach (collect($kegiatans[$detail->bulan][$adhocScanType] ?? []) as $adhocScanItem) { - if (in_array(data_get($adhocScanItem, 'id_rubrik'), [684, 685, 686, 687, 695, 696, 697], true)) { - $adhocPoinRemunerasi += (float) data_get($adhocScanItem, 'poin_remunerasi', 0); - $adhocPoinP2 += (float) data_get($adhocScanItem, 'poin_p2', 0); - } - } - } - } - /* End Hitung Poin Adhoc */ - /* Begin P2 */ if ($detail->jenis_pegawai === 'dosen') { $pembagi = 6; @@ -1136,7 +1115,7 @@ class PerhitunganKegiatanService ->first() ?->detail?->count() ?? 6; } - $kegiatans[$detail->bulan]['p2'] = $p2Service->dosen($detail, max(0, $totalPoin[$detail->bulan]['poin_remunerasi']['kegiatan'] - $adhocPoinRemunerasi), $totalPoin[$detail->bulan]['poin_remunerasi']['skp'], $totalPoin[$detail->bulan]['poin_remunerasi']['grade_14_17'], 1, $pembagi, $adhocPoinRemunerasi); + $kegiatans[$detail->bulan]['p2'] = $p2Service->dosen($detail, $totalPoin[$detail->bulan]['poin_remunerasi']['kegiatan'], $totalPoin[$detail->bulan]['poin_remunerasi']['skp'], $totalPoin[$detail->bulan]['poin_remunerasi']['grade_14_17'], 1, $pembagi); } else { $kegiatans[$detail->bulan]['p2'] = $p2Service->tendik($detail, $totalPoin[$detail->bulan]['poin_remunerasi']['kegiatan'], $totalPoin[$detail->bulan]['poin_remunerasi']['skp'], $totalPoin[$detail->bulan]['poin_remunerasi']['presensi'], 1); } @@ -1154,8 +1133,7 @@ class PerhitunganKegiatanService $rasio = 1; } - $pembagi = array_sum($kegiatans[$detail->bulan]['total_poin']['poin_p2']) - $adhocPoinP2; - $pembagi = $pembagi > 0 ? $pembagi : 1; + $pembagi = array_sum($kegiatans[$detail->bulan]['total_poin']['poin_p2']) > 0 ? array_sum($kegiatans[$detail->bulan]['total_poin']['poin_p2']) : 1; $kegiatans[$detail->bulan]['skp']['p2']['bruto'] = ($kegiatans[$detail->bulan]['skp']['poin_p2'] / $pembagi) * $kegiatans[$detail->bulan]['p2']['total']['bruto']; $kegiatans[$detail->bulan]['skp']['p2']['ratio'] = ($kegiatans[$detail->bulan]['skp']['poin_p2'] / $pembagi) * $kegiatans[$detail->bulan]['p2']['total']['ratio'] * $rasio; $kegiatans[$detail->bulan]['skp']['p2']['tax'] = ($kegiatans[$detail->bulan]['skp']['poin_p2'] / $pembagi) * $kegiatans[$detail->bulan]['p2']['total']['tax'] * $rasio; @@ -1174,10 +1152,6 @@ class PerhitunganKegiatanService 'tax' => $kegiatans[$detail->bulan]['skp']['p2']['tax'], 'netto' => $kegiatans[$detail->bulan]['skp']['p2']['netto'], ]; - $units[$unit]['items'] = []; - if (abs($kegiatans[$detail->bulan]['skp']['poin_p2']) > 0.0001) { - $units[$unit]['items'][] = ['nama' => 'Poin SKP', 'poin_p2' => $kegiatans[$detail->bulan]['skp']['poin_p2']]; - } $kegiatans[$detail->bulan]['presensi']['p2']['bruto'] = ($kegiatans[$detail->bulan]['presensi']['poin_p2'] / $pembagi) * $kegiatans[$detail->bulan]['p2']['total']['bruto']; $kegiatans[$detail->bulan]['presensi']['p2']['ratio'] = ($kegiatans[$detail->bulan]['presensi']['poin_p2'] / $pembagi) * $kegiatans[$detail->bulan]['p2']['total']['ratio'] * $rasio; @@ -1191,9 +1165,6 @@ class PerhitunganKegiatanService $units[$unit]['p2']['ratio'] += $kegiatans[$detail->bulan]['presensi']['p2']['ratio']; $units[$unit]['p2']['tax'] += $kegiatans[$detail->bulan]['presensi']['p2']['tax']; $units[$unit]['p2']['netto'] += $kegiatans[$detail->bulan]['presensi']['p2']['netto']; - if (abs($kegiatans[$detail->bulan]['presensi']['poin_p2']) > 0.0001) { - $units[$unit]['items'][] = ['nama' => 'Poin Presensi', 'poin_p2' => $kegiatans[$detail->bulan]['presensi']['poin_p2']]; - } $kegiatans[$detail->bulan]['grade_14_17']['p2']['bruto'] = ($kegiatans[$detail->bulan]['grade_14_17']['poin_p2'] / $pembagi) * $kegiatans[$detail->bulan]['p2']['total']['bruto']; $kegiatans[$detail->bulan]['grade_14_17']['p2']['ratio'] = ($kegiatans[$detail->bulan]['grade_14_17']['poin_p2'] / $pembagi) * $kegiatans[$detail->bulan]['p2']['total']['ratio'] * $rasio; @@ -1207,9 +1178,6 @@ class PerhitunganKegiatanService $units[$unit]['p2']['ratio'] += $kegiatans[$detail->bulan]['grade_14_17']['p2']['ratio']; $units[$unit]['p2']['tax'] += $kegiatans[$detail->bulan]['grade_14_17']['p2']['tax']; $units[$unit]['p2']['netto'] += $kegiatans[$detail->bulan]['grade_14_17']['p2']['netto']; - if (abs($kegiatans[$detail->bulan]['grade_14_17']['poin_p2']) > 0.0001) { - $units[$unit]['items'][] = ['nama' => 'Poin Grade 14 s.d. 17', 'poin_p2' => $kegiatans[$detail->bulan]['grade_14_17']['poin_p2']]; - } // Tri Dharma foreach (['tri_dharma_homebase', 'tri_dharma_luar_homebase'] as $type) { @@ -1284,12 +1252,6 @@ class PerhitunganKegiatanService $units[$unit]['p2']['ratio'] += $triDharma['p2']['ratio']; $units[$unit]['p2']['tax'] += $triDharma['p2']['tax']; $units[$unit]['p2']['netto'] += $triDharma['p2']['netto']; - if (abs($poinP2) > 0.0001) { - $units[$unit]['items'][] = [ - 'nama' => $triDharma['nama_kegiatan'] ?? ($triDharma['kegiatan']['nama_kegiatan'] ?? '-'), - 'poin_p2' => $poinP2, - ]; - } } } } @@ -1332,10 +1294,9 @@ class PerhitunganKegiatanService // Pastikan key poin_p2 ada, jika tidak set default 0 $poinP2Penunjang = $penunjang['poin_p2'] ?? 0; - $isAdhocRubrik = $detail->jenis_pegawai === 'dosen' && in_array($penunjang['id_rubrik'], [684, 685, 686, 687, 695, 696, 697]); // Aturan khusus untuk dosen dengan id_rubrik tertentu - if ($isAdhocRubrik) { + if ($detail->jenis_pegawai === 'dosen' && in_array($penunjang['id_rubrik'], [684, 685, 686, 687, 695, 696, 697])) { // Menggunakan harga jabatan tetap 660.000 untuk rubrik khusus $multiplier = $this->getStatusPnsMultiplier($detail->status_pns); @@ -1357,7 +1318,7 @@ class PerhitunganKegiatanService } // Hitung tax dan netto dengan aturan yang benar - if ($isAdhocRubrik) { + if ($detail->jenis_pegawai === 'dosen' && in_array($penunjang['id_rubrik'], [684, 685, 686, 687, 695, 696, 697])) { // Untuk rubrik khusus dengan harga tetap, hitung pajak dari ratio // Tentukan persentase pajak berdasarkan golongan $pajakPersen = 0; @@ -1382,26 +1343,12 @@ class PerhitunganKegiatanService ]; $units[$unit]['poin']['remunerasi'] += $penunjang['poin_remunerasi']; - // Poin Adhoc TIDAK ikut masuk ke pool 'poin.p2': pool ini dipakai untuk pemerataan - // proporsional harga jabatan (via $pembagi), sedangkan Adhoc dihargai tarif tetap - // sendiri (lihat 'adhoc_kegiatan' di bawah). Kalau ikut masuk, poin Adhoc akan - // terhitung dua kali saat rasio penyeimbang P1 total (di bawah) diterapkan. - if (! $isAdhocRubrik) { - $units[$unit]['poin']['p2'] += $poinP2Penunjang; - } + $units[$unit]['poin']['p2'] += $poinP2Penunjang; $units[$unit]['p2']['bruto'] += $penunjang['p2']['bruto']; $units[$unit]['p2']['ratio'] += $penunjang['p2']['ratio']; $units[$unit]['p2']['tax'] += $penunjang['p2']['tax']; $units[$unit]['p2']['netto'] += $penunjang['p2']['netto']; - - // Item Adhoc sudah masuk daftar 'adhoc_kegiatan' di atas, tidak perlu diduplikasi di 'items'. - if (! $isAdhocRubrik && abs($poinP2Penunjang) > 0.0001) { - $units[$unit]['items'][] = [ - 'nama' => $penunjang['kegiatan']['nama_kegiatan'] ?? ($penunjang['nama_kegiatan'] ?? '-'), - 'poin_p2' => $poinP2Penunjang, - ]; - } } } @@ -1454,14 +1401,7 @@ class PerhitunganKegiatanService // Apply proportional P1 deduction to each unit foreach ($units as &$unit) { $unit['poin']['p2'] = round($unit['poin']['p2'] * $p1DeductionRatio, 2); - if (isset($unit['items'])) { - foreach ($unit['items'] as &$item) { - $item['poin_p2'] = round($item['poin_p2'] * $p1DeductionRatio, 2); - } - unset($item); - } } - unset($unit); } } diff --git a/app/Services/PerhitunganP2Service.php b/app/Services/PerhitunganP2Service.php index d2e0f905..01de031f 100644 --- a/app/Services/PerhitunganP2Service.php +++ b/app/Services/PerhitunganP2Service.php @@ -9,7 +9,7 @@ use Throwable; class PerhitunganP2Service { - public function dosen(JabatanPegawaiDetail $jabatan, float $poinKegiatan, float $poinSkp, float $poinGrade_14_17, float $rasio, ?int $pembagi = 6, float $adhocPoinKegiatan = 0.0) + public function dosen(JabatanPegawaiDetail $jabatan, float $poinKegiatan, float $poinSkp, float $poinGrade_14_17, float $rasio, ?int $pembagi = 6) { try { $p2 = []; @@ -20,29 +20,18 @@ class PerhitunganP2Service $rasio = $rasio === null ? $jabatan->unit->rasio->rasio : $rasio; $p2Fungsional = $p2Tambahan = 0; - // Narasi "Pemotongan Poin" sengaja ditampilkan berbasis Total Poin PENUH (termasuk Adhoc) - // supaya sederhana & tidak menjelaskan pengurangan Adhoc di sini. $poin (dipakai untuk - // JTT/Fungsional & P2 Bruto) tetap dihitung dari $poinKegiatan yang SUDAH dikeluarkan - // poin Adhoc-nya — kedua angka boleh berbeda karena basisnya memang berbeda. - $poinKegiatanPenuh = $poinKegiatan + $adhocPoinKegiatan; - $poinDisplay = $poinKegiatanPenuh + $poinSkp + $poinGrade_14_17; - $p2['poin']['steps'][] = 'Total Poin + Poin SKP + Poin Grade 14 s.d. 17'; - $p2['poin']['steps'][] = $fmt($poinKegiatanPenuh).' + '.$fmt($poinSkp).' + '.$fmt($poinGrade_14_17); - $p2['poin']['steps'][] = $fmt($poinDisplay); - $p2['poin']['steps'][] = $fmt($poinDisplay).' > 68 ? 68 : '.$fmt($poinDisplay); - $poinDisplay = $poinDisplay > 68 ? 68 : $poinDisplay; - $p2['poin']['steps'][] = $fmt($poinDisplay).' - Poin P1'; - $p2['poin']['steps'][] = $fmt($poinDisplay).' - 12'; - $poinDisplay -= 12; - $poinDisplay = round($poinDisplay, 2); - $poinDisplay = $poinDisplay < 0 ? 0 : $poinDisplay; - $p2['poin']['steps'][] = $fmt($poinDisplay); - + $p2['poin']['steps'][] = $fmt($poinKegiatan).' + '.$fmt($poinSkp).' + '.$fmt($poinGrade_14_17); + $p2['poin']['steps'][] = $fmt($poin); + $p2['poin']['steps'][] = $fmt($poin).' > 68 ? 68 : '.$fmt($poin); $poin = $poin > 68 ? 68 : $poin; + $p2['poin']['steps'][] = $fmt($poin).' - Poin P1'; + $p2['poin']['steps'][] = $fmt($poin).' - 12'; $poin -= 12; $poin = round($poin, 2); $poin = $poin < 0 ? 0 : $poin; + + $p2['poin']['steps'][] = $fmt($poin); $p2['poin']['total'] = round($poin, 2); if ($jabatan->jabatan_tambahan_id && $jabatan->p2_jtt == 1) { @@ -54,8 +43,6 @@ class PerhitunganP2Service $p2['tambahan']['steps'][] = $fmt($poinSkp).' + '.$fmt(28 - $poinSkp); $p2['tambahan']['steps'][] = $fmt($poinSkp + (28 - $poinSkp)); $p2['tambahan']['poin'] = 28; - $p2['tambahan']['poin_skp'] = $poinSkp; - $p2['tambahan']['poin_tridharma'] = 28 - $poinSkp; } else { $p2['tambahan']['steps'][] = $fmt($poin); $p2['tambahan']['poin'] = $poin; @@ -76,26 +63,12 @@ class PerhitunganP2Service $p2['fungsional']['grade'] = $jabatan?->fungsional?->detail?->grade; $p2['fungsional']['harga'] = $jabatan?->fungsional?->detail?->harga; if ($jabatan->jabatan_tambahan_id && $jabatan->p2_jtt == 1) { - if ($adhocPoinKegiatan > 0.001) { - $p2['fungsional']['steps'][] = 'Total Poin P2 - Poin Kegiatan Adhoc'; - $p2['fungsional']['steps'][] = $fmt($p2['poin']['total'] + $adhocPoinKegiatan).' - '.$fmt($adhocPoinKegiatan); - $p2['fungsional']['steps'][] = $fmt($p2['poin']['total']); - $p2['fungsional']['steps'][] = 'Poin P2 - Poin Jabatan Tugas Tambahan'; - } else { - $p2['fungsional']['steps'][] = 'Total Poin P2 - Poin Jabatan Tugas Tambahan'; - } + $p2['fungsional']['steps'][] = 'Total Poin P2 - Poin Jabatan Tugas Tambahan'; $p2['fungsional']['steps'][] = $fmt($p2['poin']['total']).' - '.$fmt($p2['tambahan']['poin']); $p2['fungsional']['steps'][] = $fmt($p2['poin']['total'] - $p2['tambahan']['poin']); $p2['fungsional']['poin'] = $p2['poin']['total'] - $p2['tambahan']['poin']; } else { - if ($adhocPoinKegiatan > 0.001) { - $p2['fungsional']['steps'][] = 'Total Poin P2 - Poin Kegiatan Adhoc'; - $p2['fungsional']['steps'][] = $fmt($poin + $adhocPoinKegiatan).' - '.$fmt($adhocPoinKegiatan); - $p2['fungsional']['steps'][] = $fmt($poin); - $p2['fungsional']['steps'][] = 'Poin P2 - Poin P1'; - } else { - $p2['fungsional']['steps'][] = 'Total Poin - Poin P1'; - } + $p2['fungsional']['steps'][] = 'Total Poin - Poin P1'; $p2['fungsional']['steps'][] = $fmt($poin + 12).' - 12'; $p2['fungsional']['steps'][] = $fmt($poin); $p2['fungsional']['poin'] = $poin; @@ -209,8 +182,8 @@ class PerhitunganP2Service $p2['harga'] = $pengali?->detail?->harga; // Start Bruto Income - $pengaliPns = $this->getPengaliPns($jabatan?->status_pns); $p2['bruto']['steps'][] = 'Jumlah bulan Menjabat / Total Bulan Menjabat x Total Poin x '.$p2['jabatan'].' x '.strtoupper($jabatan?->status_pns ?? 'pns'); + $pengaliPns = $this->getPengaliPns($jabatan?->status_pns); $p2['bruto']['steps'][] = "1 / $pembagi x ".$fmt($poin).' x '.$pengali?->detail?->harga.' x '.$pengaliPns; $p2['bruto']['total'] = $poin * $pengali?->detail?->harga / $pembagi * $pengaliPns; $p2['bruto']['steps'][] = 'Rp. '.number_format($p2['bruto']['total'], 2, ',', '.'); diff --git a/resources/views/perhitungan/pleno-penunjang/rasio-p2/detail-new.blade.php b/resources/views/perhitungan/pleno-penunjang/rasio-p2/detail-new.blade.php index 44dbf263..01f0cf08 100644 --- a/resources/views/perhitungan/pleno-penunjang/rasio-p2/detail-new.blade.php +++ b/resources/views/perhitungan/pleno-penunjang/rasio-p2/detail-new.blade.php @@ -2,840 +2,891 @@ @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 }}
+ +
+
+
+
+
Total P2
+
+
+

Rp. + {{ number_format(collect($kegiatans)->pluck('units')->flatten(1)->pluck('p2')->sum('bruto'), 2, ',', '.') }} +

+
+
+
+
+
+
+
P2 Setelah Rasio
+
+
+

Rp. + {{ number_format(collect($kegiatans)->pluck('units')->flatten(1)->pluck('p2')->sum('ratio'), 2, ',', '.') }} +

+
+
+
+
+
+
+
Pajak
+
+
+

Rp. + {{ number_format(collect($kegiatans)->pluck('units')->flatten(1)->pluck('p2')->sum('tax'), 2, ',', '.') }} +

+
+
+
+
+
+
+
P2 Setelah Pajak
+
+
+

Rp. + {{ number_format(collect($kegiatans)->pluck('units')->flatten(1)->pluck('p2')->sum('netto'), 2, ',', '.') }} +

+
- {{-- ── 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 -
+ +
+
+
+
+
+ @foreach ($kegiatans as $month => $kegiatan) +
+

+ +

+
+
+ - {{-- ── Month Accordion ── --}} -
- @foreach ($monthSections as $month => $sec) -
-

- -

-
-
- {{-- Nav Tabs --}} - +
+ +
+
+ @if ($kegiatan['jenis_pegawai'] === 'dosen' && $kegiatan['grade_14_17']['poin_remunerasi'] > 0) +
+

+ +

+
+
+
+
+
Poin
+
    +
  • • Poin Remunerasi: + {{ $kegiatan['grade_14_17']['poin_remunerasi'] }} +
  • +
  • • Poin P2: + {{ $kegiatan['grade_14_17']['poin_p2'] }} +
  • +
+
+
+
P2
+
    +
  • • (Poin P2 Grade 14 s.d. 17 / Total Poin + P2 Setelah Pemotongan) × P2
  • +
  • • + ({{ $kegiatan['grade_14_17']['poin_p2'] }} + / + {{ $kegiatan['p2']['p2']['poin']['total'] ?? array_sum($kegiatan['total_poin']['poin_p2']) }}) + × + {{ number_format($kegiatan['p2']['total']['bruto'], 2, ',', '.') }} +
  • +
  • • + {{ number_format($kegiatan['grade_14_17']['p2']['bruto'], 2, ',', '.') }} +
  • +
+
+
+
+
+
+ @endif -
+ @if ( + $kegiatan['jenis_pegawai'] === 'tendik' || + ($kegiatan['jenis_pegawai'] === 'dosen' && $kegiatan['skp']['poin_remunerasi'] > 0)) +
+

+ +

+
+
+
+
+
Poin
+
    + @if ($kegiatan['jenis_pegawai'] === 'dosen') +
  • • Jabatan Tugas Tambahan: + {{ $kegiatan['skp']['nama'] }}
  • + @endif +
  • • Poin Remunerasi: + {{ $kegiatan['skp']['poin_remunerasi'] }} +
  • +
  • • Poin P2: + {{ $kegiatan['skp']['poin_p2'] }}
  • +
+
+
+
P2
+
    +
  • • (Poin P2 SKP / Total Poin P2 Setelah Pemotongan) × P2 +
  • +
  • • + ({{ $kegiatan['skp']['poin_p2'] }} / + {{ $kegiatan['p2']['p2']['poin']['total'] ?? array_sum($kegiatan['total_poin']['poin_p2']) }}) + × + {{ number_format($kegiatan['p2']['total']['bruto'], 2, ',', '.') }} +
  • +
  • • + {{ number_format($kegiatan['skp']['p2']['bruto'], 2, ',', '.') }} +
  • +
+
+
+
+
+
+ @endif - {{-- 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 - - - - + @if ($kegiatan['jenis_pegawai'] === 'tendik') +
+

+ +

+
+
+
+
+
Poin
+
    +
  • • Poin Remunerasi: + {{ $kegiatan['presensi']['poin_remunerasi'] }} +
  • +
  • • Poin P2: + {{ $kegiatan['presensi']['poin_p2'] }} +
  • +
+
+
+
P2
+
    +
  • • (Poin P2 Presensi / Total Poin P2 Setelah Pemotongan) × + P2
  • +
  • • + ({{ $kegiatan['presensi']['poin_p2'] }} + / + {{ $kegiatan['p2']['p2']['poin']['total'] ?? array_sum($kegiatan['total_poin']['poin_p2']) }}) + × + {{ number_format($kegiatan['p2']['total']['bruto'], 2, ',', '.') }} +
  • +
  • • + {{ number_format($kegiatan['presensi']['p2']['bruto'], 2, ',', '.') }} +
  • +
+
+
+
+
+
+ @endif - @elseif ($row['type'] === 'sub') - - - - - @elseif ($row['type'] === 'item') - - - - - - - - - - @elseif ($row['type'] === 'stot') - - - - - - - - - @elseif ($row['type'] === 'tot') - - - - - - - - @endif - @endforeach - @if ($catOpen) @endif -
#KegiatanPoin TotalPoin RemunPoin P2Nominal (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 }}
+ @foreach (['tri_dharma_homebase', 'tri_dharma_luar_homebase'] as $type) + @continue(collect($kegiatan[$type])->flatten()->count() === 0) +
+

+ +

+
+
+ @if (in_array($type, ['tri_dharma_homebase', 'tri_dharma_luar_homebase'])) + +
+
+
Kategori
+
+ +
+
+
+
Belum ada Pilihan Kategori
+
+ +
+
+
@else -
• {{ $fStep }}
+ + @endif - @endforeach +
+ @foreach ($kegiatan[$type] as $kategori => $triDharmas) +
+ @if (in_array($kategori, ['mengajar', 'membimbing', 'menguji'])) + +
+ @foreach ($triDharmas as $jenjang => $triDharma) + + @endforeach +
+ @else +
+ + + + + + + + + + + + + + + @foreach ($triDharmas as $triDharma) + @php + $isZeroP2 = ($triDharma['poin_p2'] ?? 0) == 0 && ($triDharma['poin_total'] ?? 0) > 0; + $isGrouped645 = isset($triDharma->id_rubrik) && $triDharma->id_rubrik == 645; + $subCollapseId = 'sub645-' . $type . '-' . $month . '-' . $kategori . '-' . $loop->index; + @endphp + + + @if ($kategori === 'buku_ajar') + + + + + @elseif($kategori === 'modul' && $periode >= 392) + + + + + @else + + + + + @endif + + + + + @if($isGrouped645) + + + + @endif + @endforeach + +
NoUnitNama KegiatanPoin KegiatanRasioBatas Poin RemunerasiPoin P2P2
+ {{ $loop->iteration }} + @if($isGrouped645) + + @endif + {{ $triDharma['unit'] ?? '-' }}Membuat Buku Ajar {{ $triDharma['judul'] ?? '-' }}{{ $triDharma['poin_total'] ?? 0 }}100%{{ $triDharma['kegiatan']['nama_unit_kerja_pimpinan'] ?? '-' }}Membuat Modul Pembelajaran {{ $triDharma['judul'] ?? '-' }}{{ $triDharma['poin_total'] ?? 0 }}100%{{ $triDharma?->kegiatan?->unitPembayaran?->nama ?? '-' }} + + {{ $triDharma?->kegiatan?->nama_kegiatan ?? '-' }} + + {{ number_format($triDharma['poin_total'] ?? 0, 2, ',', '.') }}{{ ($triDharma['rasio'] ?? 0) * 100 }}%{{ number_format($triDharma['poin_remunerasi'] ?? 0, 2, ',', '.') }}{{ number_format($triDharma['poin_p2'] ?? 0, 2, ',', '.') }}Rp. {{ number_format($triDharma['p2']['bruto'] ?? 0, 2, ',', '.') }}
+
+
+

+ Total Poin Merging +

+ + + + + + + + + @foreach ($triDharma->sub_items ?? [] as $subItem) + + + + + @endforeach + + + + + + + +
NoPoin Kegiatan
{{ $loop->iteration }}{{ $subItem->poin_total }}
Total{{ $triDharma->poin_total }}
+
+
+
+
+ @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, ',', '.') }}
  • -
+ @endforeach + + @foreach (['penunjang_homebase', 'penunjang_luar_homebase_fakultas', 'penunjang_luar_homebase_universitas', 'semester_antara_homebase', 'semester_antara_luar_homebase'] as $type) + @continue(count($kegiatan[$type]) === 0) +
+

+ +

+
+
+
+ + + + + + + + + @if (!str_contains($type, 'semester_antara')) + + + @endif + + + + + + + + @foreach ($kegiatan[$type] as $penunjang) + + + @if (str_contains($type, 'semester_antara')) + + + + @else + + + + + + @endif + + + + + @endforeach + +
NoUnitNama KegiatanPoin KegiatanRasioPoin Setelah RasioBatas Poin RemunerasiPoin P2P2 (Bruto)
{{ $loop->iteration }}{{ $penunjang->unit?->nama ?? '-' }} + + {{ $penunjang->nama_kegiatan ?? '-' }} + + {{ $penunjang->poin_total ?? 0 }}{{ $penunjang->kegiatan?->unitPembayaran?->nama ?? '-' }} + + {{ $penunjang->kegiatan?->nama_kegiatan ?? '-' }} + @if (function_exists('uraian')) + - {{ uraian($penunjang->id_rubrik) }} + @endif + + {{ number_format($penunjang->poin_total ?? 0, 2, ',', '.') }}{{ ($penunjang->rasio ?? 0) * 100 }}%{{ number_format($penunjang->poin ?? 0, 2, ',', '.') }}{{ number_format($penunjang->poin_remunerasi ?? 0, 2, ',', '.') }}{{ number_format($penunjang->poin_p2 ?? 0, 2, ',', '.') }}Rp. {{ number_format($penunjang->p2['bruto'] ?? 0, 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 + @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, ',', '.') }} -
-
+ +
+ @if ($kegiatan['jenis_pegawai'] === 'dosen') + @include('perhitungan.pleno-penunjang.rasio-p2.detail-p2.dosen') + @elseif($kegiatan['jenis_pegawai'] === 'tendik') + @include('perhitungan.pleno-penunjang.rasio-p2.detail-p2.tendik') @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) }}
  • -
-
-
-
-
- - {{-- /tab P2 Per Unit --}} - -
{{-- /tab-content --}} -
-
-
- @endforeach -
- - {{-- ── Grand Total ── --}} -
-
- Total Keseluruhan P2 Per Unit (Seluruh Periode) -
-
-
- - - - - - - - - - - - - @foreach ($grandUnits as $uid => $gu) - - - - - - - - + @endforeach - - - - - - - - - - -
Unit KerjaRasioP2 BrutoSetelah RasioPajakP2 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 UNITRp {{ 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') + - $('[data-bs-toggle="tooltip"]').each(function () { - new bootstrap.Tooltip(this); - }); + @endsection diff --git a/resources/views/perhitungan/pleno-penunjang/rasio-p2/detail.blade.php b/resources/views/perhitungan/pleno-penunjang/rasio-p2/detail.blade.php index 01f0cf08..aed50695 100644 --- a/resources/views/perhitungan/pleno-penunjang/rasio-p2/detail.blade.php +++ b/resources/views/perhitungan/pleno-penunjang/rasio-p2/detail.blade.php @@ -2,891 +2,704 @@ @section('css') @endsection @section('breadcrumb') @endsection @section('content') - -
-
-
-
-
Total P2
-
-
-

Rp. - {{ number_format(collect($kegiatans)->pluck('units')->flatten(1)->pluck('p2')->sum('bruto'), 2, ',', '.') }} -

-
-
-
-
-
-
-
P2 Setelah Rasio
-
-
-

Rp. - {{ number_format(collect($kegiatans)->pluck('units')->flatten(1)->pluck('p2')->sum('ratio'), 2, ',', '.') }} -

-
-
-
-
-
-
-
Pajak
-
-
-

Rp. - {{ number_format(collect($kegiatans)->pluck('units')->flatten(1)->pluck('p2')->sum('tax'), 2, ',', '.') }} -

-
-
-
-
-
-
-
P2 Setelah Pajak
-
-
-

Rp. - {{ number_format(collect($kegiatans)->pluck('units')->flatten(1)->pluck('p2')->sum('netto'), 2, ',', '.') }} -

-
+ + {{-- ── Pegawai Info ── --}} +
+
+
+
+
{{ $pegawai->nama }}
+
NIP: {{ $pegawai->nip }}  |  {{ ucwords($pegawai->jenis_pegawai) }}  |  {{ $pegawai->unit_kerja_nama }}  |  Periode {{ $periode }}
- -
-
-
-
-
- @foreach ($kegiatans as $month => $kegiatan) -
-

- -

-
-
- - -
- -
-
- @if ($kegiatan['jenis_pegawai'] === 'dosen' && $kegiatan['grade_14_17']['poin_remunerasi'] > 0) -
-

- -

-
-
-
-
-
Poin
-
    -
  • • Poin Remunerasi: - {{ $kegiatan['grade_14_17']['poin_remunerasi'] }} -
  • -
  • • Poin P2: - {{ $kegiatan['grade_14_17']['poin_p2'] }} -
  • -
-
-
-
P2
-
    -
  • • (Poin P2 Grade 14 s.d. 17 / Total Poin - P2 Setelah Pemotongan) × P2
  • -
  • • - ({{ $kegiatan['grade_14_17']['poin_p2'] }} - / - {{ $kegiatan['p2']['p2']['poin']['total'] ?? array_sum($kegiatan['total_poin']['poin_p2']) }}) - × - {{ number_format($kegiatan['p2']['total']['bruto'], 2, ',', '.') }} -
  • -
  • • - {{ number_format($kegiatan['grade_14_17']['p2']['bruto'], 2, ',', '.') }} -
  • -
-
-
-
-
-
- @endif - - @if ( - $kegiatan['jenis_pegawai'] === 'tendik' || - ($kegiatan['jenis_pegawai'] === 'dosen' && $kegiatan['skp']['poin_remunerasi'] > 0)) -
-

- -

-
-
-
-
-
Poin
-
    - @if ($kegiatan['jenis_pegawai'] === 'dosen') -
  • • Jabatan Tugas Tambahan: - {{ $kegiatan['skp']['nama'] }}
  • - @endif -
  • • Poin Remunerasi: - {{ $kegiatan['skp']['poin_remunerasi'] }} -
  • -
  • • Poin P2: - {{ $kegiatan['skp']['poin_p2'] }}
  • -
-
-
-
P2
-
    -
  • • (Poin P2 SKP / Total Poin P2 Setelah Pemotongan) × P2 -
  • -
  • • - ({{ $kegiatan['skp']['poin_p2'] }} / - {{ $kegiatan['p2']['p2']['poin']['total'] ?? array_sum($kegiatan['total_poin']['poin_p2']) }}) - × - {{ number_format($kegiatan['p2']['total']['bruto'], 2, ',', '.') }} -
  • -
  • • - {{ number_format($kegiatan['skp']['p2']['bruto'], 2, ',', '.') }} -
  • -
-
-
-
-
-
- @endif - - @if ($kegiatan['jenis_pegawai'] === 'tendik') -
-

- -

-
-
-
-
-
Poin
-
    -
  • • Poin Remunerasi: - {{ $kegiatan['presensi']['poin_remunerasi'] }} -
  • -
  • • Poin P2: - {{ $kegiatan['presensi']['poin_p2'] }} -
  • -
-
-
-
P2
-
    -
  • • (Poin P2 Presensi / Total Poin P2 Setelah Pemotongan) × - P2
  • -
  • • - ({{ $kegiatan['presensi']['poin_p2'] }} - / - {{ $kegiatan['p2']['p2']['poin']['total'] ?? array_sum($kegiatan['total_poin']['poin_p2']) }}) - × - {{ number_format($kegiatan['p2']['total']['bruto'], 2, ',', '.') }} -
  • -
  • • - {{ number_format($kegiatan['presensi']['p2']['bruto'], 2, ',', '.') }} -
  • -
-
-
-
-
-
- @endif - - @foreach (['tri_dharma_homebase', 'tri_dharma_luar_homebase'] as $type) - @continue(collect($kegiatan[$type])->flatten()->count() === 0) -
-

- -

-
-
- @if (in_array($type, ['tri_dharma_homebase', 'tri_dharma_luar_homebase'])) - -
-
-
Kategori
-
- -
-
-
-
Belum ada Pilihan Kategori
-
- -
-
-
- @else - - - @endif -
- @foreach ($kegiatan[$type] as $kategori => $triDharmas) -
- @if (in_array($kategori, ['mengajar', 'membimbing', 'menguji'])) - -
- @foreach ($triDharmas as $jenjang => $triDharma) - - @endforeach -
- @else -
- - - - - - - - - - - - - - - @foreach ($triDharmas as $triDharma) - @php - $isZeroP2 = ($triDharma['poin_p2'] ?? 0) == 0 && ($triDharma['poin_total'] ?? 0) > 0; - $isGrouped645 = isset($triDharma->id_rubrik) && $triDharma->id_rubrik == 645; - $subCollapseId = 'sub645-' . $type . '-' . $month . '-' . $kategori . '-' . $loop->index; - @endphp - - - @if ($kategori === 'buku_ajar') - - - - - @elseif($kategori === 'modul' && $periode >= 392) - - - - - @else - - - - - @endif - - - - - @if($isGrouped645) - - - - @endif - @endforeach - -
NoUnitNama KegiatanPoin KegiatanRasioBatas Poin RemunerasiPoin P2P2
- {{ $loop->iteration }} - @if($isGrouped645) - - @endif - {{ $triDharma['unit'] ?? '-' }}Membuat Buku Ajar {{ $triDharma['judul'] ?? '-' }}{{ $triDharma['poin_total'] ?? 0 }}100%{{ $triDharma['kegiatan']['nama_unit_kerja_pimpinan'] ?? '-' }}Membuat Modul Pembelajaran {{ $triDharma['judul'] ?? '-' }}{{ $triDharma['poin_total'] ?? 0 }}100%{{ $triDharma?->kegiatan?->unitPembayaran?->nama ?? '-' }} - - {{ $triDharma?->kegiatan?->nama_kegiatan ?? '-' }} - - {{ number_format($triDharma['poin_total'] ?? 0, 2, ',', '.') }}{{ ($triDharma['rasio'] ?? 0) * 100 }}%{{ number_format($triDharma['poin_remunerasi'] ?? 0, 2, ',', '.') }}{{ number_format($triDharma['poin_p2'] ?? 0, 2, ',', '.') }}Rp. {{ number_format($triDharma['p2']['bruto'] ?? 0, 2, ',', '.') }}
-
-
-

- Total Poin Merging -

- - - - - - - - - @foreach ($triDharma->sub_items ?? [] as $subItem) - - - - - @endforeach - - - - - - - -
NoPoin Kegiatan
{{ $loop->iteration }}{{ $subItem->poin_total }}
Total{{ $triDharma->poin_total }}
-
-
-
-
- @endif -
- @endforeach -
-
-
-
- @endforeach - - @foreach (['penunjang_homebase', 'penunjang_luar_homebase_fakultas', 'penunjang_luar_homebase_universitas', 'semester_antara_homebase', 'semester_antara_luar_homebase'] as $type) - @continue(count($kegiatan[$type]) === 0) -
-

- -

-
-
-
- - - - - - - - - @if (!str_contains($type, 'semester_antara')) - - - @endif - - - - - - - - @foreach ($kegiatan[$type] as $penunjang) - - - @if (str_contains($type, 'semester_antara')) - - - - @else - - - - - - @endif - - - - - @endforeach - -
NoUnitNama KegiatanPoin KegiatanRasioPoin Setelah RasioBatas Poin RemunerasiPoin P2P2 (Bruto)
{{ $loop->iteration }}{{ $penunjang->unit?->nama ?? '-' }} - - {{ $penunjang->nama_kegiatan ?? '-' }} - - {{ $penunjang->poin_total ?? 0 }}{{ $penunjang->kegiatan?->unitPembayaran?->nama ?? '-' }} - - {{ $penunjang->kegiatan?->nama_kegiatan ?? '-' }} - @if (function_exists('uraian')) - - {{ uraian($penunjang->id_rubrik) }} - @endif - - {{ number_format($penunjang->poin_total ?? 0, 2, ',', '.') }}{{ ($penunjang->rasio ?? 0) * 100 }}%{{ number_format($penunjang->poin ?? 0, 2, ',', '.') }}{{ number_format($penunjang->poin_remunerasi ?? 0, 2, ',', '.') }}{{ number_format($penunjang->poin_p2 ?? 0, 2, ',', '.') }}Rp. {{ number_format($penunjang->p2['bruto'] ?? 0, 2, ',', '.') }}
-
-
-
-
- @endforeach -
-
- - -
- @if ($kegiatan['jenis_pegawai'] === 'dosen') - @include('perhitungan.pleno-penunjang.rasio-p2.detail-p2.dosen') - @elseif($kegiatan['jenis_pegawai'] === 'tendik') - @include('perhitungan.pleno-penunjang.rasio-p2.detail-p2.tendik') - @endif -
- - -
-
- @foreach ($kegiatan['units'] as $unit) - @if(is_array($unit) && isset($unit['nama'])) -
-
-
-
{{ $unit['nama'] }}
-
-
-
    -
  • • (Total Poin {{ $unit['nama'] }} / Total - Poin Setelah Pemotongan) × P2 × Rasio
  • -
  • • - ({{ number_format($unit['poin']['p2'], 2, ',', '.') }} / - {{ number_format($kegiatan['p2']['p2']['poin']['total'] ?? array_sum($kegiatan['total_poin']['poin_p2']), 2, ',', '.') }}) - × - {{ number_format($kegiatan['p2']['total']['bruto'], 2, ',', '.') }} - × {{ number_format($unit['rasio'] * 100, 2, ',', '.') }}%
  • -
  • • - Rp. {{ number_format($unit['p2']['ratio'], 2, ',', '.') }} -
  • -
-
-
-
- @endif - @endforeach -
-
-
-
-
-
- @endforeach + {{-- ── 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('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 +
#KegiatanPoin TotalPoin RemunPoin P2Nominal (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']; + $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; + if ($hasAdhocInMonth) { + 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) +
  • 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 Fungsional --}} + @if (!empty($p2f['fungsional'])) +
+
Jabatan Fungsional
+
+ Jabatan: {{ $p2f['fungsional']['jabatan'] ?? '-' }}
+ Grade: {{ $p2f['fungsional']['grade'] ?? '-' }}
+ Harga Jabatan: {{ number_format($p2f['fungsional']['harga'] ?? 0, 2, ',', '.') }} +
+
    + @foreach ($p2f['fungsional']['steps'] as $step) +
  • last) class="formula-result" @endif>{{ $step }}
  • + @endforeach +
+
+ @endif + + {{-- Jabatan Tugas Tambahan --}} + @if (!empty($p2f['tambahan'])) +
+
Jabatan Tugas Tambahan
+
+ Jabatan: {{ $p2f['tambahan']['jabatan'] ?? '-' }}
+ Grade: {{ $p2f['tambahan']['grade'] ?? '-' }}
+ Harga Jabatan: {{ number_format($p2f['tambahan']['harga'] ?? 0, 2, ',', '.') }} +
+
    + @foreach ($p2f['tambahan']['steps'] as $step) +
  • last) class="formula-result" @endif>{{ $step }}
  • + @endforeach +
+
+ @endif + + {{-- Adhoc --}} + @if ($hasAdhocDetail) + @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 + @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 --}} +
+
+
+ @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 KerjaRasioP2 BrutoSetelah RasioPajakP2 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 UNITRp {{ 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') - + @if (request()->routeIs('remunerasi.p2.*')) + $('.si-remunerasi').addClass('menuitem-active'); + $('.ni-remunerasi').addClass('badge-primary-lighten'); + $('.li-remunerasi').addClass('show'); + $('.li-remunerasi-p2').addClass('active badge-primary-lighten'); + @else + $('.si-pleno-penunjang').addClass('menuitem-active'); + $('.ni-pleno-penunjang').addClass('badge-primary-lighten'); + $('.li-pleno-penunjang').addClass('show'); + $('.li-rasio-p2').addClass('active badge-primary-lighten'); + @endif - @endsection -- 2.52.0