Skip to main content

Calculation rules overview

Written by Marko Klopčič

Calculation rules: how All Hours turns clockings into hours

Calculation rules are the brain of All Hours. They define how clock-ins, clock-outs and absences are turned into the hours you finally see on the timeline, in reports, and in your payroll export.

Once you understand four concepts - system rules, daily counters, accruals and time policies - you understand the whole calculation engine. This article explains what each one is, how they fit together, and how rules actually reach an individual employee.


1. Two levels of rules: global and time policy

All Hours has two levels of calculation settings.

The global (system) level is the default for the whole organisation. It applies to every employee who has nothing else assigned. You find it under Settings › Global Time Rules.

A Time policy is a deviation from the global level. A time policy inherits every global setting, and you change only the rules that genuinely differ for a particular group of employees.

This is the single most important principle when configuring calculation:

Set the global level so it fits the majority. For every exception, create a time policy and override only the rules that are actually different.

Why it matters: if you override a rule you didn't need to, you have created a second place to maintain. A year from now you change the global setting, that group silently doesn't follow, and you won't notice until the numbers are wrong on a payslip.

Inside a time policy, every individual rule has a Configuration type:

Setting

Meaning

Use system-level settings

The rule is inherited from the global level

Override / New configuration

The rule is defined specifically for this group


2. The three groups of calculation rules

Whether you are looking at the global level or at a time policy, the settings are always split into the same three groups.

2.1 System rules

This is a fixed, preset list of built-in rules. You cannot add or delete them - you can only configure or disable them. They describe the basic anatomy of a working day.

Shift Start - defines when the working day begins. It is the reference point that Paid Time and Required Time attach to, which makes it the first rule you should configure. It appears as a red marker in the Employee Day view.

If Shift Start is wrong, Paid Time, daily difference and balance will all be wrong too. Everything downstream shifts with it.

Shift Plan - the employee's work quota for a given day (e.g. 8 hours). The plan is the benchmark the system uses to decide whether someone worked more (overtime) or less (deficit) than required. It also feeds Running Balance, Running Overtime, Daily Overtime and holiday bonus calculations.

Paid Time - defines which part of an employee's presence counts as paid. Attendance outside this window is unpaid time: still visible on the timeline and in analytics, but not counted for payroll. The two key parameters are:

  • Duration - how much of the shift counts as paid time

  • Start offset - how much paid time starts before the shift start (e.g. when arriving 15 minutes early is allowed)

Paid time is drawn as a green line on the timeline. If the rule is disabled, all presence is calculated as unpaid time.

Required Time - the period of the day when the employee must be at work (core hours in a flexitime arrangement). It is an informational rule: it does not change the number of calculated hours, it records violations, shown as a purple line. Two types are available:

  • Required time by days - set duration and start offset for each day individually

  • Equals to paid time -required time follows paid time; you can additionally set a tolerance at arrival and departure, and choose whether that tolerance shortens paid time

Breaks / lunch - controls how the lunch break is handled: whether it is deducted automatically, whether it counts as paid time, and what length is allowed.

Daily difference - the difference between worked (paid) time and planned time for a single day. Positive means a surplus, negative a deficit. This is the value the balance is built from.

Running balance - the sum of daily differences in the active calculation period. By default it carries over into the next month. You can configure automatic cutting or transfer at month or year end:

  • set the balance to zero,

  • cut if the balance exceeds a threshold,

  • add (reduce a negative balance) if it is below a threshold,

  • or apply both at once.

Cutting is triggered by a Payday event in the calendar - without that calendar event, the rule will never run.

2.2 Daily counters

Daily counters are a custom, extensible list. System rules describe what a day looks like; daily counters extract the specific numbers you need for payroll or reporting - night work, Sunday work, work from home, overtime above 8 hours, presence inside a given time window.

Each daily counter has a type that determines what is being counted:

Type

What it counts

Number of instances

Every appearance of the source within the day

Number of days with instances

Only the first appearance per day (result is 0 or 1)

Time value

The elapsed time belonging to the selected sources that day

You then define the calculation parameters:

  • Source - what the counter watches: an absence (e.g. vacation, sick leave) or a calculation result (e.g. paid time)

  • Source categories - narrow it down to specific categories (e.g. Work from home only)

  • Specific day limitation - e.g. Sundays only, or days marked as a holiday

  • Time interval restriction - e.g. only between 22:00 and 06:00 for night work

  • Daily threshold condition - e.g. count only what exceeds 8 hours

  • Action events - when the counter runs (every day, on a calendar event such as payday or a holiday, or on a specific date)

Example: a Night work counter is of type Time value, its source is paid time, restricted to the interval 22:00–06:00. The result is the number of night hours for each day.

2.3 Accruals (period counters)

Accruals are also a custom list, but they are not calculated per day — they are calculated per period: a month, a year, or a period you define yourself.

They are used for balances that accumulate and carry forward: vacation balance, last year's vacation balance, sick days used this year, total overtime in the calculation period.

The types and parameters are the same as for daily counters (number of instances, number of days with instances, time value; sources, categories, restrictions, thresholds). The difference is the scope of the summation, and the fact that accruals understand carrying a balance from one period into the next.

Rule of thumb: if the answer applies to a single day, use a daily counter. If it applies to a month or a year and carries forward, use an accrual.


3. How rules reach an employee

A time policy on its own does nothing. It reaches an employee along this path:

  • Time policy → Work plan → Employee (from a date)

A Work plan is the wrapper that combines one or more time policies with the conditions determining when each one applies. You always assign a work plan to an employee, never a time policy directly.

The simplest work plan contains a single time policy with no conditions — that policy then applies every day.

When you need several policies in one plan, you separate them with conditions:

  • Priority / Order - the order in which rules are checked; priority 1 is checked first

  • Day restriction -the policy applies only on selected weekdays

  • Arrival window -the policy applies only if the first clocking falls inside a given time range

In an automatic work plan, the system evaluates the rules at the first clocking of the day, from highest priority downwards, and applies the first one that matches. For that reason there must always be one rule with no restrictions at the bottom of the list — a fallback for absences and for clockings outside the defined windows. Without it, days that match no condition will not be calculated correctly.

Shift work example:

Priority

Time policy

Arrival window

1

Morning shift

05:00 – 10:00

2

Afternoon shift

12:00 – 17:00

3

Night shift

20:00 – 00:00

4

Default (no restriction)

In a rotating work plan, the sequence of shifts is known in advance and repeats. When assigning it you set the first effective date and the starting shift in the cycle — so different employees can start at different points of the same cycle and stagger the roster.

Assigning to employees: go to Identity › Users, select the employee, open the Time & Attendance tab and assign the work plan with an effective date. For several people at once, select the users, choose Actions › Assign work plan, and set the date.

An employee with no work plan assigned is calculated using the global rules.


4. Effective dates: rules have history

Every time you save a rule change, a period selection dialog opens where you choose from when the change applies.

This is important and easily overlooked: calculation rules are versioned in time. If you apply a change from the start of the current month, that month will be recalculated and figures you may already have reported will change. If you want the new setting to apply going forward only, pick a future date or the first day of the next calculation period.


5. How a day is actually calculated

The sequence is worth remembering, because it explains why one wrong rule produces wrong values everywhere downstream:

  1. The work plan selects which time policy applies to this day.

  2. Shift Start sets the reference point for the day.

  3. Shift Plan sets the quota that has to be met.

  4. Paid Time extracts the payable portion of raw presence (applying start offset, duration, limits and breaks).

  5. Required Time checks whether the employee was present during core hours and records any violation.

  6. Daily difference = paid time − plan.

  7. Running balance sums the daily differences over the period and applies any cut or transfer.

  8. Daily counters extract specific categories of hours from the day.

  9. Accruals aggregate those values across the month or year and carry balances forward.


6. Tips and common mistakes

Configure in the right order. Plan first, then shift starts, then paid time and the rest. Configuring paid time before shift starts almost always means doing the work twice.

Don't override more than you need. In a time policy, leave every rule on Use system-level settings except the ones that genuinely differ for that group.

Always keep a fallback rule. In an automatic work plan, the bottom entry should have no restrictions.

Verify on the timeline. After a change, open one employee's timeline and inspect specific days — the green line for paid time, the red marker for shift start, purple for a required time violation. For balance cutting, check the transition from the last day of the month to the first day of the next.

Choose the effective date carefully so you don't accidentally recalculate closed periods.

Can't see a setting? The System Rules, Daily counters and Accruals views require the right permissions. If they are not visible, contact your account administrator

Did this answer your question?