Skip to main content

👥 HR & Payroll Module (hr_*)

Modul HR menyimpan data karyawan, kehadiran, cuti, dan hasil perhitungan payroll yang pada akhirnya di-post ke GL.

1. Module Purpose

  • Menyimpan master karyawan per company.
  • Mencatat kehadiran (attendance) dan cuti.
  • Menyimpan hasil payroll per periode.

2. Tables & Structure


3. Key Fields & Relationships

3.1 hr_emp

  • Fields: company_id, emp_no, name, position, department, hire_date, status.
  • FK: company_idcore_company.id.

3.2 hr_att

  • Fields: emp_id, att_date, check_in, check_out, status (present, absent, leave, dsb.).
  • FK: emp_idhr_emp.id.

3.3 hr_leave

  • Fields: emp_id, start_date, end_date, type, status (requested, approved, rejected).
  • FK: emp_idhr_emp.id.

3.4 hr_payroll

  • Fields: emp_id, period_start, period_end, gross_salary, deduction, net_salary, status.
  • FK: emp_idhr_emp.id.
  • Payroll batch bisa di-post ke GL via mapping COA (beban gaji, kas, utang gaji).

4. Business Flows

4.1 Kehadiran & Cuti → Payroll

  1. Kehadiran harian dicatat di hr_att.
  2. Cuti/izin di hr_leave.
  3. Engine payroll mengambil data attendance & leave untuk menghitung gaji.
  4. Hasilnya disimpan di hr_payroll, lalu di-post ke GL (gl_entry + gl_line).

5. Example Reports (SQL)

Contoh SELECT untuk laporan HR & payroll.

5.1 Rekap Kehadiran per Karyawan

5.2 Rekap Payroll per Periode

5.3 Total Payroll per Departemen