Sick leave with a cap and a yearly carryover limit
The rule
Sick leave is earned by hours worked (here an hour for every 30) and the balance never grows past a cap. When a new year starts, only so much of the balance carries over: what is above the carryover limit is lost.
Who uses it
Employers with an accrued sick leave or paid time off plan who do not want balances to pile up from year to year: a carryover limit keeps the liability on the books bounded while letting people keep a reserve.
How the recipe does it
Configuration only: the package (package.toml) has one layer for
everyone with two standard steps, the carryover limit before the accrual.
[[layer]]id = "sick"[[layer.step]]id = "carryover"uses = "standard/carryover"params = { category = "sick", limit = "40h" }
[[layer.step]]id = "sick"uses = "standard/accrue"params = { category = "sick", earn = "1h", per = "30h", cap = "48h" }carryover runs on each pay period. In the period the year starts in, it
takes the balance as the year’s first day starts (the period’s entries of
the days before it counted, the leave taken from that day on not) and,
when it is over the limit, forfeits the difference on that day: a
forfeited entry of its own, saying why. Then accrue earns the
period’s time, up to the cap. Any pay period works, one that runs across
the new year too.
What your setup needs
Set up before you adopt the recipe; the recipe’s steps read them by name, and adopting it is refused, with a list of what is missing, until they exist.
- A balance called
sick: an accrual category. The recipe earns into it, takes from it or reads it.
The scenarios show each as it was set up for them.
Parameters
| Step | Parameter | Meaning |
|---|---|---|
carryover, sick | category | The accrual category. |
carryover | limit | The most that carries into a new year: "40h". |
carryover | year | The year, a repeating period (default { every = "1y", starts = "01-01" }; starts = "hire" for the anniversary year, a fiscal year from its first day). |
sick | earn, per | An hour earned for every 30 worked. |
sick | cap | The most the balance holds: "48h". |
What the scenarios show
over-the-limit-is-lost-at-the-new-year: 50 hours at the end of December lose 10 at the January period’s start, then January earns an hour.at-the-limit-nothing-is-lost: exactly 40 hours carry over whole.december-keeps-what-it-has: a period the year does not start in keeps a balance over the limit.leave-taken-in-the-new-year-is-not-forfeited: paid every two weeks, across the new year: the limit applies to the balance as January 1 starts, so 10 hours are forfeited and the 8 used on January 4 come off the rest.
Legal note
This is a common way companies implement a carryover limit; check the rules where you operate. Some places forbid losing earned time (use it or lose it) or require unused vacation to be paid out, and paid sick leave laws often set how much must carry over.
Get the recipe
The recipe’s package and its scenarios are in the example packages repository: attendance/sick_leave_carryover. 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:
name = "sick_leave_carryover"version = "1.0.0"description = "Sick leave earned at an hour for every 30 worked up to a cap of 48, with what the balance holds over 40 hours lost when a new year starts."
# What the tenant must have set up for the recipe: the steps read these by name.[needs]accrual_categories = ["sick"]
# Everyone: as the year starts, the balance above 40 hours is forfeited;# then each pay period's work earns an hour for every 30, the balance# never past 48.[[layer]]id = "sick"[[layer.step]]id = "carryover"uses = "standard/carryover"params = { category = "sick", limit = "40h" }
[[layer.step]]id = "sick"uses = "standard/accrue"params = { category = "sick", earn = "1h", per = "30h", cap = "48h" }Scenarios
Each scenario gives a person’s punches and setup and the timecard they must produce, worked out with this package adopted (the format).
December ends with exactly the 40-hour limit: nothing is lost at the new year
description = "December ends with exactly the 40-hour limit: nothing is lost at the new year"
[policy]zone = "America/Los_Angeles"pay_periods = { month_days = [1] }accruals = { since = "2026-12-01" }
[[accrual_category]]id = "sick"uses = ["sick"]
[[category]]id = "sick"worked = false
[[accrual_adjustment]]category = "sick"workday = "2026-12-01"amount = "40h"reason = "balance brought over from the old system"
[expect.period]day = "2027-01-15"accruals = []balances = { sick = "40h" }December, a period the year does not start in, keeps a balance over the limit: it is lost only when the new year starts
description = "December, a period the year does not start in, keeps a balance over the limit: it is lost only when the new year starts"
[policy]zone = "America/Los_Angeles"pay_periods = { month_days = [1] }accruals = { since = "2026-12-01" }
[[accrual_category]]id = "sick"uses = ["sick"]
[[category]]id = "sick"worked = false
[[accrual_adjustment]]category = "sick"workday = "2026-12-01"amount = "50h"reason = "balance brought over from the old system"
[expect.period]day = "2026-12-15"accruals = ["2026-12-01 sick adjusted 50h"]balances = { sick = "50h" }Paid every two weeks, the period from December 28 runs across the new year. 50 hours carried in; on January 4, 8 hours of sick leave are taken. The limit is applied to the balance as January 1 starts, 50 hours: 10 are forfeited, and the 8 used in January come off what is left. Counting January's leave before the limit would forfeit only 2
description = "Paid every two weeks, the period from December 28 runs across the new year. 50 hours carried in; on January 4, 8 hours of sick leave are taken. The limit is applied to the balance as January 1 starts, 50 hours: 10 are forfeited, and the 8 used in January come off what is left. Counting January's leave before the limit would forfeit only 2"
[policy]zone = "America/Los_Angeles"pay_periods = { every_days = 14, from = "2026-12-28" }accruals = { since = "2026-12-01" }
[[accrual_category]]id = "sick"uses = ["sick"]
[[category]]id = "sick"worked = false
[[accrual_adjustment]]category = "sick"workday = "2026-12-01"amount = "50h"reason = "balance brought over from the old system"
[[leave]]id = "s1"category = "sick"days = { "2027-01-04" = "8h" }
[[approval]]subject = "leave:s1:2027-01-04"stage = "approval"decision = "approve"recorded = "2027-01-04 00:00"
[expect.period]day = "2027-01-04"first = "2026-12-28"last = "2027-01-10"accruals = ["2027-01-04 sick used -8h", "2027-01-01 sick forfeited -10h"]balances = { sick = "32h" }Paid monthly. December ends with 50 hours of sick leave; with a carryover limit of 40, the January period takes 10 hours off at its start, then January's 30 hours worked earn an hour
description = "Paid monthly. December ends with 50 hours of sick leave; with a carryover limit of 40, the January period takes 10 hours off at its start, then January's 30 hours worked earn an hour"
punch = [ { at = "2027-01-04 08:00", kind = "in" }, { at = "2027-01-04 18:00", kind = "out" }, { at = "2027-01-05 08:00", kind = "in" }, { at = "2027-01-05 18:00", kind = "out" }, { at = "2027-01-06 08:00", kind = "in" }, { at = "2027-01-06 18:00", kind = "out" },]
[policy]zone = "America/Los_Angeles"pay_periods = { month_days = [1] }accruals = { since = "2026-12-01" }
[[accrual_category]]id = "sick"uses = ["sick"]
[[category]]id = "sick"worked = false
[[accrual_adjustment]]category = "sick"workday = "2026-12-01"amount = "50h"reason = "balance brought over from the old system"
[expect.period]day = "2027-01-15"first = "2027-01-01"last = "2027-01-31"accruals = ["2027-01-01 sick forfeited -10h", "2027-01-01 sick earned 1h"]balances = { sick = "41h" }