Skip to content

Labor context

Every stretch of work is charged to something. That can be the assignment it’s for, the job, the work code, the cost center, the project, the location, or the customer. Together these are the work’s labor context. Rates, overtime rules, approvals and reports all use it.

The things a company charges time to are its dimensions. Which ones exist is up to each company. Assignment is always one of them.

SetupWhat it is
DimensionSomething time is charged to: job, cost center, project. A dimension can be required, and work without it is flagged. It can also limit which values are allowed.
AssignmentA person’s work for one employer or customer, with its first and last day. It can give the values its work takes when nothing else does (say, cost center 4410). It can also limit the values its work may have (only these jobs).
MappingOne value meaning others: “work code 7 means assignment A12 and the packing job”. Mappings have dates, so a new mapping from next month leaves last month as it was.
Scheduled shiftThe person’s shifts, from their schedule. A shift can say which assignment or job its work is on.
DefaultsValues a person’s work takes when nothing else gives them, and then the company’s.

Work belongs to a scheduled shift when it starts during the shift. It also belongs to the shift if it starts a little before it and a policy allows early starts (for example, up to 30 minutes early).

Each dimension takes its value from the first place that gives one, in this order. A later place never overrides a value already given.

1 The punches picked, or corrected 2 The scheduled shift 3 The clock it was punched on its values 4 The work location its values 5 The assignment and its defaults 6 Person's defaults, then the company's after each one apply the mappings work code 7 means assignment A12 and the packing job Checked assignment active, values allowed, required ones given
The first place to give a value wins, and the value remembers where it came from. Mappings apply after every step, so a work code picked at the clock decides the assignment before any shift or default does.
In orderWhat it gives
1. The punchesWhat the person picked at the clock with the punch that started the work, or with a transfer since, unless a supervisor corrected it (which punch).
2. The scheduled shiftWhat the shift the work belongs to says.
3. The clockThe values of the clock’s record as they were when the punch that started the work arrived, where the person picked none. A clock only knows where it hangs. The schedule is the plan for the person, so the shift comes first.
4. The work locationThe values of the work location the person is at that day.
5. The assignmentIf nothing named an assignment and the person has exactly one active that day, that one. Then that assignment’s own defaults.
6. DefaultsThe person’s defaults, then the company’s.
After eachAny mappings in force that day, followed until nothing new comes from them.

The values picked with a punch belong to the work that punch starts.

  • An in starts work afresh when the person was out. The work takes the values picked with that in, and none of those of work before an out.
  • Work that goes on after a lunch or a break keeps the values of the work before it. Values picked with the punch that ends the lunch or break lie over them, value by value.
  • A transfer starts work on its own values laid over those the work had.
  • A lunch or break takes the values of the work around it.

So take someone who punches in with job packing, lunches, and punches back in from lunch with nothing picked. They work on packing all day. After an out, an in with nothing picked starts work on nothing from the punches. The places below it give what they give.

Example. Assignment A12 charges cost center 4410 by default, and work code 7 means assignment A12 and the packing job. Someone punches in with work code 7. Their work is on these values:

  • Assignment A12, from the work code.
  • Job packing, from the work code.
  • Cost center 4410, from the assignment.
  • Work code 7, from the punch.

Each value shows where it came from, so anyone can see why the time was charged where it was.

Time without punches is charged the same way, without the punches and the shift. A labor entry starts from what it names. It also starts from the stretch of work it belongs to, if it says one. An approved leave request starts from the assignment, then the defaults.

Anything that doesn’t work out cleanly is flagged as an exception. The work keeps whatever did work out:

ExceptionWhen
context_missingA required dimension has no value.
context_not_allowedA value the dimension, or the person’s assignment, doesn’t allow.
context_conflictTwo sources disagree. For example, the punch names assignment A15, but its work code means A12. The first value stays, and the conflict is flagged.
assignment_inactiveWork on an assignment that isn’t active that day.
assignment_ambiguousThe person has more than one assignment active that day and nothing says which this work is for.

When a person has two assignments, the schedule usually settles it. Say their shift starts at 07:00 on assignment A15. They punch in at 06:55, and early starts aren’t allowed. That first stretch isn’t part of the shift, so it’s flagged as ambiguous. After lunch, inside the shift, the work goes to A15. Allow starts up to 30 minutes early, and the 06:55 punch goes to A15 too.

When a person has more than one assignment and nothing says which some work is for, your policy can choose. It can pick the person’s primary assignment, or the first of an order of preference. The choice is noted on the work. Without such a rule, the work is flagged as assignment_ambiguous.

Assignments and mappings have dates. The values an assignment allows apply while it is active. Say a mapping changes on the 7th. It applies to work from the 7th, and work on the 6th keeps the mapping it had. Changing setup never rewrites the past.

Overtime is worked out on the whole week, so the overtime premium falls on the last hours worked. Say someone works 30 hours at one branch and then 20 at another. Their 10 overtime hours are all at the second. The second branch then carries the whole premium for a week the first had most of.

Your business rules can spread the premium’s cost over the branches, cost centers, jobs or assignments worked at in the week. The spread is in proportion to the hours at each: 30 of 50 hours is 60% of the premium. The straight time of every hour stays with where it was worked. The person’s pay does not change, only where its cost is charged.

RuleWhat it does
spread_overtime_premiumShares the money the overtime rules added over the values of one dimension, in proportion to the hours worked at each. The parts add up to the money exactly.
spread_overtime_hoursShares the overtime hours themselves, and the money in them, over the values in proportion to their hours, for reports of hours by branch.

The cookbook’s overtime cost spread recipe shows the settings and the week it spreads.