Salary Calculation
Payroll calculation creates or updates Salary Records for a completed period.
Calculation workflow
Section titled “Calculation workflow”flowchart TD A[Active Salary Profile] --> B[Attendance Summary] B --> C[Overtime and Under-Hour Adjustment] C --> D[Allowances] D --> E[Gross Salary] E --> F[Income Tax] F --> G[Benefit Deductions] G --> H[Net Pay] H --> I[Salary Record]Inputs
Section titled “Inputs”| Input | Source |
|---|---|
| Base salary | Active salary profile. |
| Expected working hours | Attendance calculation for the selected period. |
| Total working hours | Attendance records for the selected period. |
| Overtime details | Attendance overtime policies and multipliers. |
| Buffer hours | Attendance buffer policy usage. |
| Allowances | Active salary profile allowances that overlap the period. |
| Benefit deductions | Active salary profile benefit deductions that overlap the period. |
| Tax slabs | Active income tax year and configured slabs. |
| Leave bonus | Cashable leave balances and leave policies. |
Verified formulas
Section titled “Verified formulas”| Value | Verified behavior |
|---|---|
| Hourly rate | Base salary divided by expected working hours. |
| Under hours | Expected working hours minus total working hours, not less than zero. |
| Overtime compensation | Buffer hours cover under-hours first. Then raw overtime covers remaining under-hours, using highest multipliers first. Only leftover overtime is paid. |
| Overtime pay | Paid adjusted overtime hours multiplied by hourly rate. |
| Under-hour deduction | Remaining uncompensated under-hours multiplied by the full-precision hourly rate, capped so gross salary cannot become negative. |
| Gross salary | Base salary + overtime pay + allowances - under-hour deductions. |
| Income tax | Calculated from taxable salary divisions using the active tax year and year-to-date counters. |
| Benefit deductions | Calculated after tax, using net pay after tax as the base for percentage deductions. |
| Net pay | Net pay after tax - benefit deductions, capped at zero. |
Simple example
Section titled “Simple example”If an employee has 7 under-hours, 4 buffer hours, and 4.5 raw overtime hours split across higher multipliers:
- Buffer covers 4 under-hours.
- 3 under-hours remain.
- Overtime raw hours cover the remaining under-hours.
- Only overtime left after this compensation is paid.
Restrictions
Section titled “Restrictions”- Payroll cannot be generated for a future period.
- A valid active income tax year must exist.
- The salary profile must be active and valid for the selected period.
- Invalid salary profile configuration is returned as a per-profile failure.
- Payroll records are unique by employee and period.