> For the complete documentation index, see [llms.txt](https://kb.logicerp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-setups/shift-roster/how-generating-the-roster-works.md).

# How Generating the Roster Works

**Available on:** Desktop · Web · Phone

**Generating** turns each employee's roster lines into a day-by-day roster: the shift for every day, and which days are week-offs or half-day week-offs. It runs when you answer **Yes** after saving in [Allocate Roster](/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-entry/allocate-roster.md), and from [Generate Roster](/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-entry/generate-roster.md).

## Which line applies on a day

An employee can have several roster lines. On each day, of the lines that cover that day, the one with the **latest Date From** applies. (Two lines of one employee cannot start on the same date.) A day that no line covers gets no roster day.

> **Example —** Sunita has two lines: GENERAL SHIFT from 1 April with no end date, and NIGHT SHIFT from 1 November to 30 November. In November the night shift applies, because its Date From is later. From 1 December, GENERAL SHIFT applies again: it is the only line covering those days.

## Where the week-offs come from

Each day takes its week-offs from **one** pattern:

| Line type    | Pattern used                                                                                                     |
| ------------ | ---------------------------------------------------------------------------------------------------------------- |
| **SHIFT**    | The line's **Week-off Pattern**; when it is (SHIFT'S OWN), the shift's own pattern from Setup Payroll Shifts     |
| **ROTATION** | The pattern of the **rotation step** running that day; when it is (SHIFT'S OWN), that step's shift's own pattern |

With no pattern found, the day has no week-off. If a pattern gives both a full day off and a half-day off on the same date, the full day off wins.

### **Rotations and cycles**

* A **rotation** starts on the line's **Anchor Date** (or its Date From when blank), on the **Anchor Step**, and then runs its steps in order, round and round.
* A **rotating cycle** week-off pattern (for example 6 days on, 1 off) counts its day 1 from the same anchor date: the line's Anchor Date, or its Date From when blank. On a rotation, the cycle counts from the line's anchor, not from the start of each step.

> **Example —** A rotation has two steps: DAY SHIFT for 7 days, then NIGHT SHIFT for 7 days — a 14-day cycle. Ravi's line starts on 1 November with **Anchor Step** 2. So he works NIGHT SHIFT from 1 to 7 November, DAY SHIFT from 8 to 14 November, NIGHT SHIFT again from 15 November, and so on.

## Branch holidays and the employee's holiday list

Generating writes the full-day week-offs into the **employee's own holiday list** — the list payroll and attendance already read for employee-wise holidays. Half-day week-offs are kept on the roster day only; they are not added to the holiday list. When attendance is saved for a half-day off, the off half is charged to a leave — see [Setup Week-off Patterns](/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-setups/setup-week-off-patterns.md).

* **Follow Branch Holidays = Yes** on the line: the branch's holidays (**Setup Holidays**) are added to the employee's list too. On a rostered day a branch holiday counts — it takes the place of any week-off that day — but a branch **weekly-off** does not: the roster decides the week-offs.
* **Follow Branch Holidays = No**: no branch holidays are added. The employee gets only the roster's week-offs and any holidays entered by hand.
* **The first time** an employee is rostered, they switch to **employee-wise holidays**. This payroll year's branch holidays are copied into their own list first, so the days already passed keep the holidays they had.
* Holidays entered by hand in **Setup Employee Wise Holidays** are never changed or removed by generating, and on such a date no week-off is added.

## Days that are never changed

Generating never changes:

* days **before today** (today itself is generated again),
* days in a **payroll period already processed** for the employee,
* days **before the employee joined** or **after they left**.

Days **changed by hand** in [Roster Calendar](/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-entry/roster-calendar.md) keep the shift and week-off set by hand.

If an employee cannot be generated — for example a shift, rotation or week-off pattern their line uses can no longer be found — **nothing** is changed for that employee, and the others still go through. The message says why.

## When you change something

* **Changing a pattern, shift, rotation or line does not change days already generated.** Generate again for the employees concerned. Save in [Allocate Roster](/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-entry/allocate-roster.md) offers this, and [Generate Roster](/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-entry/generate-roster.md) does it for many employees at once.
* **Deleting all of an employee's lines** keeps the days already generated. To put the employee back on the branch's holidays, use **Switch to Branch Holidays** in [Allocate Roster](/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-entry/allocate-roster.md). It removes their roster days from today on (or from after the last processed payroll period), and is refused while they still have holidays entered by hand from today on.
* **A new payroll year:** generating proposes to run up to the end of the payroll year that covers today; in [Generate Roster](/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-entry/generate-roster.md) you can change that date. At the start of a new year, run [Generate Roster](/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-entry/generate-roster.md) with **All Rostered Employees** to extend everyone's roster.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-setups/shift-roster/how-generating-the-roster-works.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
