Skip to content

Closed periods

Once a pay period is closed and paid, what was paid must not move. New facts arrive anyway. A clock that was offline sends an old punch. A supervisor corrects a punch the next week. A policy change reaches back in time.

This page explains how those changes reach payroll without editing anything. A closed period never changes. A change stored after the close becomes an adjustment in the period that was open when the change was stored.

week of Oct 5 closed week of Oct 12 open Fri: out at 16:00 closed Mon 08:00 Tue 10:00: correction, the out was 17:00 changes Friday closed ledger 40.00 work as it was closed; never changes adjust (default) open ledger Tue 13: +1.00 work adjusts the period from 2026-10-05 or, refuse nothing added; late_change_refused
The closed week stays as it was paid. The correction changes it by some exact amount. That difference is posted in the open week, on the day the correction was recorded, labelled with the period it adjusts. If the policy refuses late changes, the open week says one was refused.

You close a period with a close fact: {"period": "2026-10-05", "recorded": ..., "by": "payroll", "reopen": false}. You reopen it with another close fact that has "reopen": true. The fact stored last wins.

A closed period never changes. A change stored after the close becomes an adjustment in the open period, or is refused. The change lands in the period that was open when it was stored (below). No one sorts facts into late and not late by hand.

A closed period’s ledger is worked out once, as it stood at the close. It uses only what was stored by then:

  • the facts
  • the setup
  • the policy layers
  • the policy packages
  • the tenant metadata
  • the adjustments in it for periods closed before it

That ledger is kept as the period’s record, as a payroll system keeps what it paid.

From then on, the closed period is read from its record. It is never worked out again. The timecard, the export and the ledger read the same whatever is stored later. They also read the same whichever version of the engine or of the packages it ships runs.

The days of a closed period read the same way. A day’s punches are the punches taken at the close. Facts stored after the close are listed apart on the day as recorded_after_close. A late punch and a correction of a punch are examples. Each one shows when it was stored and the workday it was stored on. It also shows what the open period did with it: took it as an adjustment line, or refused it as a late_change_refused exception.

Reopening a period discards its record. The period is then worked out like any open period (below). Closing it again makes a new record.

A period can also close on its own. Set close.after_days in the policy. It is a layer setting like any other, so it applies to whomever its layer’s rule picks.

  • The period closes that many days after it ends, at the start of that workday in the person’s zone.
  • 0 closes it as it ends.
  • If you leave the setting unset, nothing closes on its own.

An automatic close is the same fact and the same period.closed event as a close by hand. by is set to automatic: close.after_days. recorded is set to the instant the close was due. It happens once, at that instant, however many instances are running.

An automatic close covers only some periods:

  • Only periods after the last one closed or reopened by hand. A period you reopened by hand stays open.
  • Only periods from the first to the last that have something recorded for the person.

Every fact has two times.

  • recorded is what the sender says. For a clock’s punch, it is when Connect received the punch. A clock that was offline uploads late. For a fact sent through the API, it is the time the caller gave. It is shown as given.
  • stored is when Time and Attendance stored the fact. The server stamps it, whatever the sender says.

Only stored puts a person’s facts in order. The decision, correction or note stored last is the one that stands. stored also tells which pay period a change was recorded in.

So a punch that arrives after its period closed is a late change to the closed period. It is never part of that period. For example, a sink fell behind, or a tenant was suspended for a while.

No caller can do any of these:

  • date a fact into a closed period
  • make a decision that no later one can beat
  • make a close that no reopen can undo

A fact sent again, with the same id and content, is the same fact whenever you send it.

A change stored before the close is in the closed period, whatever day it was stored on. Only what is stored after the close adjusts the period.

What you paid for a period is its record plus the adjustments that later closed periods hold for it. A reopened period is open again. It is worked out with every fact stored since, including the changes already adjusted for it.

  • Its adjustments in open periods leave those periods. The reopened period now carries those changes itself.
  • Its adjustments in closed periods stay there, because they were paid. The reopened period takes each one off. It does this with lines on its last day that read “already paid in the period from …, closed”. Their from is {"paid": {"period": ...}}. That is the first day of the period that paid them. In an export, the lines use paid.

When you close the period again, its new record replaces the old one. It pays only what remains: its new total, less what later closed periods paid.

For example, a week closes with 8 hours. The next week adjusts it by 4 more hours and closes. Then you reopen the first week and close it again. The first week now pays its 12 hours less the 4 already paid, so 8. The next week keeps its 4. See the worked example.

Now suppose you reopen the later week too. It holds the 4 hours again, as a line on its first day. The line is labelled with the period it adjusts. Two periods reopened together hold nothing for each other. The earlier one, closed again while the later one is open, pays its whole 12.

This matches how payroll systems work out retro pay against paid-to-date. What a period pays is its total less what other periods paid for it. That holds in whatever order you reopen and close periods.

Closing or reopening a period also works out the person’s earlier reopened periods again. What they take off as paid depends on it.

A change stored after the close is a late change if it would change the closed period. Two kinds of change qualify.

  • A fact about the period: a punch, a correction, a labor entry, a leave request, or an employment change.
  • A change of setup or policy that names a day in the period. These are the cases:
    • a layer in force from a day in the period
    • a setup item from a day in the period: an assignment, a rate, a shift definition or a zone from that day, a shift in the period, or a holiday observed in the period
    • a package version published in force from a day in the period

A change that names no day is not a late change. It changes things from when it was stored. These are the cases:

  • an adoption
  • the tenant’s metadata
  • a layer with no from
  • a package version in force from the beginning

A period can close before its last day ends. What is stored on its remaining days after the close is a late change like any other. The first period after it that was not closed when the change was stored takes the change, on that period’s first day. If that period was closed in advance too, what was stored after both closes goes to the period after it.

The packages that come with the engine (standard) belong to the running version. A version that changes one is not a change stored for any tenant.

Time and Attendance stamps every record it keeps with the time it was stored (stored). In Postgres, the stamp is the time the transaction started. So every record of one delivery has the same stamp. Any two records stored in the same microsecond also have the same stamp.

Two rules say what that means. Neither depends on how an id reads as text.

  • Against an instant, what is stored at an instant is after it. A period is half-open, as a day is. What is stored at the very instant of a close is stored after the close, so it is a late change. In the same way, what is stored as a day starts belongs to that day.

    The same goes for the setup and policy a closed period is worked out with. Only those stored before the close count. So setup stored at the very instant of the close is not in force in the period. If that is all there is, the period had no setup. The error says so (no setup in force before <instant>). It does not say that a time zone is missing.

  • Among records, the order they were kept in. Of records stored at the same instant, the one kept later was stored later. The store’s sequence orders them, and a worker reads a person’s facts in that order. These are applied in the order they were delivered:

    • a correction stored with another
    • a note after an excuse
    • an entry that replaces the one before it in the same delivery
    • a leave request that replaces another

    None is lost to the order their ids happen to sort in (n10 is not before n5). Leave requests stored at one instant are decided in that order too.

The policy’s close.late_changes setting, or its late steps, decide what happens. They decide change by change, in the period that was open when the change was stored.

ValueWhat happens
adjust (the default)For each day of the open period on which something was stored that changes a closed period, the closed period is worked out with the change and without it. Each run uses the setup and policy stored by then. The exact difference becomes adjustment lines on that day. The difference is per pay category and labor context, and per measure for counts and money. The lines are untimed, stamped adjustment, and name the period they adjust. They go through the carry like any other line. The change’s difference to the accrual balances is posted beside them, as a balance adjustment per accrual category (balances). If another version of the engine or its packages worked out the period’s record, the first such change pays the whole difference. That is the difference between the period as this version works it out and what was already paid for it.
refuseNothing is added, to time or to balances. The open period carries a late_change_refused exception about the closed period, on the day the change was recorded.

Either way, the closed period’s record is untouched.

Approvals of the open period see the adjustment lines like any other. So the change is approved where it is paid (approvals).

The event period.adjusted tells payroll when the adjustments a timecard holds for a closed period are new or change. It carries their hours by category. Where they move a balance, it also carries the balance adjustments by accrual category.

Accrual balances carry forward as payroll carries them. A period opens with the balances the last closed period before it ended with. That period’s record keeps them: they are what was paid. Each open period after it is worked out in order. It opens with the balances the one before it ended with. The length of a person’s history does not change what it costs to work out the balances a period opens with.

A late change moves balances the way retro pay moves money. What was paid stays paid. The difference is posted in the open period.

Everything a balance is made of counts, per accrual category:

  • time off earned
  • time used
  • adjustments by hand
  • a balance forfeited

A late punch that earns time off, leave taken late, and an adjustment by hand dated in a closed period all reach the balances this way.

The difference runs through the periods after the one changed. Each of them is worked out with the change and without it. The difference between the two ends, per accrual category, is one balance adjustment entry. It is posted on the day the change was stored and labelled with the period it adjusts.

So a change that moves a balance also moves what later periods earn. A cap, a carryover limit or an accrual rate that depends on the balance all see it.

  • The open period’s own accrual rules see the balance adjustments. Its caps and limits apply to the new balance. A cap absorbs what it can. Say time off earned is capped at four hours, and you take two hours off a week that earned three. The next week has room to earn one more hour. So the balance ends one hour lower, not two.
  • Decisions stand. A change does not undo a leave request decided before it. The balance may go lower. The open period’s rules refuse or raise exceptions as they are set up to.
  • A balance adjustment is posted on the day the change was stored. So a carryover limit applied at the start of the year does not apply to it.
  • A late rule sees the difference a change makes to each balance. So it can refuse or route a change that moves only a balance.
  • Balance adjustments follow the rules that time adjustments follow.
    • Those held in open periods leave them when the period they adjust is reopened. The reopened period then carries the change itself.
    • Those held in closed periods stay paid. The reopened period takes each one off on its last day, as a paid entry labelled with the period that paid it.
    • For example, you add eight hours by hand to a closed week. The next week holds them and closes. The eight hours are on the balance once when you reopen the first week and close it again.

A rule can pay a balance out. The balance goes down by a paid_out entry. The ledger gets that much untimed time in a pay category that is set up as not worked, on the entry’s day. Payroll pays it as it pays that category. What is left of a comp time bank when someone leaves, or a balance cashed out at the end of the year, is paid out this way.

See period close for the scenario these pictures come from.