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.
What you set up
Section titled “What you set up”| Setup | What it is |
|---|---|
| Dimension | Something 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. |
| Assignment | A 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). |
| Mapping | One 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 shift | The person’s shifts, from their schedule. A shift can say which assignment or job its work is on. |
| Defaults | Values 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).
Where each value comes from
Section titled “Where each value comes from”Each dimension takes its value from the first place that gives one, in this order. A later place never overrides a value already given.
| In order | What it gives |
|---|---|
| 1. The punches | What 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 shift | What the shift the work belongs to says. |
| 3. The clock | The 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 location | The values of the work location the person is at that day. |
| 5. The assignment | If nothing named an assignment and the person has exactly one active that day, that one. Then that assignment’s own defaults. |
| 6. Defaults | The person’s defaults, then the company’s. |
| After each | Any mappings in force that day, followed until nothing new comes from them. |
Which punch gives the work its values
Section titled “Which punch gives the work its values”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.
Nothing is guessed
Section titled “Nothing is guessed”Anything that doesn’t work out cleanly is flagged as an exception. The work keeps whatever did work out:
| Exception | When |
|---|---|
context_missing | A required dimension has no value. |
context_not_allowed | A value the dimension, or the person’s assignment, doesn’t allow. |
context_conflict | Two 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_inactive | Work on an assignment that isn’t active that day. |
assignment_ambiguous | The 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.
Changes from a date
Section titled “Changes from a date”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.
Spreading overtime cost
Section titled “Spreading overtime cost”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.
| Rule | What it does |
|---|---|
spread_overtime_premium | Shares 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_hours | Shares 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.