Manage Pay Elements
Manage Pay Elements
Define earnings and deduction components used in payroll calculations. Each pay element represents a line item on an employee's payslip (e.g., Basic Salary, House Rent Allowance, Income Tax deduction).
Fields
- Element Code - Short code identifier
- Element Name - Descriptive name (e.g., "House Rent Allowance")
- Element Category - Basic, Allowance, Deduction, Employer Contribution, Statutory Deduction, Bonus, or Reimbursement
- GL Account - Account where earnings/deductions are posted
- Employer Account - GL account for employer contribution (optional)
- Element Type - Earnings or Deduction
- Amount Type - How the amount is calculated (see below)
- Default Amount - Base amount or rate used for Fixed, Percentage, and Attendance-Based types
- Formula - Arithmetic expression (required when Amount Type is Formula)
- Taxable - Whether this element counts toward taxable income
- Affects Gross - Whether this element is included in GROSS calculations
- Minimum Amount / Maximum Amount - Optional bounds on calculated values
- Display Order - Ordering on payslip
Amount Types
The Amount Type determines how each element is calculated during payroll:
| Type | Code | How It Calculates |
| Fixed Amount | 0 | Uses the Default Amount directly |
| Percentage of Basic | 1 | Default Amount (as %) x Basic Salary / 100 |
| Percentage of Gross | 2 | Default Amount (as %) x Current Gross / 100 |
| Formula | 3 | Evaluates a custom formula expression |
| Attendance Based | 4 | Default Amount x (Days Worked / Working Days) |
Formula Amount Type
When Amount Type is set to Formula, the system evaluates the expression in the Formula field using the payroll formula engine.
Formulas are arithmetic expressions that can use built-in variables:
| Variable | Description | Example Value |
BASIC | Employee base salary for the period | 5000.00 |
GROSS | Basic + all earnings calculated so far (cascading) | 5500.00 |
DAYS_WORKED | Actual days worked (from attendance) | 20.0 |
WORKING_DAYS | Total working days in period (excl. weekends/holidays) | 22.0 |
DAYS_IN_MONTH | Alias for WORKING_DAYS (compatibility) | 22.0 |
OVERTIME_HOURS | Total overtime hours in period | 8.5 |
UNPAID_LEAVE_DAYS | Days of unpaid absence | 2.0 |
HOURLY_RATE | BASIC / WORKING_DAYS / 8 | 28.41 |
Supported operators: + - * / % (modulo) and parentheses ( )
Variables are case-insensitive (basic, Basic, and BASIC all work).
Formula Examples
| Pay Element | Formula | Explanation |
| House Rent Allowance | BASIC * 0.10 | 10% of basic salary |
| Dearness Allowance | BASIC * 0.05 | 5% of basic salary |
| Conveyance Allowance | BASIC * 0.08 | 8% of basic salary |
| Overtime Pay | HOURLY_RATE * OVERTIME_HOURS * 1.5 | 1.5x overtime rate |
| Absence Deduction | (BASIC / WORKING_DAYS) * UNPAID_LEAVE_DAYS | Deduct per absent day |
| Performance Bonus | GROSS * 0.10 | 10% of total earnings so far |
| Leave Encashment | (BASIC / WORKING_DAYS) * DAYS_WORKED | Pro-rata by attendance |
Cascading GROSS Behavior
The GROSS variable is recalculated after each component. This means later elements can reference the cumulative total of all prior earnings:
- Basic Salary: 5000 -> GROSS = 5000
- HRA (
BASIC * 0.10): 500 -> GROSS = 5500 - Bonus (
GROSS * 0.05): 275 (5% of 5500) -> GROSS = 5775
This cascading behavior lets you build complex salary structures where components depend on each other.
Formula Priority (Three-Level Override)
Formulas can be defined at three levels, with the most specific taking precedence:
- Employee Override (highest priority) - Personal formula for a specific employee
- Salary Structure (mid priority) - Formula for a specific job grade/position
- Pay Element Default (lowest priority) - Fallback formula used when no override exists
Example: The HRA element might default to BASIC * 0.10, but the "Senior Manager" salary structure overrides it to BASIC * 0.15, and a specific employee might have BASIC * 0.20.
Error Handling
- Invalid formulas silently return 0.00 (no error displayed)
- Division by zero returns 0.00
- Only numbers, operators (
+ - * / %) and parentheses are allowed (all other characters are rejected for security) - The formula used for each payslip line is recorded in the audit trail
Tips
- Test formulas by creating a test payslip and reviewing the calculated amounts
- Use parentheses to control calculation order:
(BASIC + 500) * 0.10differs fromBASIC + 500 * 0.10 - The Display Order field controls the sequence in which elements appear on the payslip and the order in which GROSS is accumulated
See Also
- Payroll Formula System - Complete formula reference
- Salary Structure - Override formulas per grade/position
- Employees - Override formulas per employee
- Payslip Entry - Where formulas are evaluated