feat: add calculation rules, management features, and services for period 401
This commit is contained in:
@@ -464,6 +464,8 @@ class RasioP2Controller extends Controller
|
||||
$thb = $kegiatan['tri_dharma_homebase'] ?? [];
|
||||
$tlh = $kegiatan['tri_dharma_luar_homebase'] ?? [];
|
||||
|
||||
$isAturanBaruDetail = ! empty($kegiatan['p2']['p2']['is_aturan_baru']);
|
||||
|
||||
// Hitung units & nilaiPerPoin di awal agar nominal tiap item proporsional terhadap unit yang difilter
|
||||
$units = array_values(array_filter($kegiatan['units'] ?? [], fn ($u) => is_array($u)));
|
||||
$monthBruto = (float) array_sum(array_map(fn ($u) => $u['p2']['bruto'] ?? 0, $units));
|
||||
@@ -474,6 +476,21 @@ class RasioP2Controller extends Controller
|
||||
$totalPoinP2 = (float) array_sum($kegiatan['total_poin']['poin_p2'] ?? []);
|
||||
$poinP2Kegiatan = (float) ($kegiatan['total_poin']['poin_p2']['kegiatan'] ?? 0);
|
||||
$p2TotalBruto = (float) ($kegiatan['p2']['total']['bruto'] ?? $monthBruto);
|
||||
|
||||
if ($isAturanBaruDetail && $isDosen && isset($kegiatan['p2']['total'])) {
|
||||
$monthBruto = (float) $kegiatan['p2']['total']['bruto'];
|
||||
$monthRasio = (float) $kegiatan['p2']['total']['ratio'];
|
||||
$monthTax = (float) $kegiatan['p2']['total']['tax'];
|
||||
$monthNetto = (float) $kegiatan['p2']['total']['netto'];
|
||||
|
||||
if (! empty($units)) {
|
||||
$units[0]['p2']['bruto'] = $monthBruto;
|
||||
$units[0]['p2']['ratio'] = $monthRasio;
|
||||
$units[0]['p2']['tax'] = $monthTax;
|
||||
$units[0]['p2']['netto'] = $monthNetto;
|
||||
}
|
||||
}
|
||||
|
||||
$nilaiPerPoin = $totalPoinP2 > 0 ? $p2TotalBruto / $totalPoinP2 : 0;
|
||||
|
||||
// Agregat kegiatan Adhoc (Tim/Kepanitiaan Adhoc dosen — tarif tetap Rp 660.000 ÷ 6,
|
||||
@@ -492,14 +509,23 @@ class RasioP2Controller extends Controller
|
||||
$adhocProporsional = (float) array_sum(array_column($adhocItems, 'bruto_proporsional'));
|
||||
$adhocFixed = (float) array_sum(array_column($adhocItems, 'bruto_fixed'));
|
||||
|
||||
$isAturanBaruDetail = ! empty($kegiatan['p2']['p2']['is_aturan_baru']);
|
||||
$adhocFormula = $kegiatan['p2']['p2']['adhoc'] ?? null;
|
||||
|
||||
$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,
|
||||
'potongan' => $isAturanBaruDetail ? 0 : ($adhocProporsional - $adhocFixed),
|
||||
'items' => $adhocItems,
|
||||
'is_aturan_baru' => $isAturanBaruDetail,
|
||||
'poin_total' => $adhocFormula['poin_total'] ?? $adhocPoin,
|
||||
'poin_jtt' => $adhocFormula['poin_jtt'] ?? 0,
|
||||
'poin_sisa' => $adhocFormula['poin_sisa'] ?? $adhocPoin,
|
||||
'p2_adhoc' => $adhocFormula['total'] ?? $adhocFixed,
|
||||
'nilai_per_poin' => $adhocFormula['nilai_per_poin'] ?? ($adhocPoin > 0 ? $adhocFixed / $adhocPoin : 0),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -537,15 +563,23 @@ class RasioP2Controller extends Controller
|
||||
? 'Jabatan Tugas Tambahan – '.$s['nama']
|
||||
: 'Sasaran Kinerja Pegawai';
|
||||
$pp = (float) ($s['poin_p2'] ?? 0);
|
||||
$br = $pp * $nilaiPerPoin;
|
||||
$br = $isAturanBaruDetail && $isDosen
|
||||
? (float) ($s['p2']['bruto'] ?? ($kegiatan['p2']['p2']['tambahan']['total'] ?? ($pp * $nilaiPerPoin)))
|
||||
: ($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'] = [
|
||||
'(Poin P2 SKP / Total Poin P2 Setelah Pemotongan) × P2',
|
||||
'('.$fmt2($pp).' / '.$fmt2($tPoin).') × '.$fmtRp($p2TotalBruto),
|
||||
$fmtRp($br),
|
||||
];
|
||||
$row['formula'] = $isAturanBaruDetail && $isDosen && ! empty($kegiatan['p2']['p2']['tambahan'])
|
||||
? [
|
||||
'Jabatan Tugas Tambahan (Poin SKP + Poin Konstanta)',
|
||||
'('.$fmt2((float) ($kegiatan['p2']['p2']['tambahan']['poin'] ?? $pp)).' Poin × Rp. '.number_format((float) ($kegiatan['p2']['p2']['tambahan']['harga'] ?? 0), 2, ',', '.').') ÷ 6',
|
||||
$fmtRp($br),
|
||||
]
|
||||
: [
|
||||
'(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',
|
||||
|
||||
Reference in New Issue
Block a user