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:

TypeCodeHow It Calculates
Fixed Amount0Uses the Default Amount directly
Percentage of Basic1Default Amount (as %) x Basic Salary / 100
Percentage of Gross2Default Amount (as %) x Current Gross / 100
Formula3Evaluates a custom formula expression
Attendance Based4Default 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:

VariableDescriptionExample Value
BASICEmployee base salary for the period5000.00
GROSSBasic + all earnings calculated so far (cascading)5500.00
DAYS_WORKEDActual days worked (from attendance)20.0
WORKING_DAYSTotal working days in period (excl. weekends/holidays)22.0
DAYS_IN_MONTHAlias for WORKING_DAYS (compatibility)22.0
OVERTIME_HOURSTotal overtime hours in period8.5
UNPAID_LEAVE_DAYSDays of unpaid absence2.0
HOURLY_RATEBASIC / WORKING_DAYS / 828.41

Supported operators: + - * / % (modulo) and parentheses ( )

Variables are case-insensitive (basic, Basic, and BASIC all work).

Formula Examples

Pay ElementFormulaExplanation
House Rent AllowanceBASIC * 0.1010% of basic salary
Dearness AllowanceBASIC * 0.055% of basic salary
Conveyance AllowanceBASIC * 0.088% of basic salary
Overtime PayHOURLY_RATE * OVERTIME_HOURS * 1.51.5x overtime rate
Absence Deduction(BASIC / WORKING_DAYS) * UNPAID_LEAVE_DAYSDeduct per absent day
Performance BonusGROSS * 0.1010% of total earnings so far
Leave Encashment(BASIC / WORKING_DAYS) * DAYS_WORKEDPro-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:

  1. Basic Salary: 5000 -> GROSS = 5000
  2. HRA (BASIC * 0.10): 500 -> GROSS = 5500
  3. 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:

  1. Employee Override (highest priority) - Personal formula for a specific employee
  2. Salary Structure (mid priority) - Formula for a specific job grade/position
  3. 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.10 differs from BASIC + 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