Skip to content

Allocations and the ledger

A person’s ledger is their timecard for one pay period. It is made of lines (the API calls them allocations). A line is a stretch of time. Each line is in a pay category, such as regular or overtime. Each line is charged to a labor context, such as a job or cost center.

Every number anyone sees is a sum of ledger lines. That covers a day’s hours, a week’s, a category total, a report and a payroll export. Nothing is worked out twice, so the numbers match each other. How a ledger is put together is drawn in the ledger’s stages.

A pay category is what time is paid as: regular, overtime, holiday, paid break. For each category you can say:

  • whether time in it counts as worked, which means it counts toward worked hours and overtime thresholds;
  • whether it is paid;
  • the code your payroll system knows it by.

A category you haven’t set up counts as worked and paid.

Your policy decides which category work starts in (work unless you say otherwise). It also decides whether lunches and breaks get a category at all. A lunch with no category simply isn’t on the timecard. It’s unpaid.

Example. Breaks are paid but don’t count as worked time. Lunch is unpaid. The day is: in 08:00, break 10:00 to 10:15, lunch 12:00 to 12:30, out 16:30:

LineCategoryHours
08:00 to 10:00work2.00
10:00 to 10:15paid break0.25
10:15 to 12:00work1.75
12:30 to 16:30work4.00
Day8.00 paid, 7.75 worked

Each line holds:

  • the workday it belongs to;
  • its pay category;
  • its labor context. Moving time to another category keeps its context, so job B’s overtime is still job B’s, at job B’s rate;
  • where it came from: punched work, hours entered without punches, approved leave, time a rule added (a holiday’s pay), or an adjustment for a period already closed;
  • its times, after any rounding, and its hours;
  • what changed it, step by step: each rule that rounded it, moved it to overtime or split it, and which policy that rule came from.

A stretch of work starts as one line. Rules then move time between categories. They split a line at the exact moment a change starts. Time is never added or lost along the way. A stretch’s lines always add up to it.

Hours without punches (an entered day of leave, approved leave, a holiday’s pay) are lines with hours but no clock times. Rules about times of day never touch them.

A pay period is a run of days paid together. Each has its own ledger. Your policy sets how they run:

Pay periodsHow they run
Weekly (the default)Each week, from the day your weeks start on (Monday unless you say otherwise).
Every so many daysFrom a starting date: every 14 days for biweekly, or any other length.
On days of the monthMonthly from the 1st, twice a month from the 1st and 16th, and so on. A day a month doesn’t have becomes its last day. For example, the 31st is April 30.
Your own calendarA list of the dates periods start on, ending with the day after the last period.

How a pay period runs follows the policy in force on its first day. That covers its length, when its days and weeks start, and its decimals. The rules themselves follow the layers that apply each day.

A change of pay period setting takes force when the running period ends. The period holding the day before the change runs to its end. The new setting starts the day after. Its first period starts then, however the new setting would count it. Every day is in one period.

Payroll takes hours as decimals, usually to two places. Real time doesn’t always divide evenly. For example, 20 minutes is a third of an hour. So the engine doesn’t round each line on its own. It keeps time exactly. It gives each line its hours to the hundredth. Anything less than a hundredth is carried over to the next line. That way the lines always add up to the total time.

Example. Three 20-minute stretches in a day are 0.33, 0.33 and 0.34 hours. That is one hour in all.

The carry runs through the whole pay period in the order the time was worked, so the same time always gives the same lines. Each kind of pay is carried on its own. Regular time is carried over regular lines, overtime over overtime lines, and so on.

So exactly 40 hours of regular time shows as 40.00, however many overtime lines lie between its lines. The lines of each kind add up to that kind’s time. A line can show 0.00 when it is shorter than a hundredth and the carry has not yet reached one.

Whatever is still carried at the end of the period, for each kind of pay, is less than a hundredth (at two places). It is dropped. So the period’s total can be under the time on the clock by less than a hundredth for each kind of pay it has.

Your policy can ask for more or fewer decimal places, from none up to nine. This is the one part of a timecard no policy changes. A policy chooses only the number of decimal places.

Each day of a ledger shows its lines, its paid hours and its time worked. Paid hours are those of the lines in paid categories. A lunch that is not paid is a line, but it is not in them. The period’s totals are the sums of its days.

A week shows the lines of the pay periods its days fall in. Weeks and pay periods may not line up, for example weeks from Sunday and pay periods from the 1st and 16th. Then a week takes some days from one ledger and some from the next. Its totals are their sum.

Besides its lines, each ledger shows:

  • its exceptions;
  • the stretches of work, with their punched and rounded times and what each rule did to them;
  • the device each stretch of work was punched on (punches);
  • the schedule of its days (schedules);
  • the leave requests with a day in the period, and where each stands (leave requests);
  • the time off earned, used and adjusted in it, and the balances at its end (accruals);
  • the person’s details (exempt, payroll id and so on) as they stood on its last day (people);
  • where its approvals stand (approvals);
  • whether, and when, it was closed (period close).

You never ask for a timecard to be worked out again. A late punch, a correction, or a change to setup or policy reworks the timecards it affects, from the first day it reaches. A new punch on Friday leaves the days before Friday as they were. The result is the same as working the whole period out from scratch.

Each timecard notes why it was last worked out and what was redone. So you can see what a change touched (recalculation).