Penambahan filter PPPK di Keseluruhan
This commit is contained in:
@@ -42,8 +42,9 @@ class KeseluruhanController extends Controller
|
||||
$tahun = (int) ($request->tahun ?: now()->year);
|
||||
$jenisPegawai = $request->jenis_pegawai ?: null;
|
||||
$unit = $request->unit;
|
||||
$includePppk2025 = $request->boolean('include_pppk_2025');
|
||||
|
||||
$rows = collect($this->getRekapRows($tahun, $jenisPegawai, $unit));
|
||||
$rows = collect($this->getRekapRows($tahun, $jenisPegawai, $unit, $includePppk2025));
|
||||
|
||||
return DataTables::of($rows)
|
||||
->editColumn('jenis_pegawai', fn ($row) => $row['jenis_pegawai'] === 'dosen' ? 'Dosen' : ($row['jenis_pegawai'] === 'tendik' ? 'Tendik' : '-'))
|
||||
@@ -69,6 +70,7 @@ class KeseluruhanController extends Controller
|
||||
$tahun = (int) ($request->tahun ?: now()->year);
|
||||
$jenisPegawai = $request->jenis_pegawai ?: null;
|
||||
$unit = $request->unit;
|
||||
$includePppk2025 = $request->boolean('include_pppk_2025');
|
||||
|
||||
$unitName = '_Semua_Unit_Kerja';
|
||||
if ($unit !== null && $unit !== '') {
|
||||
@@ -80,7 +82,7 @@ class KeseluruhanController extends Controller
|
||||
|
||||
$filename = "Remunerasi_Keseluruhan_{$tahun}{$unitName}.xlsx";
|
||||
|
||||
return Excel::download(new KeseluruhanExport($tahun, $jenisPegawai, $unit), $filename);
|
||||
return Excel::download(new KeseluruhanExport($tahun, $jenisPegawai, $unit, $includePppk2025), $filename);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +90,7 @@ class KeseluruhanController extends Controller
|
||||
* tahun terpilih. Dipakai bersama oleh data() (DataTables) dan KeseluruhanExport supaya kedua
|
||||
* sisi (tampilan web & export Excel) selalu konsisten.
|
||||
*/
|
||||
public function getRekapRows(int $tahun, ?string $jenisPegawai, mixed $unit): array
|
||||
public function getRekapRows(int $tahun, ?string $jenisPegawai, mixed $unit, bool $includePppk2025 = false): array
|
||||
{
|
||||
$rows = $this->buildRekap($tahun, $jenisPegawai);
|
||||
|
||||
@@ -103,6 +105,10 @@ class KeseluruhanController extends Controller
|
||||
})->values();
|
||||
}
|
||||
|
||||
if (! $includePppk2025) {
|
||||
$rows = $rows->filter(fn ($row) => ! str_contains($row['nip'] ?? '', '202521'))->values();
|
||||
}
|
||||
|
||||
return $rows->sortBy('nama', SORT_NATURAL | SORT_FLAG_CASE)->values()->all();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user