Generate and Test Salary Component Formula
This feature allows testing a salary component formula against real employee data before applying it to actual payroll, without affecting any data in the system.
Activation Requirements
The user must have one of the following permissions:
- View all contracts
- View own contracts
Conditions for Opening the Side Panel
The side panel opens after all the following conditions are met:
- An item name is selected.
- An item type is selected (Earnings or Deductions).
- The salary component calculation method is set to Formula.
Steps to Start Testing
The side panel opens after all the following conditions are met:
- An item name is selected.
- An item type is selected (Earnings or Deductions).
- The salary component calculation method is set to Formula.
Steps to Start Testing
The panel is divided into two sections:
Right Section: Formula & Resolution
Section 1 — Formula Editor
- A multi-line text field for writing and editing the formula.
- Supports inserting data tokens by clicking any variable field below.
- Displays the condition field if an application condition has been pre-defined. If none is set, an Add Condition option appears. Existing conditions can be edited here.
Section 2 — Insertable Variables
Every field in these variables is clickable to insert its token into the formula at the cursor position.
- Employee Data — includes: code, name, department, role, and location custom fields.
- Contract Data — includes: basic salary, payroll frequency, currency, dates, allowances, and more.
- The token name is shown on hover over any field.
Section 3 — Salary Component Result
- Displays the formula after replacing tokens with actual values for the selected employee, contract, and period.
- Displays the resolved formula value — e.g.: delays × (day value × 0.5) = total.
- Displays the component type — addition or deduction.
- Displays condition data if present, or an option to add one.
Left Section: Simulation
Section 1 — Payroll Simulation
- Displays a full payslip for the selected period, including contract items (such as basic salary) plus the current component only.
- The current component is marked with a Simulated badge.
- Currency and rounding follow the employee’s contract settings.
Section 2 — Attendance Summary (Simulation)
Displays attendance data for the selected period with the following columns: Day Type, Attendance Status, Applicable?, Value.
Recalculate
- The Recalculate button reloads all panel content.
- Any change to the formula, condition, or period invalidates the simulation results until Recalculate is clicked.
Apply the Component
The Use This Formula button at the bottom of the side panel:
- Saves the formula and condition (if any) to the salary component fields.
- Closes the side panel.
Edge Cases
- Period outside contract range — The simulation is hidden and an alert message is shown.
- Missing base value — A warning appears on the affected row and the value is left blank.
- No attendance for the period — Rows appear with a No Record status; the formula may still calculate if it is independent of attendance.
- Missing custom field — The token resolves to null and a warning appears in the formula resolution section.
- Time range too large — Restricted to the payroll period and a message prompts the user to narrow the range.