Skip to content

HR — Data model

13 tables · auto-generated from migrations-v2/*.sql — do not edit by hand.

ER diagram

%%{init: {"theme":"base","themeVariables":{"darkMode":true,"background":"#1e1e1e","primaryColor":"#2d2d30","primaryBorderColor":"#569cd6","primaryTextColor":"#d4d4d4","lineColor":"#6796c6","secondaryColor":"#3a3d41","secondaryBorderColor":"#dcdcaa","secondaryTextColor":"#d4d4d4","tertiaryColor":"#252526","tertiaryBorderColor":"#569cd6","noteBkgColor":"#3a3d41","noteTextColor":"#dcdcaa","clusterBkg":"#252526","clusterBorder":"#569cd6","titleColor":"#569cd6","attributeBackgroundColorOdd":"#252526","attributeBackgroundColorEven":"#2d2d30"},"er":{"useMaxWidth":false}}}%%
erDiagram
  HR_PAYROLL_EMPLOYEE {
    integer id PK
    text company_id FK
    integer party_id FK
    text employee_code
    text status
    text hire_date
    text employment_type
    text sso_number
  }
  HR_PAYROLL_EMPLOYMENT_CONTRACT {
    integer id PK
    text company_id FK
    integer employee_id FK
    integer position_id FK
    integer contract_seq
    text start_date
    text end_date
    numeric base_pay
  }
  HR_PAYROLL_INCOME_TAX_ALLOWANCE {
    integer id PK
    integer policy_id FK
    text company_id
    text code
    text label
    numeric amount
    numeric cap
    integer automatic
  }
  HR_PAYROLL_INCOME_TAX_BRACKET {
    integer id PK
    integer policy_id FK
    text company_id
    integer seq
    numeric lower_bound
    numeric upper_bound
    numeric rate
  }
  HR_PAYROLL_INCOME_TAX_POLICY {
    integer id PK
    text company_id
    text jurisdiction
    text code
    text effective_from
    text effective_to
    integer periods_per_year
    numeric expense_rate
  }
  HR_PAYROLL_LEAVE_LEDGER_ENTRY {
    integer id PK
    text company_id FK
    integer employee_id FK
    integer reversal_of_id FK
    text leave_type_code
    text entry_kind
    numeric days
    text effective_date
  }
  HR_PAYROLL_ORG_UNIT {
    integer id PK
    text company_id FK
    integer parent_id FK
    integer manager_employee_id FK
    text code
    text name
    text dimension_values
    integer is_active
  }
  HR_PAYROLL_PAYSLIP {
    integer id PK
    text company_id FK
    integer run_id FK
    integer employee_id FK
    text payslip_no
    text state
    numeric gross_pay
    numeric sso_employee
  }
  HR_PAYROLL_PAYSLIP_LINE {
    integer id PK
    text company_id FK
    integer payslip_id FK
    integer line_no
    text component_code
    text kind
    text statutory_tag
    numeric amount
  }
  HR_PAYROLL_POSITION {
    integer id PK
    text company_id FK
    integer org_unit_id FK
    integer reports_to_position_id FK
    text code
    text title
    text grade_tag
    numeric headcount_budget
  }
  HR_PAYROLL_RUN {
    integer id PK
    text company_id FK
    integer doc_id FK
    text run_no
    text period_start
    text period_end
    text pay_date
    integer period_no
  }
  HR_PAYROLL_SALARY_COMPONENT {
    integer id PK
    text company_id
    text code
    text name
    text kind
    integer taxable
    integer sso_wage_base
    text statutory_tag
  }
  HR_PAYROLL_STATUTORY_SCHEME {
    integer id PK
    text company_id
    text scheme_kind
    text code
    text effective_from
    text effective_to
    numeric employee_rate
    numeric employer_rate
  }
  HR_PAYROLL_EMPLOYEE ||--o{ HR_PAYROLL_EMPLOYMENT_CONTRACT : employee
  HR_PAYROLL_POSITION ||--o{ HR_PAYROLL_EMPLOYMENT_CONTRACT : position
  HR_PAYROLL_INCOME_TAX_POLICY ||--o{ HR_PAYROLL_INCOME_TAX_ALLOWANCE : policy
  HR_PAYROLL_INCOME_TAX_POLICY ||--o{ HR_PAYROLL_INCOME_TAX_BRACKET : policy
  HR_PAYROLL_EMPLOYEE ||--o{ HR_PAYROLL_LEAVE_LEDGER_ENTRY : employee
  HR_PAYROLL_LEAVE_LEDGER_ENTRY ||--o{ HR_PAYROLL_LEAVE_LEDGER_ENTRY : reversal_of
  HR_PAYROLL_ORG_UNIT ||--o{ HR_PAYROLL_ORG_UNIT : parent
  HR_PAYROLL_EMPLOYEE ||--o{ HR_PAYROLL_ORG_UNIT : manager_employee
  HR_PAYROLL_RUN ||--o{ HR_PAYROLL_PAYSLIP : run
  HR_PAYROLL_EMPLOYEE ||--o{ HR_PAYROLL_PAYSLIP : employee
  HR_PAYROLL_PAYSLIP ||--o{ HR_PAYROLL_PAYSLIP_LINE : payslip
  HR_PAYROLL_ORG_UNIT ||--o{ HR_PAYROLL_POSITION : org_unit
  HR_PAYROLL_POSITION ||--o{ HR_PAYROLL_POSITION : reports_to_position

Cross-module references

  • HR_PAYROLL_EMPLOYEE.company_idCOMPANY (core)
  • HR_PAYROLL_EMPLOYEE.party_idPARTY (core)
  • HR_PAYROLL_EMPLOYMENT_CONTRACT.company_idCOMPANY (core)
  • HR_PAYROLL_LEAVE_LEDGER_ENTRY.company_idCOMPANY (core)
  • HR_PAYROLL_ORG_UNIT.company_idCOMPANY (core)
  • HR_PAYROLL_PAYSLIP.company_idCOMPANY (core)
  • HR_PAYROLL_PAYSLIP_LINE.company_idCOMPANY (core)
  • HR_PAYROLL_POSITION.company_idCOMPANY (core)
  • HR_PAYROLL_RUN.company_idCOMPANY (core)
  • HR_PAYROLL_RUN.doc_idDOCUMENT (core)

Data dictionary

erp_hr_payroll_employee · 19 cols
column type key references
id integer PK
company_id text FK erp_company
party_id integer FK erp_party
employee_code text
status text
hire_date text
employment_type text
sso_number text
taxpayer_id text
payment_method text
payment_account_ref text
base_salary numeric
ytd_taxable_income numeric
ytd_pit_withheld numeric
ytd_sso_employee numeric
tax_allowance_claims text
custom_fields text
created_at integer
updated_at integer
erp_hr_payroll_employment_contract · 15 cols
column type key references
id integer PK
company_id text FK erp_company
employee_id integer FK erp_hr_payroll_employee
position_id integer FK erp_hr_payroll_position
contract_seq integer
start_date text
end_date text
base_pay numeric
pay_basis text
salary_structure_code text
status text
termination_reason text
custom_fields text
created_at integer
updated_at integer
erp_hr_payroll_income_tax_allowance · 9 cols
column type key references
id integer PK
company_id text
policy_id integer FK erp_hr_payroll_income_tax_policy
code text
label text
amount numeric
cap numeric
automatic integer
formula_ref text
erp_hr_payroll_income_tax_bracket · 7 cols
column type key references
id integer PK
company_id text
policy_id integer FK erp_hr_payroll_income_tax_policy
seq integer
lower_bound numeric
upper_bound numeric
rate numeric
erp_hr_payroll_income_tax_policy · 12 cols
column type key references
id integer PK
company_id text
jurisdiction text
code text
effective_from text
effective_to text
periods_per_year integer
expense_rate numeric
expense_cap numeric
currency_code text
rounding_mode text
created_at integer
erp_hr_payroll_leave_ledger_entry · 12 cols
column type key references
id integer PK
company_id text FK erp_company
employee_id integer FK erp_hr_payroll_employee
leave_type_code text
entry_kind text
days numeric
effective_date text
validity_from text
validity_to text
origin_ref text
reversal_of_id integer FK erp_hr_payroll_leave_ledger_entry
created_at integer
erp_hr_payroll_org_unit · 10 cols
column type key references
id integer PK
company_id text FK erp_company
code text
name text
parent_id integer FK erp_hr_payroll_org_unit
manager_employee_id integer FK erp_hr_payroll_employee
dimension_values text
is_active integer
created_at integer
updated_at integer
erp_hr_payroll_payslip · 16 cols
column type key references
id integer PK
company_id text FK erp_company
run_id integer FK erp_hr_payroll_run
employee_id integer FK erp_hr_payroll_employee
payslip_no text
state text
gross_pay numeric
sso_employee numeric
sso_employer numeric
pit_withheld numeric
net_pay numeric
employer_cost numeric
tax_worksheet text
sso_worksheet text
ytd_snapshot text
created_at integer
erp_hr_payroll_payslip_line · 12 cols
column type key references
id integer PK
company_id text FK erp_company
payslip_id integer FK erp_hr_payroll_payslip
line_no integer
component_code text
kind text
statutory_tag text
amount numeric
posting_transaction_kind text
dimension_values text
snapshot text
created_at integer
erp_hr_payroll_position · 11 cols
column type key references
id integer PK
company_id text FK erp_company
code text
title text
org_unit_id integer FK erp_hr_payroll_org_unit
grade_tag text
reports_to_position_id integer FK erp_hr_payroll_position
headcount_budget numeric
is_active integer
created_at integer
updated_at integer
erp_hr_payroll_run · 22 cols
column type key references
id integer PK
company_id text FK erp_company
doc_id integer FK erp_document
run_no text
period_start text
period_end text
pay_date text
period_no integer
periods_per_year integer
run_type text
state text
gross_total numeric
deduction_total numeric
employer_cost_total numeric
net_total numeric
sso_employee_total numeric
sso_employer_total numeric
pit_total numeric
calculation_status text
error_detail text
created_at integer
updated_at integer
erp_hr_payroll_salary_component · 13 cols
column type key references
id integer PK
company_id text
code text
name text
kind text
taxable integer
sso_wage_base integer
statutory_tag text
posting_transaction_kind text
display_order integer
formula_ref text
effective_from text
effective_to text
erp_hr_payroll_statutory_scheme · 14 cols
column type key references
id integer PK
company_id text
scheme_kind text
code text
effective_from text
effective_to text
employee_rate numeric
employer_rate numeric
wage_floor numeric
wage_cap numeric
rounding_mode text
filing_form_tag text
remittance_due_day integer
created_at integer