Period close
Closing a pay period keeps its timecards exactly as they were paid. Time keeps arriving after a close. An example is a punch from a clock that was offline, or a correction the following week. Your policy decides what happens to each late change. It either becomes an exact adjustment in the open period, or it is refused. This way payroll never has to reconcile a period that moved.
Closing and reopening
Section titled “Closing and reopening”You close a period, or reopen it, with a recorded action that says who did it and when. The latest action says where the period stands.
When a period closes, each person’s timecard for it is kept as the record of what was paid. From then on, the timecard, its export and its ledger are read from that record. No later change alters it. Neither does a new version of Time and Attendance or its standard rules.
The same goes for a day of the period when you read days. Its punches are those taken at the close. What was stored after the close is listed apart as recorded_after_close. That means, for example, a late punch or a correction of a punch. Each entry shows when it was stored. It also shows the workday of the open period that took it.
Reopening a period sets the record aside. Closing it again makes a new one.
Other systems are told when a period closes, with each person’s totals (period.closed). They are told again whenever the adjustments for that period appear, change or go away in an open period. That message carries the hours by category (period.adjusted).
Closing automatically
Section titled “Closing automatically”Your policy can close each period on its own with the setting close.after_days. The period closes that many days after it ends, at the start of that workday in the person’s time zone. With 0, the period closes as it ends. With no setting, nothing closes on its own.
The automatic close is the same as one by hand. It is recorded as made by automatic: close.after_days, at the moment it was due. Other systems hear about it the same way. A few rules keep it predictable:
- It applies to the people its policy layer’s rule picks, like any other setting.
- It closes only periods after the last one someone closed or reopened by hand.
- A period you reopen by hand stays open.
- It closes only periods from the person’s first period with something recorded to their last one.
The cookbook’s automatic close recipe shows it day by day.
Late changes
Section titled “Late changes”A change that affects a closed period is a late change. Your policy decides what happens to it:
| Policy | What happens |
|---|---|
| Adjust (the default) | The change goes into the open period as adjustment lines. The lines hold the exact difference the change makes to the closed period. The difference is by pay category and by what the time is charged to (job, and so on). Counts and money are included. The lines fall on the day the change was recorded. They say which period they adjust. The time of the record and the time of the adjustments together are exactly the time of the period worked out with the change, in every category. The decimal hours of an adjustment line are carried with the other lines of its category in the open period that pays it, as any line’s are. Time-off balances get the same treatment (below). |
| Refuse | The change isn’t taken, in time or in balances. The open period shows a late_change_refused exception on the day it was recorded, so someone can follow up. |
The policy of the period that’s open when the change is recorded is the one that decides. Whoever decided is named. The stamp of an adjustment line gives the step (or close.late_changes) and the layers that gave the setting. So does the detail of a late_change_refused exception. Where no layer gave the setting, it says default.
For example, the week of October 5 is closed on Monday the 12th with 40 hours paid. On Tuesday the 13th, a supervisor corrects Friday’s out from 16:00 to 17:00:
| Week of Oct 5 (closed) | Week of Oct 12 (open) | |
|---|---|---|
| Adjust | Stays at 40.00, as paid | +1.00 hour of work on Tuesday the 13th, adjusting the week of Oct 5 |
| Refuse | Stays at 40.00, as paid | Nothing added; an exception on the 13th |
Adjustment lines count toward the open period’s totals. They are approved with it like any other line. Changes recorded on two different days make two adjustments, each on its own day.
Your policy can also decide change by change. For example, it can adjust small corrections automatically. It can refuse one that moves more than two hours, or that arrives more than a week after the close, so someone reviews it. See the late_changes standard rule and the cookbook’s late change limits.
What counts as a late change
Section titled “What counts as a late change”The period a change lands in follows from when Time and Attendance recorded it, never from a time anyone gives. A punch that reaches the engine after the close is a late change, even if it was taken at the clock before. Nobody sorts changes into late and on time by hand. No one can date a change into a closed period.
A late change is either of these:
- A fact about the closed 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. This covers a policy layer, a setup item, or a policy package version in force from a day in it.
A change that names no day is not a late change. It applies from when it was recorded. One example is adopting a package or a policy layer with no start date.
After an upgrade that works periods out differently, the first late change for a period closed before it pays the whole difference. That is the difference between the period as worked out today and what was already paid for it. The lines of such an adjustment are stamped adjusts_to_paid, naming the code that worked the record out. period.adjusted carries it as adjustments.record_code. This way payroll can tell an upgrade’s difference from a change.
A period closed before its last day
Section titled “A period closed before its last day”A pay period can be closed before its last day ends, as a payroll cutoff often is. An example is a week running through Sunday, closed on Friday at noon. Anything recorded after the close for the period’s remaining days is a late change to it like any other. That covers Friday afternoon’s shift and Saturday’s. Your policy adjusts or refuses it.
With adjust, the change goes into the first period after it that was not closed when the change was recorded. It goes on that period’s first day. The adjustment lines, balance adjustments and any late_change_refused exception are there, each saying the day the change was recorded. With refuse, the change isn’t taken and that period shows the exception. That period is worked out as soon as such a change is recorded, before it starts.
Where the next period was closed in advance too, its record holds what was recorded before its own close. What was recorded after both closes goes to the period after it.
Balances after a late change
Section titled “Balances after a late change”A new period opens with the balances the last closed period ended with, as it was paid. A late change can move a balance. Examples are a late punch that earns time off, leave taken late, or an adjustment by hand dated in a closed period. Such a change is posted in the open period as a balance adjustment, per accrual category, on the day the change was recorded. The closed period’s balance stays as it was paid.
Example. A punch for the week of October 5 arrives on the 13th and earns 30 minutes of PTO. The week of October 12 opens with the balance the closed week ended with. It shows a 30-minute adjustment on the 13th, labelled with the week it adjusts. Caps and carryover limits in the open period apply to the new balance. A leave request approved before the change stays approved, even if the balance ends up lower.
Closed periods has the details.
Reopening
Section titled “Reopening”A reopened period takes every change made since its close, including the late ones. Its adjustments leave the open periods they were in. In the example, suppose the week of October 5 is reopened on Tuesday after the correction. It shows 41.00 hours, and the following week has no adjustment.
An adjustment that a later period has already paid, because that period is closed too, stays paid there. The reopened period takes it off with a line on its last day reading “already paid in the period from …, closed”. What a period pays is its total less what other periods paid for it, in whatever order periods are reopened and closed. Closed periods walks through the cases.
A payroll export waits until no one’s time is being worked out again. So it never includes a change that’s still landing.