Compare commits
10 Commits
06623bff34
...
v1.0.11
| Author | SHA1 | Date | |
|---|---|---|---|
| 26ca05709f | |||
| dab7dad163 | |||
| e2e3400685 | |||
| 8aa9fa066f | |||
| dd18f39565 | |||
| b88c7c8a47 | |||
| 2780e6b91c | |||
| 8057449276 | |||
| 46ae587bbe | |||
| bff8a1c1b1 |
@@ -0,0 +1,92 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\Process;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Versi PHP dari scripts/release.sh — supaya bisa dijalankan tanpa bash/WSL.
|
||||||
|
* Membuat tag versi baru (naik PATCH) dari branch main lalu push ke origin.
|
||||||
|
*/
|
||||||
|
class ReleaseCommand extends Command
|
||||||
|
{
|
||||||
|
protected $signature = 'release {message? : Pesan tag rilis} {--y|yes : Lewati konfirmasi}';
|
||||||
|
|
||||||
|
protected $description = 'Buat tag versi baru (naik PATCH) dari branch main dan push ke origin';
|
||||||
|
|
||||||
|
public function handle(): int
|
||||||
|
{
|
||||||
|
$git = fn (array $args) => trim(Process::path(base_path())->run(array_merge(['git'], $args))->output());
|
||||||
|
|
||||||
|
$branch = $git(['rev-parse', '--abbrev-ref', 'HEAD']);
|
||||||
|
if ($branch !== 'main') {
|
||||||
|
$this->error("Harus dijalankan dari branch 'main' (sekarang di '{$branch}').");
|
||||||
|
$this->line('Jalankan: git checkout main && git pull origin main');
|
||||||
|
|
||||||
|
return self::FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($git(['status', '--porcelain']) !== '') {
|
||||||
|
$this->error('Ada perubahan yang belum di-commit. Bereskan dulu sebelum tagging.');
|
||||||
|
|
||||||
|
return self::FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info('Mengambil update terbaru dari origin/main...');
|
||||||
|
Process::path(base_path())->run(['git', 'fetch', 'origin', 'main', '--tags']);
|
||||||
|
|
||||||
|
if ($git(['rev-parse', 'HEAD']) !== $git(['rev-parse', 'origin/main'])) {
|
||||||
|
$this->error('Branch main lokal belum sinkron dengan origin/main.');
|
||||||
|
$this->line('Jalankan: git pull origin main');
|
||||||
|
|
||||||
|
return self::FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
$latest = collect(explode("\n", $git(['tag', '--list', 'v*', '--sort=-v:refname'])))
|
||||||
|
->map(fn ($t) => trim($t))->filter()->first();
|
||||||
|
|
||||||
|
if (! $latest) {
|
||||||
|
$new = 'v0.1.0';
|
||||||
|
} else {
|
||||||
|
[$major, $minor, $patch] = array_pad(explode('.', ltrim($latest, 'v')), 3, '0');
|
||||||
|
$new = sprintf('v%d.%d.%d', (int) $major, (int) $minor, ((int) $patch) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->line('Tag terakhir : '.($latest ?: 'tidak ada'));
|
||||||
|
$this->line("Tag baru : {$new}");
|
||||||
|
|
||||||
|
if (! $this->option('yes') && ! $this->confirm("Buat dan push tag '{$new}'?", false)) {
|
||||||
|
$this->line('Dibatalkan.');
|
||||||
|
|
||||||
|
return self::SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
$message = $this->argument('message') ?: "Rilis {$new}";
|
||||||
|
|
||||||
|
$tag = Process::path(base_path())->run(['git', 'tag', '-a', $new, '-m', $message]);
|
||||||
|
if (! $tag->successful()) {
|
||||||
|
$this->error('Gagal membuat tag: '.trim($tag->errorOutput()));
|
||||||
|
|
||||||
|
return self::FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
$push = Process::path(base_path())->run(['git', 'push', 'origin', $new]);
|
||||||
|
if (! $push->successful()) {
|
||||||
|
$this->error('Gagal push tag: '.trim($push->errorOutput()));
|
||||||
|
|
||||||
|
return self::FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info("Selesai. Tag {$new} sudah dibuat dan dikirim ke origin.");
|
||||||
|
|
||||||
|
$repo = preg_replace('/\.git$/', '', $git(['remote', 'get-url', 'origin']));
|
||||||
|
if ($latest && $repo) {
|
||||||
|
$this->newLine();
|
||||||
|
$this->line('Lihat file yang berubah di rilis ini:');
|
||||||
|
$this->line("{$repo}/compare/{$latest}...{$new}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,16 +27,23 @@ class SimulasiJabatanExport implements WithMultipleSheets
|
|||||||
/** Nilai filter khusus "Universitas" = seluruh unit non-fakultas. */
|
/** Nilai filter khusus "Universitas" = seluruh unit non-fakultas. */
|
||||||
public const UNIT_UNIVERSITAS = 99;
|
public const UNIT_UNIVERSITAS = 99;
|
||||||
|
|
||||||
|
/** Poin Grade 14-17 statis untuk simulasi dosen bergrade < 14. */
|
||||||
|
public const GRADE_1417_POIN = 12;
|
||||||
|
|
||||||
|
/** Plafon Total Poin (basis P2) per pegawai; rumus P2 memakai min(68, ...). */
|
||||||
|
public const TOTAL_POIN_MAX = 68;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly int $periode,
|
private readonly int $periode,
|
||||||
private readonly ?int $bulan = null,
|
private readonly ?int $bulan = null,
|
||||||
private readonly ?string $jenis = null,
|
private readonly ?string $jenis = null,
|
||||||
private readonly int|string|null $unitKerjaId = null,
|
private readonly int|string|null $unitKerjaId = null,
|
||||||
|
private readonly bool $grade12 = false,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function sheets(): array
|
public function sheets(): array
|
||||||
{
|
{
|
||||||
$rows = SimulasiJabatanSheet::rows($this->periode, $this->bulan, $this->unitKerjaId, $this->jenis);
|
$rows = SimulasiJabatanSheet::rows($this->periode, $this->bulan, $this->unitKerjaId, $this->jenis, false, $this->grade12);
|
||||||
$sheets = [new SimulasiJabatanSheet('All', $rows)];
|
$sheets = [new SimulasiJabatanSheet('All', $rows)];
|
||||||
foreach ($rows->groupBy(fn ($row) => $row['unit_kerja'] ?: 'Tanpa Unit Kerja') as $unit => $unitRows) {
|
foreach ($rows->groupBy(fn ($row) => $row['unit_kerja'] ?: 'Tanpa Unit Kerja') as $unit => $unitRows) {
|
||||||
$sheets[] = new SimulasiJabatanSheet($unit, $unitRows->values());
|
$sheets[] = new SimulasiJabatanSheet($unit, $unitRows->values());
|
||||||
@@ -49,7 +56,7 @@ class SimulasiJabatanSheet implements FromCollection, WithHeadings, WithStyles,
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly string $sheetTitle, private readonly Collection $items) {}
|
public function __construct(private readonly string $sheetTitle, private readonly Collection $items) {}
|
||||||
|
|
||||||
public static function rows(int $periode, ?int $bulan = null, int|string|null $unitKerjaId = null, ?string $jenis = null, bool $raw = false): Collection
|
public static function rows(int $periode, ?int $bulan = null, int|string|null $unitKerjaId = null, ?string $jenis = null, bool $raw = false, bool $grade12 = false): Collection
|
||||||
{
|
{
|
||||||
$q = JabatanPegawaiDetailPoin::query()->select([
|
$q = JabatanPegawaiDetailPoin::query()->select([
|
||||||
'verifikator.jabatan_pegawais.nip', 'verifikator.poin_per_bulans.jabatan_pegawai_detail_id',
|
'verifikator.jabatan_pegawais.nip', 'verifikator.poin_per_bulans.jabatan_pegawai_detail_id',
|
||||||
@@ -130,7 +137,7 @@ class SimulasiJabatanSheet implements FromCollection, WithHeadings, WithStyles,
|
|||||||
return collect($dp ?: [])->sum(fn ($u) => collect($u['adhoc_kegiatan'] ?? [])->sum('poin_p2'));
|
return collect($dp ?: [])->sum(fn ($u) => collect($u['adhoc_kegiatan'] ?? [])->sum('poin_p2'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return $source->map(function ($r) use ($excel, $details, $monthCounts, $jfPrices, $jttPrices, $remunSums, $adhocByNip, $raw) {
|
return $source->map(function ($r) use ($excel, $details, $monthCounts, $jfPrices, $jttPrices, $remunSums, $adhocByNip, $raw, $grade12) {
|
||||||
$d = $details->get($r->jabatan_pegawai_detail_id);
|
$d = $details->get($r->jabatan_pegawai_detail_id);
|
||||||
$price = function ($id, $model, $period) use ($jfPrices, $jttPrices) { return $id ? (float) (($model === JabatanFungsionalRiwayat::class ? $jfPrices : $jttPrices)->get($id.'-'.$period)?->harga ?? 0) : 0; };
|
$price = function ($id, $model, $period) use ($jfPrices, $jttPrices) { return $id ? (float) (($model === JabatanFungsionalRiwayat::class ? $jfPrices : $jttPrices)->get($id.'-'.$period)?->harga ?? 0) : 0; };
|
||||||
$jf374=$price($d?->jabatan_fungsional_id, JabatanFungsionalRiwayat::class,374); $jf377=$price($d?->jabatan_fungsional_id,JabatanFungsionalRiwayat::class,377);
|
$jf374=$price($d?->jabatan_fungsional_id, JabatanFungsionalRiwayat::class,374); $jf377=$price($d?->jabatan_fungsional_id,JabatanFungsionalRiwayat::class,377);
|
||||||
@@ -158,8 +165,17 @@ class SimulasiJabatanSheet implements FromCollection, WithHeadings, WithStyles,
|
|||||||
$remun = $remunSums->get($d?->jabatan_pegawai_id);
|
$remun = $remunSums->get($d?->jabatan_pegawai_id);
|
||||||
$hasRemun = $remun && (float) $remun->p2_bruto_sum > 0;
|
$hasRemun = $remun && (float) $remun->p2_bruto_sum > 0;
|
||||||
$final374 = $final377 = $finalExcel = 0.0;
|
$final374 = $final377 = $finalExcel = 0.0;
|
||||||
|
$final374g12 = $final377g12 = $finalExcelg12 = 0.0;
|
||||||
$adhocP2 = (float) ($adhocByNip[$r->nip] ?? 0) * 660000 / 6;
|
$adhocP2 = (float) ($adhocByNip[$r->nip] ?? 0) * 660000 / 6;
|
||||||
|
|
||||||
|
// Simulasi opsional: dosen yang TIDAK punya grade 14-17 pada jabatan
|
||||||
|
// fungsional MAUPUN jabatan tugas tambahan → tambahkan 12 poin (statis)
|
||||||
|
// ke total poin P2 sebelum dibagi JF/JTT, sama seperti pegawai grade 14-17.
|
||||||
|
$gradeJfVal = $jfPrices->get(($d?->jabatan_fungsional_id).'-377')?->grade ?? $jfPrices->get(($d?->jabatan_fungsional_id).'-374')?->grade;
|
||||||
|
$gradeJttVal = $jttPrices->get(($d?->jabatan_tambahan_id).'-377')?->grade ?? $jttPrices->get(($d?->jabatan_tambahan_id).'-374')?->grade;
|
||||||
|
$is1417 = fn ($g) => is_numeric($g) && (int) $g >= 14;
|
||||||
|
$eligibleGrade12 = ! $isTendik && ! $is1417($gradeJfVal) && ! $is1417($gradeJttVal);
|
||||||
|
|
||||||
if ($isTendik) {
|
if ($isTendik) {
|
||||||
// Tendik tidak memakai model pecah JF/JTT lama sama sekali.
|
// Tendik tidak memakai model pecah JF/JTT lama sama sekali.
|
||||||
$jf = $jtt = 0.0;
|
$jf = $jtt = 0.0;
|
||||||
@@ -186,6 +202,24 @@ class SimulasiJabatanSheet implements FromCollection, WithHeadings, WithStyles,
|
|||||||
$final374 = $adhocPortion377 + $jfPortion377 * $ratio($jf374, $jf377) + $jttPortion377 * $ratio($jtt374, $jtt377);
|
$final374 = $adhocPortion377 + $jfPortion377 * $ratio($jf374, $jf377) + $jttPortion377 * $ratio($jtt374, $jtt377);
|
||||||
$finalExcel = $adhocPortion377 + $jfPortion377 * $ratio($jfExcel, $jf377) + $jttPortion377 * $ratio($jttExcel, $jtt377);
|
$finalExcel = $adhocPortion377 + $jfPortion377 * $ratio($jfExcel, $jf377) + $jttPortion377 * $ratio($jttExcel, $jtt377);
|
||||||
|
|
||||||
|
// Tambahan poin grade (opsional) — dihargai pada tarif dasar jabatan.
|
||||||
|
$jfPoinDelta = $jttPoinDelta = 0.0;
|
||||||
|
if ($eligibleGrade12) {
|
||||||
|
// Tambahan +12 tetap dibatasi plafon 68 (net 68-12 setelah
|
||||||
|
// poin wajib dikeluarkan). Dosen yang poin P2-nya sudah mentok
|
||||||
|
// tidak ikut naik; efek grafik/tabel jadi konsisten.
|
||||||
|
$poinP2Sim = min((float) (SimulasiJabatanExport::TOTAL_POIN_MAX - SimulasiJabatanExport::GRADE_1417_POIN), $poinP2 + SimulasiJabatanExport::GRADE_1417_POIN);
|
||||||
|
$poinP2NonAdhocSim = max(0.0, $poinP2Sim - $adhocPoin);
|
||||||
|
$jttPoinSim = $hasJtt ? ($isTendik ? $poinP2NonAdhocSim : min(28.0, $poinP2NonAdhocSim)) : 0.0;
|
||||||
|
$jfPoinSim = max(0.0, $poinP2NonAdhocSim - $jttPoinSim);
|
||||||
|
$jfPoinDelta = $jfPoinSim - $jfPoin;
|
||||||
|
$jttPoinDelta = $jttPoinSim - $jttPoin;
|
||||||
|
}
|
||||||
|
$incAt = fn ($hjf, $hjtt) => ($jfPoinDelta * $hjf + $jttPoinDelta * $hjtt) / 6 * $months;
|
||||||
|
$final377g12 = $final377 + $incAt($jf377, $jtt377);
|
||||||
|
$final374g12 = $final374 + $incAt($jf374, $jtt374);
|
||||||
|
$finalExcelg12 = $finalExcel + $incAt($jfExcel, $jttExcel);
|
||||||
|
|
||||||
// Kolom JF / JTT pada sheet Excel (porsi masing-masing).
|
// Kolom JF / JTT pada sheet Excel (porsi masing-masing).
|
||||||
$jf = $jfPoin;
|
$jf = $jfPoin;
|
||||||
$jtt = $jttPoin;
|
$jtt = $jttPoin;
|
||||||
@@ -195,6 +229,18 @@ class SimulasiJabatanSheet implements FromCollection, WithHeadings, WithStyles,
|
|||||||
$p2jtt374 = round($jttPortion377 * $ratio($jtt374, $jtt377) / $months, 2);
|
$p2jtt374 = round($jttPortion377 * $ratio($jtt374, $jtt377) / $months, 2);
|
||||||
$p2jfExcel = round(($adhocPortion377 + $jfPortion377 * $ratio($jfExcel, $jf377)) / $months, 2);
|
$p2jfExcel = round(($adhocPortion377 + $jfPortion377 * $ratio($jfExcel, $jf377)) / $months, 2);
|
||||||
$p2jttExcel= round($jttPortion377 * $ratio($jttExcel, $jtt377) / $months, 2);
|
$p2jttExcel= round($jttPortion377 * $ratio($jttExcel, $jtt377) / $months, 2);
|
||||||
|
|
||||||
|
// Bila simulasi grade aktif, terapkan tambahan poin ke kolom sheet Excel.
|
||||||
|
if ($grade12 && $eligibleGrade12) {
|
||||||
|
$jf = $jfPoin + $jfPoinDelta;
|
||||||
|
$jtt = $jttPoin + $jttPoinDelta;
|
||||||
|
$p2jf377 += round($jfPoinDelta * $jf377 / 6, 2);
|
||||||
|
$p2jtt377 += round($jttPoinDelta * $jtt377 / 6, 2);
|
||||||
|
$p2jf374 += round($jfPoinDelta * $jf374 / 6, 2);
|
||||||
|
$p2jtt374 += round($jttPoinDelta * $jtt374 / 6, 2);
|
||||||
|
$p2jfExcel += round($jfPoinDelta * $jfExcel / 6, 2);
|
||||||
|
$p2jttExcel+= round($jttPoinDelta * $jttExcel / 6, 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$out = ['nama_pegawai'=>$r->nama_pegawai,'nip'=>"'".$r->nip,'unit_kerja'=>$r->unit_kerja ?: 'Tanpa Unit Kerja','jenis_pegawai'=>strtoupper($r->jenis_pegawai),'poin_jf'=>round($jf,2),'nama_jf'=>$d?->fungsional?->nama ?? '-','grade_jf'=>$jfPrices->get(($d?->jabatan_fungsional_id).'-377')?->grade ?? '-','harga_jf_374'=>$jf374,'p2_jf_374'=>$p2jf374,'total_p2_jf_374'=>$p2jf374*$months,'harga_jf_377'=>$jf377,'p2_jf_377'=>$p2jf377,'total_p2_jf_377'=>$p2jf377*$months,'harga_jf_excel'=>$jfExcel,'p2_jf_excel'=>$p2jfExcel,'total_p2_jf_excel'=>$p2jfExcel*$months,'poin_jtt'=>round($jtt,2),'nama_jtt'=>$d?->tambahan?->nama ?? '-','grade_jtt'=>$jttPrices->get(($d?->jabatan_tambahan_id).'-377')?->grade ?? '-','harga_jtt_374'=>$jtt374,'p2_jtt_374'=>$p2jtt374,'total_p2_jtt_374'=>$p2jtt374*$months,'harga_jtt_377'=>$jtt377,'p2_jtt_377'=>$p2jtt377,'total_p2_jtt_377'=>$p2jtt377*$months,'harga_jtt_excel'=>$jttExcel,'p2_jtt_excel'=>$p2jttExcel,'total_p2_jtt_excel'=>$p2jttExcel*$months];
|
$out = ['nama_pegawai'=>$r->nama_pegawai,'nip'=>"'".$r->nip,'unit_kerja'=>$r->unit_kerja ?: 'Tanpa Unit Kerja','jenis_pegawai'=>strtoupper($r->jenis_pegawai),'poin_jf'=>round($jf,2),'nama_jf'=>$d?->fungsional?->nama ?? '-','grade_jf'=>$jfPrices->get(($d?->jabatan_fungsional_id).'-377')?->grade ?? '-','harga_jf_374'=>$jf374,'p2_jf_374'=>$p2jf374,'total_p2_jf_374'=>$p2jf374*$months,'harga_jf_377'=>$jf377,'p2_jf_377'=>$p2jf377,'total_p2_jf_377'=>$p2jf377*$months,'harga_jf_excel'=>$jfExcel,'p2_jf_excel'=>$p2jfExcel,'total_p2_jf_excel'=>$p2jfExcel*$months,'poin_jtt'=>round($jtt,2),'nama_jtt'=>$d?->tambahan?->nama ?? '-','grade_jtt'=>$jttPrices->get(($d?->jabatan_tambahan_id).'-377')?->grade ?? '-','harga_jtt_374'=>$jtt374,'p2_jtt_374'=>$p2jtt374,'total_p2_jtt_374'=>$p2jtt374*$months,'harga_jtt_377'=>$jtt377,'p2_jtt_377'=>$p2jtt377,'total_p2_jtt_377'=>$p2jtt377*$months,'harga_jtt_excel'=>$jttExcel,'p2_jtt_excel'=>$p2jttExcel,'total_p2_jtt_excel'=>$p2jttExcel*$months];
|
||||||
@@ -217,6 +263,11 @@ class SimulasiJabatanSheet implements FromCollection, WithHeadings, WithStyles,
|
|||||||
$out['raw_p2_final_374'] = $final374;
|
$out['raw_p2_final_374'] = $final374;
|
||||||
$out['raw_p2_final_377'] = $final377;
|
$out['raw_p2_final_377'] = $final377;
|
||||||
$out['raw_p2_final_excel'] = $finalExcel;
|
$out['raw_p2_final_excel'] = $finalExcel;
|
||||||
|
// Varian simulasi "+12 poin grade" untuk dosen bergrade < 14.
|
||||||
|
$out['raw_grade12_eligible'] = $eligibleGrade12;
|
||||||
|
$out['raw_p2_final_374_g12'] = $final374g12;
|
||||||
|
$out['raw_p2_final_377_g12'] = $final377g12;
|
||||||
|
$out['raw_p2_final_excel_g12'] = $finalExcelg12;
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -76,12 +76,29 @@ class SimulasiJabatanController extends Controller
|
|||||||
$recordsFiltered = $rows->count();
|
$recordsFiltered = $rows->count();
|
||||||
|
|
||||||
$page = $length < 0 ? $rows->values() : $rows->slice($start, $length)->values();
|
$page = $length < 0 ? $rows->values() : $rows->slice($start, $length)->values();
|
||||||
|
$g12 = $request->boolean('grade12');
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'draw' => (int) $request->input('draw'),
|
'draw' => (int) $request->input('draw'),
|
||||||
'recordsTotal' => $recordsTotal,
|
'recordsTotal' => $recordsTotal,
|
||||||
'recordsFiltered' => $recordsFiltered,
|
'recordsFiltered' => $recordsFiltered,
|
||||||
'data' => $page->map(function ($row, $index) use ($start) {
|
'data' => $page->map(function ($row, $index) use ($start, $g12) {
|
||||||
|
if ($g12) {
|
||||||
|
$row['p2_total_374'] = $row['p2_total_374_g12'];
|
||||||
|
$row['p2_total_377'] = $row['p2_total_377_g12'];
|
||||||
|
$row['p2_total_excel'] = $row['p2_total_excel_g12'];
|
||||||
|
if (! empty($row['grade12_eligible'])) {
|
||||||
|
$parseN = fn ($v) => (float) str_replace(',', '.', str_replace('.', '', $v));
|
||||||
|
// Total Poin dosen mentok di 68 (aturan yang sama dengan
|
||||||
|
// rumus P2: min(68, ...)). Tambahan +12 hanya berlaku
|
||||||
|
// sampai plafon itu, jadi dosen yang sudah 68 tidak
|
||||||
|
// bertambah dan yang mendekati 68 hanya naik sebagian.
|
||||||
|
$totalPoin = $parseN($row['total_poin']);
|
||||||
|
$tambahanEfektif = max(0.0, min((float) SimulasiJabatanExport::TOTAL_POIN_MAX, $totalPoin + SimulasiJabatanExport::GRADE_1417_POIN) - $totalPoin);
|
||||||
|
$row['poin_grade_14_17'] = number_format($tambahanEfektif, 2, ',', '.');
|
||||||
|
$row['total_poin'] = number_format($totalPoin + $tambahanEfektif, 2, ',', '.');
|
||||||
|
}
|
||||||
|
}
|
||||||
return array_merge($row, ['DT_RowIndex' => $start + $index + 1]);
|
return array_merge($row, ['DT_RowIndex' => $start + $index + 1]);
|
||||||
})->all(),
|
})->all(),
|
||||||
]);
|
]);
|
||||||
@@ -102,12 +119,72 @@ class SimulasiJabatanController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$parse = fn ($value) => (float) str_replace(',', '.', str_replace('.', '', $value));
|
$parse = fn ($value) => (float) str_replace(',', '.', str_replace('.', '', $value));
|
||||||
|
$suffix = $request->boolean('grade12') ? '_g12' : '';
|
||||||
$totals = collect(['p2_total_374', 'p2_total_377', 'p2_total_excel'])
|
$totals = collect(['p2_total_374', 'p2_total_377', 'p2_total_excel'])
|
||||||
->mapWithKeys(fn ($key) => [$key => number_format($rows->sum(fn ($row) => $parse($row[$key])), 2, ',', '.')]);
|
->mapWithKeys(fn ($key) => [$key => number_format($rows->sum(fn ($row) => $parse($row[$key.$suffix])), 2, ',', '.')]);
|
||||||
|
|
||||||
return response()->json($totals->all());
|
return response()->json($totals->all());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Agregat Total P2 per unit kerja untuk visualisasi grafik batang.
|
||||||
|
* Pengelompokan mengikuti menu Remunerasi > P2: fakultas 1-9 + "Universitas"
|
||||||
|
* (seluruh unit non-fakultas). Filter unit kerja diabaikan supaya seluruh
|
||||||
|
* unit tetap tampil; filter periode & jenis pegawai tetap dihormati.
|
||||||
|
*/
|
||||||
|
public function chart(Request $request)
|
||||||
|
{
|
||||||
|
@set_time_limit(300);
|
||||||
|
$periode = (int) ($request->input('periode') ?: optional(Periode::where('status', true)->first())->id_periode);
|
||||||
|
|
||||||
|
$rows = $this->dataset($periode);
|
||||||
|
if ($request->filled('jenis_pegawai')) {
|
||||||
|
$rows = $rows->where('jenis_pegawai', $request->input('jenis_pegawai'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$parse = fn ($value) => (float) str_replace(',', '.', str_replace('.', '', (string) $value));
|
||||||
|
|
||||||
|
$labels = [
|
||||||
|
1 => 'Fakultas Hukum',
|
||||||
|
2 => 'Fakultas Ekonomi dan Bisnis',
|
||||||
|
3 => 'Fakultas Pertanian',
|
||||||
|
4 => 'Fakultas Teknik',
|
||||||
|
5 => 'Fakultas Ilmu Sosial dan Ilmu Politik',
|
||||||
|
6 => 'Fakultas Keguruan dan Ilmu Pendidikan',
|
||||||
|
7 => 'Fakultas Kehutanan',
|
||||||
|
8 => 'Fakultas Matematika dan Ilmu Pengetahuan Alam',
|
||||||
|
9 => 'Fakultas Kedokteran',
|
||||||
|
SimulasiJabatanExport::UNIT_UNIVERSITAS => 'Universitas',
|
||||||
|
];
|
||||||
|
$short = [
|
||||||
|
1 => 'FH', 2 => 'FEB', 3 => 'FP', 4 => 'FT', 5 => 'FISIP',
|
||||||
|
6 => 'FKIP', 7 => 'FHUT', 8 => 'FMIPA', 9 => 'FK',
|
||||||
|
SimulasiJabatanExport::UNIT_UNIVERSITAS => 'UNIV',
|
||||||
|
];
|
||||||
|
|
||||||
|
$groups = collect($labels)->map(function ($nama, $id) use ($rows, $parse, $short) {
|
||||||
|
$subset = (int) $id === SimulasiJabatanExport::UNIT_UNIVERSITAS
|
||||||
|
? $rows->whereNotIn('unit_kerja_id', SimulasiJabatanExport::FAKULTAS_IDS)
|
||||||
|
: $rows->where('unit_kerja_id', (int) $id);
|
||||||
|
|
||||||
|
$sum = fn ($key) => round($subset->sum(fn ($r) => $parse($r[$key])), 2);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'unit_kerja' => $nama,
|
||||||
|
'unit_kerja_short' => $short[$id],
|
||||||
|
'pegawai' => $subset->count(),
|
||||||
|
'p2_374' => $sum('p2_total_374'),
|
||||||
|
'p2_377' => $sum('p2_total_377'),
|
||||||
|
'p2_excel' => $sum('p2_total_excel'),
|
||||||
|
'p2_374_g12' => $sum('p2_total_374_g12'),
|
||||||
|
'p2_377_g12' => $sum('p2_total_377_g12'),
|
||||||
|
'p2_excel_g12' => $sum('p2_total_excel_g12'),
|
||||||
|
];
|
||||||
|
})->values();
|
||||||
|
|
||||||
|
return response()->json($groups->all());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bangun dan cache seluruh baris simulasi untuk satu periode.
|
* Bangun dan cache seluruh baris simulasi untuk satu periode.
|
||||||
*
|
*
|
||||||
@@ -173,17 +250,23 @@ class SimulasiJabatanController extends Controller
|
|||||||
// Bila perhitungan Remunerasi sudah ada: pakai nilai P2 riil (satu
|
// Bila perhitungan Remunerasi sudah ada: pakai nilai P2 riil (satu
|
||||||
// harga jabatan, tanpa dipecah JF/JTT). Tendik tanpa Remunerasi -> 0.
|
// harga jabatan, tanpa dipecah JF/JTT). Tendik tanpa Remunerasi -> 0.
|
||||||
// Dosen tanpa Remunerasi -> model lama (P2 JF + P2 JTT + adhoc).
|
// Dosen tanpa Remunerasi -> model lama (P2 JF + P2 JTT + adhoc).
|
||||||
|
// Untuk tiap versi P2 disiapkan 2 nilai: normal & varian "+12 poin
|
||||||
|
// grade" (dosen bergrade < 14). Frontend memilih sesuai checkbox.
|
||||||
if (! empty($row['raw_has_remun'])) {
|
if (! empty($row['raw_has_remun'])) {
|
||||||
$p2_374 = (float) $row['raw_p2_final_374'];
|
$p2_374 = (float) $row['raw_p2_final_374'];
|
||||||
$p2_377 = (float) $row['raw_p2_final_377'];
|
$p2_377 = (float) $row['raw_p2_final_377'];
|
||||||
$p2_excel = (float) $row['raw_p2_final_excel'];
|
$p2_excel = (float) $row['raw_p2_final_excel'];
|
||||||
|
$p2_374_g12 = (float) $row['raw_p2_final_374_g12'];
|
||||||
|
$p2_377_g12 = (float) $row['raw_p2_final_377_g12'];
|
||||||
|
$p2_excel_g12 = (float) $row['raw_p2_final_excel_g12'];
|
||||||
} elseif (! empty($row['raw_is_tendik'])) {
|
} elseif (! empty($row['raw_is_tendik'])) {
|
||||||
$p2_374 = $p2_377 = $p2_excel = 0.0;
|
$p2_374 = $p2_377 = $p2_excel = 0.0;
|
||||||
|
$p2_374_g12 = $p2_377_g12 = $p2_excel_g12 = 0.0;
|
||||||
} else {
|
} else {
|
||||||
$adhocHargaP2 = (float) $row['raw_adhoc_p2'];
|
$adhocHargaP2 = (float) $row['raw_adhoc_p2'];
|
||||||
$p2_374 = $row['total_p2_jf_374'] + $row['total_p2_jtt_374'] + $adhocHargaP2;
|
$p2_374 = $p2_374_g12 = $row['total_p2_jf_374'] + $row['total_p2_jtt_374'] + $adhocHargaP2;
|
||||||
$p2_377 = $row['total_p2_jf_377'] + $row['total_p2_jtt_377'] + $adhocHargaP2;
|
$p2_377 = $p2_377_g12 = $row['total_p2_jf_377'] + $row['total_p2_jtt_377'] + $adhocHargaP2;
|
||||||
$p2_excel = $row['total_p2_jf_excel'] + $row['total_p2_jtt_excel'] + $adhocHargaP2;
|
$p2_excel = $p2_excel_g12 = $row['total_p2_jf_excel'] + $row['total_p2_jtt_excel'] + $adhocHargaP2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [$nip => [
|
return [$nip => [
|
||||||
@@ -192,6 +275,7 @@ class SimulasiJabatanController extends Controller
|
|||||||
'jenis_pegawai' => mb_strtolower((string) $row['jenis_pegawai']),
|
'jenis_pegawai' => mb_strtolower((string) $row['jenis_pegawai']),
|
||||||
'unit_kerja' => $row['unit_kerja'] === 'Tanpa Unit Kerja' ? '' : $row['unit_kerja'],
|
'unit_kerja' => $row['unit_kerja'] === 'Tanpa Unit Kerja' ? '' : $row['unit_kerja'],
|
||||||
'unit_kerja_id' => (int) $row['raw_unit_kerja_id'],
|
'unit_kerja_id' => (int) $row['raw_unit_kerja_id'],
|
||||||
|
'grade12_eligible' => (bool) ($row['raw_grade12_eligible'] ?? false),
|
||||||
'poin_kegiatan' => $format($row['raw_poin_kegiatan']),
|
'poin_kegiatan' => $format($row['raw_poin_kegiatan']),
|
||||||
'poin_adhoc' => $format($row['raw_poin_adhoc']),
|
'poin_adhoc' => $format($row['raw_poin_adhoc']),
|
||||||
'poin_absen' => $format($row['raw_poin_absen']),
|
'poin_absen' => $format($row['raw_poin_absen']),
|
||||||
@@ -201,6 +285,9 @@ class SimulasiJabatanController extends Controller
|
|||||||
'p2_total_374' => $format($p2_374),
|
'p2_total_374' => $format($p2_374),
|
||||||
'p2_total_377' => $format($p2_377),
|
'p2_total_377' => $format($p2_377),
|
||||||
'p2_total_excel' => $format($p2_excel),
|
'p2_total_excel' => $format($p2_excel),
|
||||||
|
'p2_total_374_g12' => $format($p2_374_g12),
|
||||||
|
'p2_total_377_g12' => $format($p2_377_g12),
|
||||||
|
'p2_total_excel_g12' => $format($p2_excel_g12),
|
||||||
]];
|
]];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -215,8 +302,9 @@ class SimulasiJabatanController extends Controller
|
|||||||
$periode = (int) ($request->input('periode') ?: optional(Periode::where('status', true)->first())->id_periode);
|
$periode = (int) ($request->input('periode') ?: optional(Periode::where('status', true)->first())->id_periode);
|
||||||
$jenis = $request->input('jenis_pegawai') ?: null;
|
$jenis = $request->input('jenis_pegawai') ?: null;
|
||||||
$unitKerjaId = $request->input('unit_kerja_id') ?: null;
|
$unitKerjaId = $request->input('unit_kerja_id') ?: null;
|
||||||
$suffix = $unitKerjaId ? '-unit'.$unitKerjaId : '';
|
$grade12 = $request->boolean('grade12');
|
||||||
return Excel::download(new SimulasiJabatanExport($periode, null, $jenis, $unitKerjaId), 'simulasi-jabatan-'.$periode.$suffix.'.xlsx');
|
$suffix = ($unitKerjaId ? '-unit'.$unitKerjaId : '').($grade12 ? '-grade12' : '');
|
||||||
|
return Excel::download(new SimulasiJabatanExport($periode, null, $jenis, $unitKerjaId, $grade12), 'simulasi-jabatan-'.$periode.$suffix.'.xlsx');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -226,7 +314,7 @@ class SimulasiJabatanController extends Controller
|
|||||||
* (di luar porsi Adhoc yang tarifnya tetap); versi 374 & Excel diskala menurut
|
* (di luar porsi Adhoc yang tarifnya tetap); versi 374 & Excel diskala menurut
|
||||||
* rasio harga jabatan. Return null bila data Remunerasi belum ada (pakai cara lama).
|
* rasio harga jabatan. Return null bila data Remunerasi belum ada (pakai cara lama).
|
||||||
*/
|
*/
|
||||||
private function detailFromRemun(Pegawai $pegawai, int $periode): ?\Illuminate\Http\JsonResponse
|
private function detailFromRemun(Pegawai $pegawai, int $periode, bool $grade12 = false): ?\Illuminate\Http\JsonResponse
|
||||||
{
|
{
|
||||||
$jp = JabatanPegawai::with(['detail.fungsional', 'detail.tambahan', 'detail.poin'])
|
$jp = JabatanPegawai::with(['detail.fungsional', 'detail.tambahan', 'detail.poin'])
|
||||||
->where('nip', $pegawai->nip)->where('periode', $periode)->where('active', true)->first();
|
->where('nip', $pegawai->nip)->where('periode', $periode)->where('active', true)->first();
|
||||||
@@ -253,8 +341,16 @@ class SimulasiJabatanController extends Controller
|
|||||||
$fmt = fn ($v) => number_format((float) $v, 2, ',', '.');
|
$fmt = fn ($v) => number_format((float) $v, 2, ',', '.');
|
||||||
$parse = fn ($v) => (float) str_replace(',', '.', str_replace('.', '', $v));
|
$parse = fn ($v) => (float) str_replace(',', '.', str_replace('.', '', $v));
|
||||||
|
|
||||||
|
// Simulasi opsional "+12 poin grade" — dosen yang TIDAK punya grade 14-17
|
||||||
|
// pada jabatan fungsional maupun jabatan tugas tambahan.
|
||||||
|
$firstD = $jp->detail->sortBy('bulan')->first();
|
||||||
|
$gJf = $jfRiw($firstD->jabatan_fungsional_id, 377, 'grade') ?? $jfRiw($firstD->jabatan_fungsional_id, 374, 'grade');
|
||||||
|
$gJtt = $jttRiw($firstD->jabatan_tambahan_id, 377, 'grade') ?? $jttRiw($firstD->jabatan_tambahan_id, 374, 'grade');
|
||||||
|
$is1417 = fn ($g) => is_numeric($g) && (int) $g >= 14;
|
||||||
|
$eligibleG12 = $grade12 && ! $isTendik && ! $is1417($gJf) && ! $is1417($gJtt);
|
||||||
|
|
||||||
$adhocRows = collect();
|
$adhocRows = collect();
|
||||||
$data = $jp->detail->sortBy('bulan')->values()->map(function ($d) use ($rpb, $excel, $jfRiw, $jttRiw, $fmt, $isTendik, &$adhocRows) {
|
$data = $jp->detail->sortBy('bulan')->values()->map(function ($d) use ($rpb, $excel, $jfRiw, $jttRiw, $fmt, $isTendik, $eligibleG12, &$adhocRows) {
|
||||||
$r = $rpb->get($d->id);
|
$r = $rpb->get($d->id);
|
||||||
$poinP2 = $r ? (float) $r->poin_p2 : 0.0;
|
$poinP2 = $r ? (float) $r->poin_p2 : 0.0;
|
||||||
$bruto377 = $r ? (float) $r->p2_bruto : 0.0;
|
$bruto377 = $r ? (float) $r->p2_bruto : 0.0;
|
||||||
@@ -295,6 +391,19 @@ class SimulasiJabatanController extends Controller
|
|||||||
$jfPortion = max(0.0, $bruto377 - $jttPortion - $adhocHarga); // menyerap distribusi kegiatan
|
$jfPortion = max(0.0, $bruto377 - $jttPortion - $adhocHarga); // menyerap distribusi kegiatan
|
||||||
$ratio = fn ($num, $den) => $den > 0 ? $num / $den : 0.0;
|
$ratio = fn ($num, $den) => $den > 0 ? $num / $den : 0.0;
|
||||||
|
|
||||||
|
// Tambahan "+12 poin grade" (opsional) — dihargai tarif dasar jabatan.
|
||||||
|
if ($eligibleG12) {
|
||||||
|
// Plafon 68 tetap berlaku (net 68-12 di luar poin wajib), jadi
|
||||||
|
// bulan yang poin P2-nya sudah mentok tidak ikut naik.
|
||||||
|
$poinNonAdhocSim = min((float) (SimulasiJabatanExport::TOTAL_POIN_MAX - SimulasiJabatanExport::GRADE_1417_POIN), $poinP2NonAdhoc + SimulasiJabatanExport::GRADE_1417_POIN);
|
||||||
|
$jttPoinSim = $hasJtt ? min(28.0, $poinNonAdhocSim) : 0.0;
|
||||||
|
$jfPoinSim = max(0.0, $poinNonAdhocSim - $jttPoinSim);
|
||||||
|
$jttPortion += ($jttPoinSim - $jttPoin) * $jtt377 / 6;
|
||||||
|
$jfPortion += ($jfPoinSim - $jfPoin) * $jf377 / 6;
|
||||||
|
$jttPoin = $jttPoinSim;
|
||||||
|
$jfPoin = $jfPoinSim;
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'bulan' => $d->bulan,
|
'bulan' => $d->bulan,
|
||||||
'jabatan' => $jfName,
|
'jabatan' => $jfName,
|
||||||
@@ -331,7 +440,7 @@ class SimulasiJabatanController extends Controller
|
|||||||
|
|
||||||
// Rincian mengikuti aturan Remunerasi > P2 bila datanya sudah ada.
|
// Rincian mengikuti aturan Remunerasi > P2 bila datanya sudah ada.
|
||||||
// Jatuh ke perhitungan lama hanya bila Remunerasi belum dihitung.
|
// Jatuh ke perhitungan lama hanya bila Remunerasi belum dihitung.
|
||||||
if ($fromRemun = $this->detailFromRemun($pegawai, $periode)) {
|
if ($fromRemun = $this->detailFromRemun($pegawai, $periode, $request->boolean('grade12'))) {
|
||||||
return $fromRemun;
|
return $fromRemun;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -174,6 +174,17 @@ class PengajuanController extends Controller
|
|||||||
// Validasi pegawai
|
// Validasi pegawai
|
||||||
$pegawai = Pegawai::where('nip', $id)->orWhere('nip_siakad', $id)->first();
|
$pegawai = Pegawai::where('nip', $id)->orWhere('nip_siakad', $id)->first();
|
||||||
if (! $pegawai) {
|
if (! $pegawai) {
|
||||||
|
$pegawaiTubel = Pegawai::withoutGlobalScopes()
|
||||||
|
->where(fn ($q) => $q->where('nip', $id)->orWhere('nip_siakad', $id))
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if ($pegawaiTubel && $pegawaiTubel->tubel_berangkat) {
|
||||||
|
return response()->json([
|
||||||
|
'success' => false,
|
||||||
|
'message' => 'Tidak dapat memverifikasi Pegawai yang sedang Tugas Belajar',
|
||||||
|
], 422);
|
||||||
|
}
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'success' => false,
|
'success' => false,
|
||||||
'message' => 'Data pegawai tidak ditemukan',
|
'message' => 'Data pegawai tidak ditemukan',
|
||||||
@@ -211,6 +222,14 @@ class PengajuanController extends Controller
|
|||||||
// Untuk non-ajax request (load halaman pertama kali)
|
// Untuk non-ajax request (load halaman pertama kali)
|
||||||
$pegawai = Pegawai::where('nip', $id)->orWhere('nip_siakad', $id)->first();
|
$pegawai = Pegawai::where('nip', $id)->orWhere('nip_siakad', $id)->first();
|
||||||
if (! $pegawai) {
|
if (! $pegawai) {
|
||||||
|
$pegawaiTubel = Pegawai::withoutGlobalScopes()
|
||||||
|
->where(fn ($q) => $q->where('nip', $id)->orWhere('nip_siakad', $id))
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if ($pegawaiTubel && $pegawaiTubel->tubel_berangkat) {
|
||||||
|
return redirect()->back()->with('warning', 'Tidak dapat memverifikasi Pegawai yang sedang Tugas Belajar');
|
||||||
|
}
|
||||||
|
|
||||||
return redirect()->back()->with('error', 'Data pegawai tidak ditemukan');
|
return redirect()->back()->with('error', 'Data pegawai tidak ditemukan');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -176,6 +176,17 @@ class PlenoController extends Controller
|
|||||||
// Validasi pegawai
|
// Validasi pegawai
|
||||||
$pegawai = Pegawai::where('nip', $id)->orWhere('nip_siakad', $id)->first();
|
$pegawai = Pegawai::where('nip', $id)->orWhere('nip_siakad', $id)->first();
|
||||||
if (! $pegawai) {
|
if (! $pegawai) {
|
||||||
|
$pegawaiTubel = Pegawai::withoutGlobalScopes()
|
||||||
|
->where(fn ($q) => $q->where('nip', $id)->orWhere('nip_siakad', $id))
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if ($pegawaiTubel && $pegawaiTubel->tubel_berangkat) {
|
||||||
|
return response()->json([
|
||||||
|
'success' => false,
|
||||||
|
'message' => 'Tidak dapat memverifikasi Pegawai yang sedang Tugas Belajar',
|
||||||
|
], 422);
|
||||||
|
}
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'success' => false,
|
'success' => false,
|
||||||
'message' => 'Data pegawai tidak ditemukan',
|
'message' => 'Data pegawai tidak ditemukan',
|
||||||
@@ -213,6 +224,14 @@ class PlenoController extends Controller
|
|||||||
// Untuk non-ajax request (load halaman pertama kali)
|
// Untuk non-ajax request (load halaman pertama kali)
|
||||||
$pegawai = Pegawai::where('nip', $id)->orWhere('nip_siakad', $id)->first();
|
$pegawai = Pegawai::where('nip', $id)->orWhere('nip_siakad', $id)->first();
|
||||||
if (! $pegawai) {
|
if (! $pegawai) {
|
||||||
|
$pegawaiTubel = Pegawai::withoutGlobalScopes()
|
||||||
|
->where(fn ($q) => $q->where('nip', $id)->orWhere('nip_siakad', $id))
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if ($pegawaiTubel && $pegawaiTubel->tubel_berangkat) {
|
||||||
|
return redirect()->back()->with('warning', 'Tidak dapat memverifikasi Pegawai yang sedang Tugas Belajar');
|
||||||
|
}
|
||||||
|
|
||||||
return redirect()->back()->with('error', 'Data pegawai tidak ditemukan');
|
return redirect()->back()->with('error', 'Data pegawai tidak ditemukan');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,6 +103,30 @@
|
|||||||
<div class="col-md-4"><div class="card border mb-0"><div class="card-body"><div class="text-muted">Total P2 (2023)</div><div id="summary-p2-2023" class="fs-4 fw-bold">...</div></div></div></div>
|
<div class="col-md-4"><div class="card border mb-0"><div class="card-body"><div class="text-muted">Total P2 (2023)</div><div id="summary-p2-2023" class="fs-4 fw-bold">...</div></div></div></div>
|
||||||
<div class="col-md-4"><div class="card border mb-0"><div class="card-body"><div class="text-muted">Total P2 (Excel)</div><div id="summary-p2-excel" class="fs-4 fw-bold">...</div></div></div></div>
|
<div class="col-md-4"><div class="card border mb-0"><div class="card-body"><div class="text-muted">Total P2 (Excel)</div><div id="summary-p2-excel" class="fs-4 fw-bold">...</div></div></div></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row g-3 mb-3">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card border mb-0">
|
||||||
|
<div class="card-header bg-light d-flex justify-content-between align-items-center">
|
||||||
|
<h6 class="mb-0">Total P2 per Unit Kerja</h6>
|
||||||
|
<span class="text-muted small">P2 2022 · P2 2023 · P2 Excel — arahkan kursor ke batang untuk melihat nilainya</span>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div id="chart-p2-unit" style="min-height: 340px;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card border mb-0">
|
||||||
|
<div class="card-header bg-light d-flex justify-content-between align-items-center">
|
||||||
|
<h6 class="mb-0">Total P2 per Unit Kerja — Simulasi +12 Poin Grade 14-17</h6>
|
||||||
|
<span class="text-muted small">Dosen yang belum punya grade 14-17 mendapat tambahan 12 poin</span>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div id="chart-p2-unit-g12" style="min-height: 340px;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="card border">
|
<div class="card border">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@include('components.datatable-header', [
|
@include('components.datatable-header', [
|
||||||
@@ -143,6 +167,14 @@
|
|||||||
<option value="tendik">Tendik</option>
|
<option value="tendik">Tendik</option>
|
||||||
</select></div>
|
</select></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-check form-switch mb-3">
|
||||||
|
<input class="form-check-input" type="checkbox" role="switch" id="grade12">
|
||||||
|
<label class="form-check-label" for="grade12">
|
||||||
|
Simulasi: tambahkan <strong>+12 Poin Grade 14-17</strong> untuk dosen yang belum punya grade 14-17
|
||||||
|
(jabatan fungsional maupun tugas tambahan)
|
||||||
|
<span class="text-muted">— nilai P2 tidak lagi sama dengan Remunerasi</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table id="simulasi-jabatan-table" class="table table-bordered dt-styled nowrap" style="width:100%">
|
<table id="simulasi-jabatan-table" class="table table-bordered dt-styled nowrap" style="width:100%">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -270,6 +302,7 @@
|
|||||||
d.periode = $('#periode').val();
|
d.periode = $('#periode').val();
|
||||||
d.unit_kerja_id = $('#unit_kerja_id').val();
|
d.unit_kerja_id = $('#unit_kerja_id').val();
|
||||||
d.jenis_pegawai = $('#jenis_pegawai').val();
|
d.jenis_pegawai = $('#jenis_pegawai').val();
|
||||||
|
d.grade12 = $('#grade12').is(':checked') ? 1 : 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
columns: [{
|
columns: [{
|
||||||
@@ -307,24 +340,105 @@
|
|||||||
{ data: 'p2_total_excel', name: 'p2_total_excel', searchable: false, orderable: false, className: 'text-end font-monospace', width: '15%' }
|
{ data: 'p2_total_excel', name: 'p2_total_excel', searchable: false, orderable: false, className: 'text-end font-monospace', width: '15%' }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
function grade12On() {
|
||||||
|
return $('#grade12').is(':checked') ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
function refreshSummary() {
|
function refreshSummary() {
|
||||||
$('#summary-p2-2022, #summary-p2-2023, #summary-p2-excel').text('...');
|
$('#summary-p2-2022, #summary-p2-2023, #summary-p2-excel').text('...');
|
||||||
$.get('{{ route('lainnya.simulasi-jabatan.summary') }}', { periode: $('#periode').val(), unit_kerja_id: $('#unit_kerja_id').val(), jenis_pegawai: $('#jenis_pegawai').val(), search: table.search() }, function(res) {
|
$.get('{{ route('lainnya.simulasi-jabatan.summary') }}', { periode: $('#periode').val(), unit_kerja_id: $('#unit_kerja_id').val(), jenis_pegawai: $('#jenis_pegawai').val(), search: table.search(), grade12: grade12On() }, function(res) {
|
||||||
$('#summary-p2-2022').text(res.p2_total_374 || '0,00'); $('#summary-p2-2023').text(res.p2_total_377 || '0,00'); $('#summary-p2-excel').text(res.p2_total_excel || '0,00');
|
$('#summary-p2-2022').text(res.p2_total_374 || '0,00'); $('#summary-p2-2023').text(res.p2_total_377 || '0,00'); $('#summary-p2-excel').text(res.p2_total_excel || '0,00');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateExportUrl() {
|
function updateExportUrl() {
|
||||||
const params = new URLSearchParams({ periode: $('#periode').val(), jenis_pegawai: $('#jenis_pegawai').val() || '', unit_kerja_id: $('#unit_kerja_id').val() || '' });
|
const params = new URLSearchParams({ periode: $('#periode').val(), jenis_pegawai: $('#jenis_pegawai').val() || '', unit_kerja_id: $('#unit_kerja_id').val() || '', grade12: grade12On() });
|
||||||
$('#export-excel').attr('href', '{{ route('lainnya.simulasi-jabatan.export') }}?' + params.toString());
|
$('#export-excel').attr('href', '{{ route('lainnya.simulasi-jabatan.export') }}?' + params.toString());
|
||||||
}
|
}
|
||||||
$('#periode, #jenis_pegawai, #unit_kerja_id').on('change', updateExportUrl);
|
// Kembalikan pilihan checkbox dari sesi sebelumnya.
|
||||||
|
try {
|
||||||
|
if (localStorage.getItem('simulasi-jabatan:grade12') === '1') $('#grade12').prop('checked', true);
|
||||||
|
} catch (e) {}
|
||||||
|
$('#periode, #jenis_pegawai, #unit_kerja_id, #grade12').on('change', updateExportUrl);
|
||||||
updateExportUrl();
|
updateExportUrl();
|
||||||
$('#unit_kerja_id, #jenis_pegawai, #periode').on('change', () => table.ajax.reload());
|
$('#unit_kerja_id, #jenis_pegawai, #periode').on('change', () => table.ajax.reload());
|
||||||
$('#unit_kerja_id, #jenis_pegawai, #periode').on('change', refreshSummary);
|
$('#unit_kerja_id, #jenis_pegawai, #periode').on('change', refreshSummary);
|
||||||
|
$('#grade12').on('change', function() {
|
||||||
|
try {
|
||||||
|
localStorage.setItem('simulasi-jabatan:grade12', this.checked ? '1' : '0');
|
||||||
|
} catch (e) {}
|
||||||
|
table.ajax.reload();
|
||||||
|
refreshSummary();
|
||||||
|
});
|
||||||
table.on('draw', refreshSummary);
|
table.on('draw', refreshSummary);
|
||||||
refreshSummary();
|
refreshSummary();
|
||||||
|
|
||||||
|
// ---- Visualisasi Total P2 per Unit Kerja (grafik batang) ----
|
||||||
|
var rpShort = function(v) {
|
||||||
|
v = Number(v) || 0;
|
||||||
|
if (Math.abs(v) >= 1e9) return 'Rp ' + (v / 1e9).toLocaleString('id-ID', { maximumFractionDigits: 2 }) + ' M';
|
||||||
|
if (Math.abs(v) >= 1e6) return 'Rp ' + (v / 1e6).toLocaleString('id-ID', { maximumFractionDigits: 1 }) + ' jt';
|
||||||
|
return 'Rp ' + v.toLocaleString('id-ID');
|
||||||
|
};
|
||||||
|
var rpFull = function(v) {
|
||||||
|
return 'Rp ' + (Number(v) || 0).toLocaleString('id-ID', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||||
|
};
|
||||||
|
var shortToFull = {};
|
||||||
|
|
||||||
|
function baseChartOptions() {
|
||||||
|
return {
|
||||||
|
chart: { type: 'bar', height: 340, toolbar: { show: false }, fontFamily: 'inherit' },
|
||||||
|
plotOptions: { bar: { columnWidth: '75%', borderRadius: 3 } },
|
||||||
|
dataLabels: { enabled: false },
|
||||||
|
stroke: { show: true, width: 2, colors: ['transparent'] },
|
||||||
|
colors: ['#4e73df', '#1cc88a', '#f6c23e'],
|
||||||
|
series: [],
|
||||||
|
xaxis: { categories: [] },
|
||||||
|
yaxis: { labels: { formatter: rpShort } },
|
||||||
|
legend: { position: 'top', horizontalAlign: 'left' },
|
||||||
|
grid: { borderColor: '#edf0f3' },
|
||||||
|
tooltip: {
|
||||||
|
shared: true,
|
||||||
|
intersect: false,
|
||||||
|
y: { formatter: rpFull },
|
||||||
|
x: { formatter: function(val) { return shortToFull[val] || val; } }
|
||||||
|
},
|
||||||
|
noData: { text: 'Memuat data…' }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var chartP2 = new ApexCharts(document.querySelector('#chart-p2-unit'), baseChartOptions());
|
||||||
|
var chartP2g12 = new ApexCharts(document.querySelector('#chart-p2-unit-g12'), baseChartOptions());
|
||||||
|
chartP2.render();
|
||||||
|
chartP2g12.render();
|
||||||
|
|
||||||
|
function loadCharts() {
|
||||||
|
$.get('{{ route('lainnya.simulasi-jabatan.chart') }}', {
|
||||||
|
periode: $('#periode').val(),
|
||||||
|
jenis_pegawai: $('#jenis_pegawai').val()
|
||||||
|
}, function(res) {
|
||||||
|
var cats = res.map(function(r) { return r.unit_kerja_short; });
|
||||||
|
shortToFull = {};
|
||||||
|
res.forEach(function(r) { shortToFull[r.unit_kerja_short] = r.unit_kerja + ' (' + r.pegawai + ' pegawai)'; });
|
||||||
|
|
||||||
|
chartP2.updateOptions({ xaxis: { categories: cats } });
|
||||||
|
chartP2.updateSeries([
|
||||||
|
{ name: 'P2 2022', data: res.map(function(r) { return r.p2_374; }) },
|
||||||
|
{ name: 'P2 2023', data: res.map(function(r) { return r.p2_377; }) },
|
||||||
|
{ name: 'P2 Excel', data: res.map(function(r) { return r.p2_excel; }) }
|
||||||
|
]);
|
||||||
|
|
||||||
|
chartP2g12.updateOptions({ xaxis: { categories: cats } });
|
||||||
|
chartP2g12.updateSeries([
|
||||||
|
{ name: 'P2 2022 (+12)', data: res.map(function(r) { return r.p2_374_g12; }) },
|
||||||
|
{ name: 'P2 2023 (+12)', data: res.map(function(r) { return r.p2_377_g12; }) },
|
||||||
|
{ name: 'P2 Excel (+12)', data: res.map(function(r) { return r.p2_excel_g12; }) }
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$('#periode, #jenis_pegawai').on('change', loadCharts);
|
||||||
|
loadCharts();
|
||||||
|
|
||||||
$('#warm-cache-btn').on('click', function() {
|
$('#warm-cache-btn').on('click', function() {
|
||||||
var $btn = $(this);
|
var $btn = $(this);
|
||||||
var modalEl = document.getElementById('warmCacheModal');
|
var modalEl = document.getElementById('warmCacheModal');
|
||||||
@@ -364,6 +478,7 @@
|
|||||||
' baris (' + (res.seconds || 0) + ' detik).');
|
' baris (' + (res.seconds || 0) + ' detik).');
|
||||||
table.ajax.reload(null, false);
|
table.ajax.reload(null, false);
|
||||||
refreshSummary();
|
refreshSummary();
|
||||||
|
loadCharts();
|
||||||
}, 450);
|
}, 450);
|
||||||
}).fail(function(xhr) {
|
}).fail(function(xhr) {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
@@ -412,7 +527,8 @@
|
|||||||
var detailUrl = '{{ route('lainnya.simulasi-jabatan.detail', ['nip' => '__NIP__']) }}'
|
var detailUrl = '{{ route('lainnya.simulasi-jabatan.detail', ['nip' => '__NIP__']) }}'
|
||||||
.replace('__NIP__', nip) + '?poin_kegiatan=' + encodeURIComponent(poinKegiatan) +
|
.replace('__NIP__', nip) + '?poin_kegiatan=' + encodeURIComponent(poinKegiatan) +
|
||||||
'&total_poin=' + encodeURIComponent(totalPoin) + '&poin_adhoc=' + encodeURIComponent(
|
'&total_poin=' + encodeURIComponent(totalPoin) + '&poin_adhoc=' + encodeURIComponent(
|
||||||
poinAdhoc) + '&periode=' + encodeURIComponent($('#periode').val() || '');
|
poinAdhoc) + '&periode=' + encodeURIComponent($('#periode').val() || '') +
|
||||||
|
'&grade12=' + grade12On();
|
||||||
$.get(detailUrl, function(res) {
|
$.get(detailUrl, function(res) {
|
||||||
$('#detail-nama-pegawai').text(res.pegawai || rowData.nama_pegawai || '-');
|
$('#detail-nama-pegawai').text(res.pegawai || rowData.nama_pegawai || '-');
|
||||||
// "Poin Non Adhoc" disamakan dengan kolom "Poin P2" pada tabel Jabatan Fungsional.
|
// "Poin Non Adhoc" disamakan dengan kolom "Poin P2" pada tabel Jabatan Fungsional.
|
||||||
|
|||||||
@@ -369,7 +369,7 @@
|
|||||||
</li>
|
</li>
|
||||||
@endcanany
|
@endcanany
|
||||||
|
|
||||||
{{-- @canany(['Baca Presensi', 'Baca Presensi Honorer'])
|
@canany(['Baca Presensi', 'Baca Presensi Honorer'])
|
||||||
<li class="side-nav-item si-pengajuan-presensi">
|
<li class="side-nav-item si-pengajuan-presensi">
|
||||||
<a data-bs-toggle="collapse" href="#sidebarPengajuanPresensi" aria-expanded="false"
|
<a data-bs-toggle="collapse" href="#sidebarPengajuanPresensi" aria-expanded="false"
|
||||||
aria-controls="sidebarPengajuanPresensi" class="side-nav-link ni-pengajuan-presensi">
|
aria-controls="sidebarPengajuanPresensi" class="side-nav-link ni-pengajuan-presensi">
|
||||||
@@ -399,7 +399,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@endcanany --}}
|
@endcanany
|
||||||
|
|
||||||
{{-- @canany(['Baca Pengajuan Aktivitas'])
|
{{-- @canany(['Baca Pengajuan Aktivitas'])
|
||||||
<li class="side-nav-item si-pengajuan-aktivitas">
|
<li class="side-nav-item si-pengajuan-aktivitas">
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ Route::prefix('/lainnya')->name('lainnya.')->group(function () {
|
|||||||
Route::get('/', [SimulasiJabatanController::class, 'index'])->name('index');
|
Route::get('/', [SimulasiJabatanController::class, 'index'])->name('index');
|
||||||
Route::get('/data', [SimulasiJabatanController::class, 'data'])->name('data');
|
Route::get('/data', [SimulasiJabatanController::class, 'data'])->name('data');
|
||||||
Route::get('/summary', [SimulasiJabatanController::class, 'summary'])->name('summary');
|
Route::get('/summary', [SimulasiJabatanController::class, 'summary'])->name('summary');
|
||||||
|
Route::get('/chart', [SimulasiJabatanController::class, 'chart'])->name('chart');
|
||||||
Route::get('/export', [SimulasiJabatanController::class, 'export'])->name('export');
|
Route::get('/export', [SimulasiJabatanController::class, 'export'])->name('export');
|
||||||
Route::post('/warm-cache', [SimulasiJabatanController::class, 'warmCache'])->name('warm-cache');
|
Route::post('/warm-cache', [SimulasiJabatanController::class, 'warmCache'])->name('warm-cache');
|
||||||
Route::get('/detail/{nip}', [SimulasiJabatanController::class, 'detail'])->name('detail');
|
Route::get('/detail/{nip}', [SimulasiJabatanController::class, 'detail'])->name('detail');
|
||||||
|
|||||||
Reference in New Issue
Block a user