Skip to content

The balance below an amount once a year

The rule

A company lets people take paid time off they have not earned yet, within limits:

  • no request may leave the balance below -40 hours;
  • only one request a calendar year may take it below nothing. Once a request has done so, any other that would leave it below nothing that year is refused: while the balance is still negative, and after it has been earned back.

A request that leaves the balance at nothing or more is never held to the yearly limit. A new year starts the count again.

The same two rules keep a day in hand: a floor of nothing, and one request a year that may leave less than 8 hours.

Who uses it

Employers that advance paid time off to people who have not accrued it yet (for a family event, early in their employment) but do not want the balance to stay negative or to be advanced again and again.

How the recipe does it

Configuration only: a package (package.toml) of one layer, with monthly pay periods, balances kept from December 1, 2025, and two standard steps in the leave stage, each one rule:

[[layer.step]]
id = "floor"
uses = "standard/leave_balance"
params = { balance = { pto = "pto" }, floor = "-40h" }
[[layer.step]]
id = "below"
uses = "standard/leave_balance_below"
params = { balance = { pto = "pto" }, below = "0h", times = 1, within = { every = "1y", starts = "01-01" } }

leave_balance refuses a request that would leave the balance below its floor. leave_balance_below refuses one that would leave it below below once the balance has already gone below below times times in the year the request’s first day is in (within). Every change that took the balance below counts: an earlier request (recorded before this one), a hand adjustment. A balance that starts the year below counts nothing until a change lowers it again. within is a period: the calendar year ({ every = "1y", starts = "01-01" }, the default), the anniversary year ({ every = "1y", starts = "hire" }), the leave year ({ every = "1y", starts = "leave_year" }, from the accruals.leave_year_starts setting), or the rolling year up to the request ({ last = "12mo" }).

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 pto: 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

StepParameterMeaning
leave_balancebalanceEach leave category and the accrual category it draws on: { pto = "pto" }.
leave_balancefloorThe lowest a request may leave the balance (default 0h): -40h lets it go 40 hours negative, 8h keeps 8 hours.
leave_balance_belowbalanceAs above.
leave_balance_belowbelowThe amount (default 0h).
leave_balance_belowtimesHow many times a year the balance may go below it (default 1).
leave_balance_belowwithinThe year it counts in, a period holding the request’s first day (default the calendar year).

What the scenarios show

  • below-nothing-once-within-the-floor: 10 hours; a 40-hour request leaves -30 hours: approved. A second, while the balance is still negative, is refused.
  • earned-back-and-below-again-in-the-same-year: after the balance is earned back to 10 hours, a request that would take it below nothing again that year is refused; one that leaves 2 hours is approved.
  • a-new-year-may-go-below-again: the next January, a request may take it below nothing again.
  • the-floor-refuses-what-goes-too-far: a request that would leave -50 hours is refused by the floor.
  • twice-a-year-allows-a-second: with times = 2, the second request is approved.
  • a-leave-year-from-july: with a leave year from July 1, a request in August is the first of a new year.
  • keeping-a-day-in-hand, keeping-a-day-in-hand-in-a-new-year: a floor of nothing and 8 hours as the amount: from 20 hours to nothing once; after it is earned back, a request leaving 4 hours is refused, one leaving 8 is approved; the next year, approved again.
  • a-year-that-starts-under-the-amount: a year that starts at 4 hours is no change: the first request to nothing is approved, the second refused.
  • a-hand-adjustment-under-the-amount-counts: a hand adjustment that takes the balance under 8 hours is the year’s time.

Where the law protects a kind of leave (sick leave, family and medical leave), it may not be refused for the balance; check the rules where you operate. Advancing paid time off can also be limited by the wage laws on deductions from final pay.

Get the recipe

The recipe’s package and its scenarios are in the example packages repository: attendance/balance_below_once_a_year. 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:

balance_below_once_a_year/package.toml
name = "balance_below_once_a_year"
version = "1.0.0"
description = "Paid time off may go as much as 40 hours negative, but only one request a calendar year may take it below nothing, even once it has been earned back."
# What the tenant must have set up for the recipe: the steps read these by name.
[needs]
accrual_categories = ["pto"]
# Monthly pay periods; balances kept from December 1, 2025. Two rules, each
# a step of its own: no request may leave the paid time off balance below
# -40 hours, and only one request a calendar year may leave it below
# nothing.
[[layer]]
id = "leave"
settings = { pay_periods = { month_days = [1] }, accruals = { since = "2025-12-01" } }
[[layer.step]]
id = "floor"
uses = "standard/leave_balance"
params = { balance = { pto = "pto" }, floor = "-40h" }
[[layer.step]]
id = "below"
uses = "standard/leave_balance_below"
params = { balance = { pto = "pto" }, below = "0h", times = 1, within = { every = "1y", starts = "01-01" } }

Scenarios

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

One request a year may leave the balance under 8 hours. 20 hours; a hand adjustment in February takes off 14, leaving 6: under 8, so it counts as the year's time. 10 hours added in March. In April, a 12-hour request would leave 4 hours: refused
scenarios/a-hand-adjustment-under-the-amount-counts.toml
description = "One request a year may leave the balance under 8 hours. 20 hours; a hand adjustment in February takes off 14, leaving 6: under 8, so it counts as the year's time. 10 hours added in March. In April, a 12-hour request would leave 4 hours: refused"
[policy]
zone = "America/Chicago"
[[category]]
id = "pto"
worked = false
[[accrual_category]]
id = "pto"
uses = ["pto"]
# The business keeps a day in hand: no request may leave the balance below
# nothing, and only one a year may leave it under 8 hours.
[[layer]]
id = "keep-a-day"
[[layer.step]]
id = "floor"
change = "params"
params = { floor = "0h" }
[[layer.step]]
id = "below"
change = "params"
params = { below = "8h" }
[[accrual_adjustment]]
id = "grant"
category = "pto"
workday = "2026-01-02"
amount = "20h"
recorded = "2026-01-02 09:00"
[[accrual_adjustment]]
id = "correction"
category = "pto"
workday = "2026-02-02"
amount = "-14h"
recorded = "2026-02-02 09:00"
[[accrual_adjustment]]
id = "earned"
category = "pto"
workday = "2026-03-02"
amount = "10h"
recorded = "2026-03-02 09:00"
[[leave]]
id = "v1"
category = "pto"
days = { "2026-04-06" = "12h" }
recorded = "2026-03-10 09:00"
[[approval]]
subject = "leave:v1:2026-04-06"
stage = "approval"
decision = "approve"
recorded = "2026-03-10 10:00"
[expect.period]
day = "2026-04-06"
leave = ["v1 refused: the pto balance has gone below 8h as many times since 2026-01-01 as it may (1)"]
balances = { pto = "16h" }
Where the year is the leave year from July 1, a request in February 2026 that takes the balance below nothing is the time of the leave year to June 30; one in August, after 40 hours were added, is the first of the next leave year: approved, though both are in 2026
scenarios/a-leave-year-from-july.toml
description = "Where the year is the leave year from July 1, a request in February 2026 that takes the balance below nothing is the time of the leave year to June 30; one in August, after 40 hours were added, is the first of the next leave year: approved, though both are in 2026"
[policy]
zone = "America/Chicago"
[[category]]
id = "pto"
worked = false
[[accrual_category]]
id = "pto"
uses = ["pto"]
# The leave year runs from July 1.
[[layer]]
id = "leave-year"
settings = { accruals = { leave_year_starts = "07-01" } }
[[layer.step]]
id = "below"
change = "params"
params = { within = { every = "1y", starts = "leave_year" } }
[[accrual_adjustment]]
id = "grant"
category = "pto"
workday = "2026-01-02"
amount = "10h"
recorded = "2026-01-02 09:00"
[[leave]]
id = "v1"
category = "pto"
days = { "2026-02-02" = "8h", "2026-02-03" = "8h", "2026-02-04" = "8h", "2026-02-05" = "8h", "2026-02-06" = "8h" }
recorded = "2026-01-20 09:00"
[[approval]]
subject = "leave:v1:2026-02-02"
stage = "approval"
decision = "approve"
recorded = "2026-01-20 10:00"
[[accrual_adjustment]]
id = "earned"
category = "pto"
workday = "2026-07-01"
amount = "40h"
recorded = "2026-07-01 09:00"
[[leave]]
id = "v2"
category = "pto"
days = { "2026-08-03" = "8h", "2026-08-04" = "8h" }
recorded = "2026-07-10 09:00"
[[approval]]
subject = "leave:v2:2026-08-03"
stage = "approval"
decision = "approve"
recorded = "2026-07-10 10:00"
[expect.period]
day = "2026-08-03"
leave = ["v2 approved"]
balances = { pto = "-6h" }
A 40-hour request in February 2026 takes 10 hours to -30, and 40 hours added in December bring it to 10. In January 2027 a 16-hour request takes it below nothing: the first time that year, so approved
scenarios/a-new-year-may-go-below-again.toml
description = "A 40-hour request in February 2026 takes 10 hours to -30, and 40 hours added in December bring it to 10. In January 2027 a 16-hour request takes it below nothing: the first time that year, so approved"
[policy]
zone = "America/Chicago"
[[category]]
id = "pto"
worked = false
[[accrual_category]]
id = "pto"
uses = ["pto"]
[[accrual_adjustment]]
id = "grant"
category = "pto"
workday = "2026-01-02"
amount = "10h"
recorded = "2026-01-02 09:00"
[[leave]]
id = "v1"
category = "pto"
days = { "2026-02-02" = "8h", "2026-02-03" = "8h", "2026-02-04" = "8h", "2026-02-05" = "8h", "2026-02-06" = "8h" }
recorded = "2026-01-20 09:00"
[[approval]]
subject = "leave:v1:2026-02-02"
stage = "approval"
decision = "approve"
recorded = "2026-01-20 10:00"
[[accrual_adjustment]]
id = "earned"
category = "pto"
workday = "2026-12-01"
amount = "40h"
recorded = "2026-12-01 09:00"
[[leave]]
id = "v2"
category = "pto"
days = { "2027-01-04" = "8h", "2027-01-05" = "8h" }
recorded = "2026-12-10 09:00"
[[approval]]
subject = "leave:v2:2027-01-04"
stage = "approval"
decision = "approve"
recorded = "2026-12-10 10:00"
[expect.period]
day = "2027-01-04"
leave = ["v2 approved"]
balances = { pto = "-6h" }
One request a year may leave the balance under 8 hours. The year starts at 4 hours: that is no change, so a 4-hour request in February that leaves nothing is the first, approved. 6 hours added in March. In April, a 2-hour request would leave 4 hours, under 8 a second time: refused
scenarios/a-year-that-starts-under-the-amount.toml
description = "One request a year may leave the balance under 8 hours. The year starts at 4 hours: that is no change, so a 4-hour request in February that leaves nothing is the first, approved. 6 hours added in March. In April, a 2-hour request would leave 4 hours, under 8 a second time: refused"
[policy]
zone = "America/Chicago"
[[category]]
id = "pto"
worked = false
[[accrual_category]]
id = "pto"
uses = ["pto"]
# The business keeps a day in hand: no request may leave the balance below
# nothing, and only one a year may leave it under 8 hours.
[[layer]]
id = "keep-a-day"
[[layer.step]]
id = "floor"
change = "params"
params = { floor = "0h" }
[[layer.step]]
id = "below"
change = "params"
params = { below = "8h" }
[[accrual_adjustment]]
id = "carried"
category = "pto"
workday = "2025-12-02"
amount = "4h"
recorded = "2025-12-02 09:00"
[[leave]]
id = "v1"
category = "pto"
days = { "2026-02-02" = "4h" }
recorded = "2026-01-20 09:00"
[[approval]]
subject = "leave:v1:2026-02-02"
stage = "approval"
decision = "approve"
recorded = "2026-01-20 10:00"
[[accrual_adjustment]]
id = "earned"
category = "pto"
workday = "2026-03-02"
amount = "6h"
recorded = "2026-03-02 09:00"
[[leave]]
id = "v2"
category = "pto"
days = { "2026-04-06" = "2h" }
recorded = "2026-03-10 09:00"
[[approval]]
subject = "leave:v2:2026-04-06"
stage = "approval"
decision = "approve"
recorded = "2026-03-10 10:00"
[expect.period]
day = "2026-04-06"
leave = ["v2 refused: the pto balance has gone below 8h as many times since 2026-01-01 as it may (1)"]
balances = { pto = "6h" }
10 hours of paid time off. A 40-hour request leaves -30 hours, inside the -40-hour floor: approved. A second, of 8 hours, asked for while the balance is still below nothing would take it below nothing a second time this year: refused, though -38 hours is inside the floor
scenarios/below-nothing-once-within-the-floor.toml
description = "10 hours of paid time off. A 40-hour request leaves -30 hours, inside the -40-hour floor: approved. A second, of 8 hours, asked for while the balance is still below nothing would take it below nothing a second time this year: refused, though -38 hours is inside the floor"
[policy]
zone = "America/Chicago"
[[category]]
id = "pto"
worked = false
[[accrual_category]]
id = "pto"
uses = ["pto"]
[[accrual_adjustment]]
id = "grant"
category = "pto"
workday = "2026-01-02"
amount = "10h"
recorded = "2026-01-02 09:00"
[[leave]]
id = "v1"
category = "pto"
days = { "2026-03-02" = "8h", "2026-03-03" = "8h", "2026-03-04" = "8h", "2026-03-05" = "8h", "2026-03-06" = "8h" }
recorded = "2026-02-02 09:00"
[[approval]]
subject = "leave:v1:2026-03-02"
stage = "approval"
decision = "approve"
recorded = "2026-02-02 10:00"
[[leave]]
id = "v2"
category = "pto"
days = { "2026-03-10" = "8h" }
recorded = "2026-02-03 09:00"
[[approval]]
subject = "leave:v2:2026-03-10"
stage = "approval"
decision = "approve"
recorded = "2026-02-03 10:00"
[expect.period]
day = "2026-03-02"
leave = ["v1 approved", "v2 refused: the pto balance has gone below 0h as many times since 2026-01-01 as it may (1)"]
balances = { pto = "-30h" }
A 40-hour request in February takes 10 hours to -30. 40 hours added in March bring it to 10. In April, a 16-hour request would take it below nothing again in the same year: refused. An 8-hour one, asked for after it, leaves 2 hours: approved
scenarios/earned-back-and-below-again-in-the-same-year.toml
description = "A 40-hour request in February takes 10 hours to -30. 40 hours added in March bring it to 10. In April, a 16-hour request would take it below nothing again in the same year: refused. An 8-hour one, asked for after it, leaves 2 hours: approved"
[policy]
zone = "America/Chicago"
[[category]]
id = "pto"
worked = false
[[accrual_category]]
id = "pto"
uses = ["pto"]
[[accrual_adjustment]]
id = "grant"
category = "pto"
workday = "2026-01-02"
amount = "10h"
recorded = "2026-01-02 09:00"
[[leave]]
id = "v1"
category = "pto"
days = { "2026-02-02" = "8h", "2026-02-03" = "8h", "2026-02-04" = "8h", "2026-02-05" = "8h", "2026-02-06" = "8h" }
recorded = "2026-01-20 09:00"
[[approval]]
subject = "leave:v1:2026-02-02"
stage = "approval"
decision = "approve"
recorded = "2026-01-20 10:00"
[[accrual_adjustment]]
id = "earned"
category = "pto"
workday = "2026-03-02"
amount = "40h"
recorded = "2026-03-02 09:00"
[[leave]]
id = "v2"
category = "pto"
days = { "2026-04-06" = "8h", "2026-04-07" = "8h" }
recorded = "2026-03-10 09:00"
[[approval]]
subject = "leave:v2:2026-04-06"
stage = "approval"
decision = "approve"
recorded = "2026-03-10 10:00"
[[leave]]
id = "v3"
category = "pto"
days = { "2026-04-08" = "8h" }
recorded = "2026-03-11 09:00"
[[approval]]
subject = "leave:v3:2026-04-08"
stage = "approval"
decision = "approve"
recorded = "2026-03-11 10:00"
[expect.period]
day = "2026-04-06"
leave = ["v2 refused: the pto balance has gone below 0h as many times since 2026-01-01 as it may (1)", "v3 approved"]
balances = { pto = "2h" }
No request may leave the balance below nothing, and one a year may leave it under 8 hours. A 20-hour request in February 2026 leaves nothing; 20 hours added in December. In January 2027 a 16-hour request leaves 4 hours: the first time that year, so approved
scenarios/keeping-a-day-in-hand-in-a-new-year.toml
description = "No request may leave the balance below nothing, and one a year may leave it under 8 hours. A 20-hour request in February 2026 leaves nothing; 20 hours added in December. In January 2027 a 16-hour request leaves 4 hours: the first time that year, so approved"
[policy]
zone = "America/Chicago"
[[category]]
id = "pto"
worked = false
[[accrual_category]]
id = "pto"
uses = ["pto"]
# The business keeps a day in hand: no request may leave the balance below
# nothing, and only one a year may leave it under 8 hours.
[[layer]]
id = "keep-a-day"
[[layer.step]]
id = "floor"
change = "params"
params = { floor = "0h" }
[[layer.step]]
id = "below"
change = "params"
params = { below = "8h" }
[[accrual_adjustment]]
id = "grant"
category = "pto"
workday = "2026-01-02"
amount = "20h"
recorded = "2026-01-02 09:00"
[[leave]]
id = "v1"
category = "pto"
days = { "2026-02-02" = "10h", "2026-02-03" = "10h" }
recorded = "2026-01-20 09:00"
[[approval]]
subject = "leave:v1:2026-02-02"
stage = "approval"
decision = "approve"
recorded = "2026-01-20 10:00"
[[accrual_adjustment]]
id = "earned"
category = "pto"
workday = "2026-12-01"
amount = "20h"
recorded = "2026-12-01 09:00"
[[leave]]
id = "v2"
category = "pto"
days = { "2027-01-04" = "16h" }
recorded = "2026-12-10 09:00"
[[approval]]
subject = "leave:v2:2027-01-04"
stage = "approval"
decision = "approve"
recorded = "2026-12-10 10:00"
[expect.period]
day = "2027-01-04"
leave = ["v2 approved"]
balances = { pto = "4h" }
No request may leave the balance below nothing, and one a year may leave it under 8 hours. 20 hours; a 20-hour request in February leaves nothing: approved. 20 hours added in March. In April, a 16-hour request would leave 4 hours, under 8 a second time this year: refused. A 12-hour one leaves 8 hours: approved
scenarios/keeping-a-day-in-hand.toml
description = "No request may leave the balance below nothing, and one a year may leave it under 8 hours. 20 hours; a 20-hour request in February leaves nothing: approved. 20 hours added in March. In April, a 16-hour request would leave 4 hours, under 8 a second time this year: refused. A 12-hour one leaves 8 hours: approved"
[policy]
zone = "America/Chicago"
[[category]]
id = "pto"
worked = false
[[accrual_category]]
id = "pto"
uses = ["pto"]
# The business keeps a day in hand: no request may leave the balance below
# nothing, and only one a year may leave it under 8 hours.
[[layer]]
id = "keep-a-day"
[[layer.step]]
id = "floor"
change = "params"
params = { floor = "0h" }
[[layer.step]]
id = "below"
change = "params"
params = { below = "8h" }
[[accrual_adjustment]]
id = "grant"
category = "pto"
workday = "2026-01-02"
amount = "20h"
recorded = "2026-01-02 09:00"
[[leave]]
id = "v1"
category = "pto"
days = { "2026-02-02" = "10h", "2026-02-03" = "10h" }
recorded = "2026-01-20 09:00"
[[approval]]
subject = "leave:v1:2026-02-02"
stage = "approval"
decision = "approve"
recorded = "2026-01-20 10:00"
[[accrual_adjustment]]
id = "earned"
category = "pto"
workday = "2026-03-02"
amount = "20h"
recorded = "2026-03-02 09:00"
[[leave]]
id = "v2"
category = "pto"
days = { "2026-04-06" = "16h" }
recorded = "2026-03-10 09:00"
[[approval]]
subject = "leave:v2:2026-04-06"
stage = "approval"
decision = "approve"
recorded = "2026-03-10 10:00"
[[leave]]
id = "v3"
category = "pto"
days = { "2026-04-07" = "12h" }
recorded = "2026-03-11 09:00"
[[approval]]
subject = "leave:v3:2026-04-07"
stage = "approval"
decision = "approve"
recorded = "2026-03-11 10:00"
[expect.period]
day = "2026-04-06"
leave = ["v2 refused: the pto balance has gone below 8h as many times since 2026-01-01 as it may (1)", "v3 approved"]
balances = { pto = "8h" }
10 hours of paid time off. A 60-hour request would leave -50 hours, past the -40-hour floor: refused, and it pays nothing
scenarios/the-floor-refuses-what-goes-too-far.toml
description = "10 hours of paid time off. A 60-hour request would leave -50 hours, past the -40-hour floor: refused, and it pays nothing"
[policy]
zone = "America/Chicago"
[[category]]
id = "pto"
worked = false
[[accrual_category]]
id = "pto"
uses = ["pto"]
[[accrual_adjustment]]
id = "grant"
category = "pto"
workday = "2026-01-02"
amount = "10h"
recorded = "2026-01-02 09:00"
[[leave]]
id = "v1"
category = "pto"
days = { "2026-03-02" = "12h", "2026-03-03" = "12h", "2026-03-04" = "12h", "2026-03-05" = "12h", "2026-03-06" = "12h" }
recorded = "2026-02-02 09:00"
[[approval]]
subject = "leave:v1:2026-03-02"
stage = "approval"
decision = "approve"
recorded = "2026-02-02 10:00"
[expect.period]
day = "2026-03-02"
leave = ["v1 refused: it would leave the pto balance below -40h"]
balances = { pto = "10h" }
Where the balance may go below nothing twice a year, a second 8-hour request asked for while it is still negative, inside the -40-hour floor, is approved
scenarios/twice-a-year-allows-a-second.toml
description = "Where the balance may go below nothing twice a year, a second 8-hour request asked for while it is still negative, inside the -40-hour floor, is approved"
[policy]
zone = "America/Chicago"
[[category]]
id = "pto"
worked = false
[[accrual_category]]
id = "pto"
uses = ["pto"]
# Twice a year.
[[layer]]
id = "twice"
[[layer.step]]
id = "below"
change = "params"
params = { times = 2 }
[[accrual_adjustment]]
id = "grant"
category = "pto"
workday = "2026-01-02"
amount = "10h"
recorded = "2026-01-02 09:00"
[[leave]]
id = "v1"
category = "pto"
days = { "2026-03-02" = "8h", "2026-03-03" = "8h", "2026-03-04" = "8h", "2026-03-05" = "8h", "2026-03-06" = "8h" }
recorded = "2026-02-02 09:00"
[[approval]]
subject = "leave:v1:2026-03-02"
stage = "approval"
decision = "approve"
recorded = "2026-02-02 10:00"
[[leave]]
id = "v2"
category = "pto"
days = { "2026-03-10" = "8h" }
recorded = "2026-02-03 09:00"
[[approval]]
subject = "leave:v2:2026-03-10"
stage = "approval"
decision = "approve"
recorded = "2026-02-03 10:00"
[expect.period]
day = "2026-03-02"
leave = ["v1 approved", "v2 approved"]
balances = { pto = "-38h" }