Mintage Payroll ·

Year-to-date PAYE checks and our first tests

April's big piece: a year-to-date engine that compares the PAYE an employee should have paid with what they actually paid, plus the first automated tests for our tax maths.

2 min read142 commits that monthPAYETestingPayslips

Looking at the whole year, not just this period

PAYE is calculated each pay period, but it is really an annual tax. If someone's pay changes during the year, or they join partway through, period-by-period calculations can drift from what they should owe for the year so far.

In April we built a year-to-date engine. For each employee it adds up taxable income, NIS and insurance contributions and the PAYE already paid across the year, then works out what PAYE should have been for the periods they actually worked. If the employee has paid too little, payroll now adds the difference so the right amount reaches the GRA. Overpayments are calculated too, and a PAYE refund line was added so money can be returned to an employee without being taxed again.

Tests for the tax maths

Changing tax calculations without a safety net is risky. This month we added our first automated test suite, starting with the PAYE calculations for 2021 and 2022 across monthly, fortnightly and weekly pay. The tests run automatically with every change, so a mistake in the tax code shows up before it reaches a payslip. After March's corrections, this felt overdue.

Payslips and payroll tools

We introduced a new payslip generator with a choice of templates, including a compact layout, and the template can be set per installation. Payroll can now show overtime, custom allowances and custom fields by pay period. For the team, new commands make it possible to rebuild a year's payroll figures or reseed a test setup in one step. Across 142 commits it was the busiest month of the year.

This article was written from Mintage Payroll’s commit history for April 2022. See Mintage Payroll today