TransportechAI Docs
FinancePayrollSalary Configuration

Formula Builder

How to use the visual formula builder to configure salary calculations.

The Formula Builder provides a visual interface for building salary calculation formulas. Instead of writing complex formulas manually, you select components, operators, and values to construct the calculation logic for each salary schema.

Available Component Types

The formula builder organizes components into three categories, each color-coded for easy identification.

Earning Components (Green)

These components add to an employee's gross pay:

ComponentDescription
Basic SalaryFixed monthly salary amount. This is the foundation of most salary schemas.
CommissionVariable earnings based on revenue or performance. Primarily used in driver schemas.
AllowancesFixed additional payments such as housing, transport, or meal allowances.
Overtime PayCalculated from the number of overtime hours worked beyond the standard schedule.
BonusOne-time or periodic bonus payments added to gross pay.

Deduction Components (Red)

These components reduce gross pay:

ComponentDescription
Income TaxTax withholding amount based on applicable tax rules.
Social SecurityEmployee contribution to social security.
Custom DeductionsAny additional deductions you have configured (e.g., uniform fees, transportation charges). See Deduction Components for details.

System Variables (Blue)

These are dynamic values the system calculates automatically based on employee activity:

VariableDescription
RevenueTotal revenue generated by the employee during the pay period. Commonly used for driver commission calculations.
Trip CountNumber of trips completed during the pay period.
Working DaysNumber of days the employee worked during the period.
Overtime HoursNumber of hours worked beyond the standard schedule.

Building a Formula

To build a salary formula:

  1. Click on components from the palette to add them to the formula area.
  2. Use operators to define relationships between components:
    • + (add) -- Combine earning items
    • - (subtract) -- Apply deductions
    • x (multiply) -- Calculate percentages or rates
    • / (divide) -- Split values
  3. Use parentheses ( ) to group parts of the formula and control calculation order.
  4. Enter numeric values where needed (e.g., fixed amounts, rates, multipliers).
  5. Preview the result to verify the formula produces the expected output.

Example Formulas

Staff Salary (Fixed)

A straightforward formula for office staff with a fixed salary:

Basic Salary + Allowances - Income Tax - Social Security

This takes the base salary, adds any fixed allowances, and then subtracts tax and social security contributions.

Driver Salary (Commission-Based)

A more complex formula for drivers whose earnings depend on revenue:

(Revenue x Commission Rate) + Base Pay + Allowances - Income Tax - Social Security - Loan Repayment

This calculates commission from revenue, adds a base pay and allowances, then subtracts all applicable deductions.

Staff with Overtime

For staff who are eligible for overtime pay:

Basic Salary + Allowances + (Overtime Hours x Overtime Rate) - Income Tax - Social Security

Commission Tiers

For driver-type schemas, you can define tiered commission rates based on revenue ranges. This means drivers earn higher commission percentages as they generate more revenue.

How Tiers Work

Each tier defines:

  • Minimum revenue -- The lower bound of the revenue range
  • Maximum revenue -- The upper bound of the revenue range
  • Commission rate -- The percentage applied to revenue within this range
  • Subsidies -- Optional dynamic subsidies (fuel, tolls, etc.) included at this tier

Example Commission Tiers

Revenue Range (AED)Commission RateSubsidies
0 -- 5,00015%Fuel subsidy
5,001 -- 10,00020%Fuel subsidy, Toll subsidy
10,001+25%Fuel subsidy, Toll subsidy, Maintenance subsidy

In this example, a driver who generates AED 12,000 in revenue would earn:

  • 15% on the first AED 5,000
  • 20% on the next AED 5,000
  • 25% on the remaining AED 2,000

Setting Up Tiers

  1. In the salary schema editor, navigate to the Commission Tiers section (available for driver schemas only).
  2. Click Add Tier to create a new revenue range.
  3. Enter the minimum and maximum revenue values.
  4. Set the commission rate percentage.
  5. Optionally add subsidies that apply at this tier level.
  6. Repeat for additional tiers.

Test your formula with sample values before assigning it to employees. Incorrect formulas will affect all assigned employees' payroll calculations. Use the preview feature to verify results with realistic numbers.

Tips for Building Formulas

  • Start simple -- Begin with the basic components (salary + allowances - deductions) and add complexity as needed.
  • Use the preview -- Always preview your formula with sample data to verify it calculates correctly.
  • Check parentheses -- Make sure grouped calculations are enclosed in parentheses so the order of operations is correct.
  • Name schemas clearly -- Use descriptive names like "Driver Standard Commission" or "Office Staff Basic" so it is easy to identify what each schema does.