Skip to content

Overtime past the contract's hours, by where the hour fell

The rule

A person on a 40-hour contract is paid the basic rate for their first 40 hours of work in the week, whenever in the day they fall: an hour worked before the shift starts, or after it ends, is basic time if the week has not yet reached 40 hours worked. Only past 40 is there overtime. Its rate can then depend on where the hour fell: time and a quarter before the shift starts and double time after it, say, and double time on a Sunday.

Paid leave and holiday pay are not hours worked, so they never count toward the 40: in a short week with a holiday on Wednesday, Monday’s early hour and Thursday’s late hour are paid basic.

Who uses it

UK and EU employers whose contracts pay overtime only past the contract’s hours, and part-time contracts (a person on 20 hours is paid basic for their first 20 hours worked).

How the recipe does it

Configuration only: a package (package.toml) of one policy layer.

[[layer.step]]
id = "position"
uses = "standard/shift_position"
params = { before = "before_shift", after = "after_shift" }
[[layer.step]]
id = "weekly"
uses = "standard/threshold"
params = { over = "40h", over_attribute = "contract_hours", to = "overtime", window = "week", take_first = ["before_shift", "after_shift"] }
[[layer.step]]
id = "overtime-position"
uses = "standard/shift_position"
params = { counts = ["overtime"], before = "overtime_before", during = "overtime_during", after = "overtime_after", unscheduled = "during" }
  • shift_position labels each day’s work as before the day’s shifts, after them, or inside them, into categories named by its params.
  • threshold counts the week’s worked hours (leave and holiday pay are not worked), and what is past over is overtime. over_attribute is the person’s own limit: the employment attribute contract_hours (“20h”, or 20 hours as a number); a person with none has over, 40 hours.
  • take_first says which hours: the time before the shift first, then the time after it, then the latest of what is left. That is the employer’s choice: a layer of the tenant’s that changes it (below) makes the hours after the shift go first, or empties it for the latest hours of the week.
  • The second shift_position runs over the overtime the threshold made, and says where each overtime hour fell. On a day with no shift (a Sunday) the overtime is overtime_during.
  • window_premium makes the Sunday’s overtime its own category, and earnings pays each category its rate in per cent of the basic rate: overtime_before 125, overtime_during 125, overtime_after 200, sunday_overtime 200.

A tenant that takes the hours after the shift first changes the one param:

[[layer]]
id = "after-first"
order = 30
[[layer.step]]
id = "weekly"
change = "params"
params = { take_first = ["after_shift", "before_shift"] }

Parameters

ParameterMeaning (default)
threshold overThe contract’s hours in the week (40h).
threshold over_attributeThe employment attribute that is the person’s own hours (contract_hours).
threshold take_firstWhich hours are overtime first, in order (before_shift, after_shift), then the latest.
shift_position before, during, after, between, unscheduledThe categories, and what time between shifts and on a day with no shift is.
earnings premiumsThe rate of each category in per cent of the basic rate.

What the scenarios show

  • hours-before-the-shift-past-40-are-time-and-a-quarter: 3 hours before a shift and 2 after, 42 worked: the two latest hours before a shift are the overtime at 125, and the other early and late hours are basic.
  • hours-after-the-shift-past-40-are-double-time: the 4 hours past 40 are all after a shift: double time.
  • a-short-week-pays-the-early-hours-as-basic: a holiday on Wednesday, 34 hours worked: nothing is overtime.
  • a-part-timer-on-20-hours-works-20-basic-first: a contract of 20 hours.
  • sunday-overtime-is-double-time: Sunday’s overtime, whatever its place.
  • the-employer-chooses-the-hours-after-the-shift-first: the same week with the order changed by a layer.

Business rule

“If you work a 40-hour contract, overtime is paid only once you have worked 40 hours at basic time. After that the overtime rate depends on the time of day or the day: time and a quarter before your shift starts, double time after it.”

Overtime pay is mostly contractual in the UK and EU: the contract says the hours and the rates. Working-time limits (the 48-hour week, rest between shifts) are separate rules; the working_time_directive recipe checks them.

Get the recipe

The recipe’s package and its scenarios are in the example packages repository: attendance/uk_contract_overtime. Test it, or your own copy of it, with hourctl attend test, and publish it with hourctl attend pkg publish.

The policy package

The package’s layers, with the standard steps each one runs and their settings:

uk_contract_overtime/package.toml
name = "uk_contract_overtime"
version = "1.0.0"
description = "Overtime past the contract's hours, paid by where the hour fell against the shift: the hours before the shift at time and a quarter, after it at double time, on a Sunday at double time."
# What the tenant must have set up for the recipe: the steps read these by name.
[needs]
measures = ["wages"]
# Work for the contract's hours (40 a week, or the person's own
# `contract_hours`) is paid at the basic rate, whenever in the day it falls.
# Only past them is there overtime, and which hours it is, is the
# employer's choice: the time before the shift first (`take_first`), then
# the time after it, then the latest of the rest. Paid leave and holiday
# pay are not hours worked, so they never count toward the contract's hours.
#
# Each hour of the overtime is then said by where it fell, against the
# shift: before it, in it, or after it, and paid by that: time and a
# quarter before the shift (and within it), double time after it. Sunday's
# overtime is double time whatever its place. The rates are per cents of
# the basic rate (the `premiums` of `wages`).
[[layer]]
id = "contract"
[[layer.step]]
id = "holiday"
uses = "standard/holiday_pay"
params = { time = "scheduled", category = "holiday" }
[[layer.step]]
id = "position"
uses = "standard/shift_position"
params = { before = "before_shift", after = "after_shift" }
[[layer.step]]
id = "weekly"
uses = "standard/threshold"
params = { over = "40h", over_attribute = "contract_hours", to = "overtime", window = "week", take_first = ["before_shift", "after_shift"] }
[[layer.step]]
id = "overtime-position"
uses = "standard/shift_position"
params = { counts = ["overtime"], before = "overtime_before", during = "overtime_during", after = "overtime_after", unscheduled = "during" }
[[layer.step]]
id = "sunday"
uses = "standard/window_premium"
params = { during = { weekdays = ["sun"] }, counts = ["overtime_before", "overtime_during", "overtime_after"], category = "sunday_overtime" }
[[layer.step]]
id = "wages"
uses = "standard/earnings"
params = { rate = "pay", measure = "wages", premiums = { work = 100, before_shift = 100, after_shift = 100, holiday = 100, overtime_before = 125, overtime_during = 125, overtime_after = 200, sunday_overtime = 200 } }

Scenarios

Each scenario gives a person’s punches and setup and the timecard they must produce, worked out with this package adopted (the format).

A contract of 20 hours (the employment attribute contract_hours): shifts Monday and Tuesday 08:00 to 18:00; Monday from 07:00, Tuesday as scheduled and Wednesday 08:00 to 12:00, a day with no shift: 25 hours, the 5 past 20 are Monday's early hour (125) and Wednesday's 4 (the latest, on a day with no shift, said to be in a shift, 125)
scenarios/a-part-timer-on-20-hours-works-20-basic-first.toml
description = "A contract of 20 hours (the employment attribute contract_hours): shifts Monday and Tuesday 08:00 to 18:00; Monday from 07:00, Tuesday as scheduled and Wednesday 08:00 to 12:00, a day with no shift: 25 hours, the 5 past 20 are Monday's early hour (125) and Wednesday's 4 (the latest, on a day with no shift, said to be in a shift, 125)"
punch = [
{ at = "2026-10-05 07:00", kind = "in" }, { at = "2026-10-05 18:00", kind = "out" },
{ at = "2026-10-06 08:00", kind = "in" }, { at = "2026-10-06 18:00", kind = "out" },
{ at = "2026-10-07 08:00", kind = "in" }, { at = "2026-10-07 12:00", kind = "out" },
]
[policy]
zone = "Europe/London"
[[shift_definition]]
id = "part-time"
start = "08:00"
end = "18:00"
days = ["monday", "tuesday"]
[[measure]]
id = "wages"
kind = "money"
currency = "GBP"
[[rate]]
kind = "pay"
amount = 1600
currency = "GBP"
[[employment]]
effective = "2026-10-05"
kind = "hired"
attributes = { contract_hours = "20h" }
[expect]
week = "2026-10-05"
allocations = [
"2026-10-05 07:00-08:00 overtime_before 1.00",
"2026-10-05 08:00-18:00 work 10.00",
"2026-10-06 08:00-18:00 work 10.00",
"2026-10-07 08:00-12:00 overtime_during 4.00",
]
quantities = [
"2026-10-05 wages 20.00 GBP overtime_before",
"2026-10-06 wages 320.00 GBP work",
"2026-10-07 wages 80.00 GBP overtime_during",
]
Wednesday is a public holiday, paid 8 hours that are not worked: Monday's early hour and Thursday's late hour are within 34 hours worked, so they are basic, not overtime, though 42 hours are paid
scenarios/a-short-week-pays-the-early-hours-as-basic.toml
description = "Wednesday is a public holiday, paid 8 hours that are not worked: Monday's early hour and Thursday's late hour are within 34 hours worked, so they are basic, not overtime, though 42 hours are paid"
punch = [
{ at = "2026-10-05 07:00", kind = "in" }, { at = "2026-10-05 16:00", kind = "out" },
{ at = "2026-10-06 08:00", kind = "in" }, { at = "2026-10-06 16:00", kind = "out" },
{ at = "2026-10-08 08:00", kind = "in" }, { at = "2026-10-08 17:00", kind = "out" },
{ at = "2026-10-09 08:00", kind = "in" }, { at = "2026-10-09 16:00", kind = "out" },
]
[policy]
zone = "Europe/London"
[[shift_definition]]
id = "days"
start = "08:00"
end = "16:00"
days = ["monday", "tuesday", "wednesday", "thursday", "friday"]
[[measure]]
id = "wages"
kind = "money"
currency = "GBP"
[[rate]]
kind = "pay"
amount = 1600
currency = "GBP"
[[category]]
id = "holiday"
worked = false
[[holiday]]
id = "h"
name = "A bank holiday"
date = "2026-10-07"
[expect]
week = "2026-10-05"
allocations = [
"2026-10-05 07:00-08:00 before_shift 1.00",
"2026-10-05 08:00-16:00 work 8.00",
"2026-10-06 08:00-16:00 work 8.00",
"2026-10-07 untimed holiday 8.00",
"2026-10-08 08:00-16:00 work 8.00",
"2026-10-08 16:00-17:00 after_shift 1.00",
"2026-10-09 08:00-16:00 work 8.00",
]
quantities = [
"2026-10-05 wages 16.00 GBP before_shift",
"2026-10-07 wages 128.00 GBP holiday",
"2026-10-08 wages 16.00 GBP after_shift",
"2026-10-09 wages 512.00 GBP work",
]
Monday to Thursday 08:00 to 17:00 and Friday 08:00 to 16:00 (44 hours, the 4 past 40 all worked after a shift): they are overtime at 200
scenarios/hours-after-the-shift-past-40-are-double-time.toml
description = "Monday to Thursday 08:00 to 17:00 and Friday 08:00 to 16:00 (44 hours, the 4 past 40 all worked after a shift): they are overtime at 200"
punch = [
{ at = "2026-10-05 08:00", kind = "in" }, { at = "2026-10-05 17:00", kind = "out" },
{ at = "2026-10-06 08:00", kind = "in" }, { at = "2026-10-06 17:00", kind = "out" },
{ at = "2026-10-07 08:00", kind = "in" }, { at = "2026-10-07 17:00", kind = "out" },
{ at = "2026-10-08 08:00", kind = "in" }, { at = "2026-10-08 17:00", kind = "out" },
{ at = "2026-10-09 08:00", kind = "in" }, { at = "2026-10-09 16:00", kind = "out" },
]
[policy]
zone = "Europe/London"
[[shift_definition]]
id = "days"
start = "08:00"
end = "16:00"
days = ["monday", "tuesday", "wednesday", "thursday", "friday"]
[[measure]]
id = "wages"
kind = "money"
currency = "GBP"
[[rate]]
kind = "pay"
amount = 1600
currency = "GBP"
[expect]
week = "2026-10-05"
allocations = [
"2026-10-05 08:00-16:00 work 8.00",
"2026-10-05 16:00-17:00 overtime_after 1.00",
"2026-10-06 08:00-16:00 work 8.00",
"2026-10-06 16:00-17:00 overtime_after 1.00",
"2026-10-07 08:00-16:00 work 8.00",
"2026-10-07 16:00-17:00 overtime_after 1.00",
"2026-10-08 08:00-16:00 work 8.00",
"2026-10-08 16:00-17:00 overtime_after 1.00",
"2026-10-09 08:00-16:00 work 8.00",
]
quantities = [
"2026-10-08 wages 128.00 GBP overtime_after",
"2026-10-09 wages 640.00 GBP work",
]
Hours past 40 are overtime, the ones before the shift first: Mon 06:00 to 16:00, Tue 08:00 to 17:00, Wed 07:00 to 16:00, Thu 08:00 to 17:00, Fri 08:00 to 13:00 against 08:00 to 16:00 shifts: 37 hours in them, 3 before and 2 after, 42 in all. The two latest hours before a shift (Wednesday's, and Monday's 07:00 to 08:00) are overtime at 125; the other early and late hours are basic, as they are within the 40
scenarios/hours-before-the-shift-past-40-are-time-and-a-quarter.toml
description = "Hours past 40 are overtime, the ones before the shift first: Mon 06:00 to 16:00, Tue 08:00 to 17:00, Wed 07:00 to 16:00, Thu 08:00 to 17:00, Fri 08:00 to 13:00 against 08:00 to 16:00 shifts: 37 hours in them, 3 before and 2 after, 42 in all. The two latest hours before a shift (Wednesday's, and Monday's 07:00 to 08:00) are overtime at 125; the other early and late hours are basic, as they are within the 40"
punch = [
{ at = "2026-10-05 06:00", kind = "in" }, { at = "2026-10-05 16:00", kind = "out" },
{ at = "2026-10-06 08:00", kind = "in" }, { at = "2026-10-06 17:00", kind = "out" },
{ at = "2026-10-07 07:00", kind = "in" }, { at = "2026-10-07 16:00", kind = "out" },
{ at = "2026-10-08 08:00", kind = "in" }, { at = "2026-10-08 17:00", kind = "out" },
{ at = "2026-10-09 08:00", kind = "in" }, { at = "2026-10-09 13:00", kind = "out" },
]
[policy]
zone = "Europe/London"
[[shift_definition]]
id = "days"
start = "08:00"
end = "16:00"
days = ["monday", "tuesday", "wednesday", "thursday", "friday"]
[[measure]]
id = "wages"
kind = "money"
currency = "GBP"
[[rate]]
kind = "pay"
amount = 1600
currency = "GBP"
[expect]
week = "2026-10-05"
allocations = [
"2026-10-05 06:00-07:00 before_shift 1.00",
"2026-10-05 07:00-08:00 overtime_before 1.00",
"2026-10-05 08:00-16:00 work 8.00",
"2026-10-06 08:00-16:00 work 8.00",
"2026-10-06 16:00-17:00 after_shift 1.00",
"2026-10-07 07:00-08:00 overtime_before 1.00",
"2026-10-07 08:00-16:00 work 8.00",
"2026-10-08 08:00-16:00 work 8.00",
"2026-10-08 16:00-17:00 after_shift 1.00",
"2026-10-09 08:00-13:00 work 5.00",
]
quantities = [
"2026-10-05 wages 16.00 GBP before_shift",
"2026-10-07 wages 40.00 GBP overtime_before",
"2026-10-08 wages 32.00 GBP after_shift",
"2026-10-09 wages 592.00 GBP work",
]
Forty hours Monday to Friday, then 4 on Sunday 10:00 to 14:00 (a day with no shift): all overtime, paid at 200 as Sunday's, whatever its place against a shift
scenarios/sunday-overtime-is-double-time.toml
description = "Forty hours Monday to Friday, then 4 on Sunday 10:00 to 14:00 (a day with no shift): all overtime, paid at 200 as Sunday's, whatever its place against a shift"
punch = [
{ at = "2026-10-05 08:00", kind = "in" }, { at = "2026-10-05 16:00", kind = "out" },
{ at = "2026-10-06 08:00", kind = "in" }, { at = "2026-10-06 16:00", kind = "out" },
{ at = "2026-10-07 08:00", kind = "in" }, { at = "2026-10-07 16:00", kind = "out" },
{ at = "2026-10-08 08:00", kind = "in" }, { at = "2026-10-08 16:00", kind = "out" },
{ at = "2026-10-09 08:00", kind = "in" }, { at = "2026-10-09 16:00", kind = "out" },
{ at = "2026-10-11 10:00", kind = "in" }, { at = "2026-10-11 14:00", kind = "out" },
]
[policy]
zone = "Europe/London"
[[shift_definition]]
id = "days"
start = "08:00"
end = "16:00"
days = ["monday", "tuesday", "wednesday", "thursday", "friday"]
[[measure]]
id = "wages"
kind = "money"
currency = "GBP"
[[rate]]
kind = "pay"
amount = 1600
currency = "GBP"
[expect]
week = "2026-10-05"
allocations = [
"2026-10-05 08:00-16:00 work 8.00",
"2026-10-06 08:00-16:00 work 8.00",
"2026-10-07 08:00-16:00 work 8.00",
"2026-10-08 08:00-16:00 work 8.00",
"2026-10-09 08:00-16:00 work 8.00",
"2026-10-11 10:00-14:00 sunday_overtime 4.00",
]
quantities = [
"2026-10-09 wages 640.00 GBP work",
"2026-10-11 wages 128.00 GBP sunday_overtime",
]
A tenant's layer lists the hours after the shift first (take_first = after_shift, before_shift): Mon 06:00 to 16:00, Tue 08:00 to 17:00, Wed 07:00 to 16:00, Thu 08:00 to 17:00, Fri 08:00 to 13:00 against 08:00 to 16:00 shifts: 37 hours in them, 3 before and 2 after, 42 in all. Tuesday's and Thursday's hours after the shift are the overtime at 200, and the early hours stay basic
scenarios/the-employer-chooses-the-hours-after-the-shift-first.toml
description = "A tenant's layer lists the hours after the shift first (take_first = after_shift, before_shift): Mon 06:00 to 16:00, Tue 08:00 to 17:00, Wed 07:00 to 16:00, Thu 08:00 to 17:00, Fri 08:00 to 13:00 against 08:00 to 16:00 shifts: 37 hours in them, 3 before and 2 after, 42 in all. Tuesday's and Thursday's hours after the shift are the overtime at 200, and the early hours stay basic"
punch = [
{ at = "2026-10-05 06:00", kind = "in" }, { at = "2026-10-05 16:00", kind = "out" },
{ at = "2026-10-06 08:00", kind = "in" }, { at = "2026-10-06 17:00", kind = "out" },
{ at = "2026-10-07 07:00", kind = "in" }, { at = "2026-10-07 16:00", kind = "out" },
{ at = "2026-10-08 08:00", kind = "in" }, { at = "2026-10-08 17:00", kind = "out" },
{ at = "2026-10-09 08:00", kind = "in" }, { at = "2026-10-09 13:00", kind = "out" },
]
[policy]
zone = "Europe/London"
[[layer]]
id = "after-first"
order = 30
[[layer.step]]
id = "weekly"
change = "params"
params = { take_first = ["after_shift", "before_shift"] }
[[shift_definition]]
id = "days"
start = "08:00"
end = "16:00"
days = ["monday", "tuesday", "wednesday", "thursday", "friday"]
[[measure]]
id = "wages"
kind = "money"
currency = "GBP"
[[rate]]
kind = "pay"
amount = 1600
currency = "GBP"
[expect]
week = "2026-10-05"
allocations = [
"2026-10-05 06:00-08:00 before_shift 2.00",
"2026-10-05 08:00-16:00 work 8.00",
"2026-10-06 08:00-16:00 work 8.00",
"2026-10-06 16:00-17:00 overtime_after 1.00",
"2026-10-07 07:00-08:00 before_shift 1.00",
"2026-10-07 08:00-16:00 work 8.00",
"2026-10-08 08:00-16:00 work 8.00",
"2026-10-08 16:00-17:00 overtime_after 1.00",
"2026-10-09 08:00-13:00 work 5.00",
]
quantities = [
"2026-10-07 wages 48.00 GBP before_shift",
"2026-10-08 wages 64.00 GBP overtime_after",
"2026-10-09 wages 592.00 GBP work",
]