# How Rates Are Selected

Source: https://docs.astalty.com.au/guide/charge-items/how-rates-are-selected

> How Astalty selects rates for support billing spans and when to use time segments.

Scheduling add-on - This feature requires the Scheduling add-on, which is available on Astalty Premium. See How to enable Scheduling.

A [Charge Item Set](https://docs.astalty.com.au/guide/charge-items/managing-charge-item-sets) usually holds a Charge Item for each part of the week: weekday daytime, weekday evening, weekday night, Saturday, Sunday and public holidays. This page explains which one Astalty picks for a given support.

## Overview

For an automatically charged support without time segments or a sleepover window, Astalty uses one Charge Item for all support hours being billed. Crossing a rate boundary does not split those hours into separate rates.

## A Support Produces One Charge Line

Astalty does **not** automatically split a support across rate bands. A support that runs from 6:00pm to 10:00pm does not become two lines at the daytime and evening rates, and a support that runs past midnight does not become two lines on two dates.

All hours use one rate, chosen mainly from the support's **end time**.

> **Check supports that cross a rate boundary**
>
> Without time segments, a support that starts on Saturday and ends on Sunday uses the **Sunday** rate for every billed hour, unless a sleepover or public holiday rule takes priority. Use time segments when the Saturday and Sunday hours must use separate rates. See [Splitting a Support Across Two Rates](#splitting-a-support-across-two-rates).

To bill different parts of the support at separate rates, configure one of these:

- a [Sleepover Window](https://docs.astalty.com.au/guide/scheduling/sleepover-window), which splits the support into the active time before, the sleepover, and the active time after
- [Support Time Segments](https://docs.astalty.com.au/guide/scheduling/support-time-segments), which are windows you enter yourself

The two can be combined on one support. Segments must sit outside the sleepover window, so they split the active time before or after it while the sleepover itself stays a single flat line.

## How the Rate Is Chosen

Astalty checks these rules in order and uses the first match.

### 1. Sleepover

A sleepover support bills the flat **night-time sleepover** item for the whole span.

This is checked **before** the public holiday rule, so a sleepover on a public holiday still bills the night-time sleepover item rather than the public holiday one.

### 2. Public Holiday

If **any part** of the support overlaps a configured public holiday for the Participant and the state of the support's address, every billed hour uses the **public holiday** rate, including hours outside the holiday itself.

The support's address determines the state, so a support at an address in a state that does not observe a given holiday is unaffected by it.

Two consequences worth knowing:

- **A support with no address cannot use the public holiday rate.** Without an address there is no state to check, so Astalty uses the day and time rules below. If a public holiday support is billing at the ordinary rate, check the support has an address.
- **Touching the holiday boundary is enough.** A support that ends at exactly 12:00am on a public holiday still uses the public holiday rate, even though no worked time falls within that day. Astalty checks public holidays before the day and time rules, so this overrides the midnight behaviour described below.

### 3. Day and Time

Otherwise, the support's end date and time determine the rate:

| The support...                                                                    | Rate            |
| --------------------------------------------------------------------------------- | --------------- |
| ends on a Saturday                                                                | Saturday        |
| ends on a Sunday                                                                  | Sunday          |
| starts on a Sunday and ends on a Monday                                           | Sunday          |
| ends on a weekday, having started on an earlier date **or** started before 6:00am | weekday night   |
| ends on a weekday after 8:00pm                                                    | weekday evening |
| ends on a weekday at any other time                                               | weekday daytime |

A few boundaries are worth being exact about:

- **8:00pm is daytime.** A support ending at exactly 8:00pm uses the weekday daytime rate. One ending at 8:01pm uses the weekday evening rate.
- **6:00am is not "before 6am".** A support starting at exactly 6:00am does not count as starting before 6:00am.
- **"Started on an earlier date" is a calendar-date comparison,** not a length. A weekday support from 8:00pm to 1:00am uses the weekday night rate because it ends on a different date, even though it is only five hours long.
- The night rule is checked **before** the evening rule, so a support that both crosses a date boundary and ends late uses the weekday night rate.

> **Supports ending exactly at midnight are rated by the day they were worked**
>
> Midnight belongs to the day that is starting, which would push a shift onto the wrong day. Astalty compensates, so a support ending at exactly 12:00am is rated against the day it was actually worked:
>
> - ends Sunday 12:00am (a Saturday shift): **Saturday**
> - ends Monday 12:00am (a Sunday shift): **Sunday**
> - ends Saturday 12:00am (a Friday shift): **weekday evening**
> - ends any other weekday 12:00am: **weekday evening**
>
>   The two weekday-evening results above assume a *Variable weekday* set. On a [*Fixed weekday*](#not-every-set-has-evening-and-night-rates) set they use **weekday daytime** instead, because that pattern has no evening band. The Saturday and Sunday results are the same on both.

## Not Every Set Has Evening and Night Rates

The rules above apply in full only to Charge Item Sets whose **Charge Rate Pattern** is *Variable weekday*.

| Charge Rate Pattern | What varies                                                                |
| ------------------- | -------------------------------------------------------------------------- |
| Variable weekday    | The full set of rules above                                                |
| Fixed weekday       | Saturday, Sunday and public holidays only; no evening or night distinction |

So on a *Fixed weekday* set, a weekday support bills the weekday daytime item whatever time of day it runs. Saturday, Sunday and public holiday rates still apply as normal. It is only the weekday evening and weekday night bands that disappear. See [Reading the Charge Rate Pattern](https://docs.astalty.com.au/guide/charge-items/managing-charge-item-sets/creating-updating-charge-item-sets#preset-specific-notes) for which presets use which.

When you create a Charge Item Set, *Variable weekday* and *Fixed weekday* are the only patterns you can choose.

> **A missing required rate prevents billing**
>
> Astalty can bill only the rate selected by these rules. If they select Sunday and the Charge Item Set has no Sunday Charge Item, charge syncing fails until you add that item to the set.
>
> **Weekday night is the exception.** If a *Variable weekday* set has no weekday night Charge Item, Astalty uses the **weekday evening** item instead. If night supports use the evening rate, check whether the set has a weekday night item.

## Splitting a Support Across Two Rates

Astalty does not split a support across rate bands automatically. To use separate rates, add a [Support Time Segment](https://docs.astalty.com.au/guide/scheduling/support-time-segments) at the rate boundary.

Each segment uses **its own** end time to select a rate and **its own** start time to date the charge line. This lets both parts use the same Charge Item Set while receiving different rates.

### Worked Example: Saturday Into Sunday

A support runs **Saturday 8:00pm to Sunday 2:00am** (six hours) on a Charge Item Set with a *Variable weekday* pattern.

**Without a segment**, the support ends on a Sunday, so all six hours bill at the **Sunday** rate on a single line dated Saturday:

| Hours                 | Rate   | Charge line dated |
| --------------------- | ------ | ----------------- |
| 8:00pm-2:00am (6 hrs) | Sunday | Saturday          |

**With a segment starting at 12:00am** using the same Charge Item Set, the support bills as two lines:

| Window                 | Rate     | Charge line dated |
| ---------------------- | -------- | ----------------- |
| 8:00pm-12:00am (4 hrs) | Saturday | Saturday          |
| 12:00am-2:00am (2 hrs) | Sunday   | Sunday            |

The first window now ends at exactly midnight on the Sunday, which is rated as **Saturday** under the midnight rule above. The segment is rated by its own end time of 2:00am on the Sunday, so it takes the **Sunday** rate and is dated Sunday.

Without [Support Time Segments](https://docs.astalty.com.au/guide/scheduling/support-time-segments), all support hours use the primary Charge Item Set.

## Things to Keep in Mind

- Travel and centre capital costs use the primary Charge Item Set and the full support start and end times, even when the support has time segments.
- Approved clock times, not the rostered times, are what billing is calculated against once a shift has them. A support rostered to end at 7:59pm but approved to 8:30pm uses the evening rate.
- These rules select the Participant charge. Scheduling payroll uses its own rules. Where you use charge-based Staff Payments, the chosen Charge Item can also determine the payment rate; see [Staff Payment Settings](https://docs.astalty.com.au/guide/finance/staff-payments/settings).
