# Payroll Prorata

## Rule Aktif

Mode prorata memakai HK efektif profil bulan, bukan angka hardcode.

```text
Jam efektif periode = HK efektif profil × jam kerja per hari
Gapok per jam       = Gapok profil / jam efektif periode
Gapok dibayar       = Gapok per jam × jam dibayar
Tunjangan dibayar   = Tunjangan profil / HK efektif × HK hadir
```

## Komponen

- Gapok: berbasis `billed_hours`; telat/jam kurang mengurangi nilai.
- Tunjangan tetap/jabatan/keahlian: berbasis HK hadir.
- Insentif: nominal penuh, tidak diprorata.
- Lembur: memakai engine lembur.
- Reimburse: nominal penuh.
- BPJS: basis bulanan penuh sesuai rule BPJS.
- Legacy: tetap memakai kalkulasi lama.

## Contoh

```text
HK efektif       = 23
Jam kerja/hari   = 8
Jam efektif      = 184
Gapok profil     = Rp 12.524.000,00
Jam dibayar      = 32

Gapok per jam    = 12.524.000 / 184
Gapok dibayar    = Gapok per jam × 32
                 = Rp 2.178.086,96
```

## Cache Payroll

Setiap perubahan formula wajib menaikkan `PAYROLL_CALCULATION_VERSION`. Dataset background dengan versi lama tidak boleh dipakai.

## BPJS Potongan Payroll

Kolom BPJS hanya menampilkan program yang memenuhi kedua kondisi:

```text
is_enrolled = true
deduct_to_payroll = true
```

Program perusahaan murni seperti JKK/JKM tidak ditampilkan sebagai potongan karyawan.
Total kolom BPJS menjumlahkan `employee_nominal` dari program pemotong payroll.
