> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hr-easy.nlead.ch/llms.txt
> Use this file to discover all available pages before exploring further.

# The monthly run

> Opening, computing, correcting, locking and dispatching a Lohnabrechnung.

The monthly **Lohnabrechnung** is the unit of payroll work. A run has exactly two
states, and the transition between them is one-way.

| State    | Meaning                                                    |
| -------- | ---------------------------------------------------------- |
| `OPEN`   | Line items can be recomputed and corrections applied.      |
| `CLOSED` | Locked. No edits. The line items are the auditable record. |

## The cycle

<Steps>
  <Step title="Open the run">
    Choose the month and the legal entity. The run picks up every employee active in
    that month, including joiners and leavers with their partial periods.

    Permission: `tenant:payroll-run:edit` (`ADMIN`+).
  </Step>

  <Step title="Compute">
    The engine builds each employee's line items from the employment period in force,
    the recurring earnings, the recorded absences, the time entries for hourly staff,
    the Lohnart catalog and the insurance configuration.

    Compute is repeatable. Corrected an absence? Recompute — the run is `OPEN`, and the
    result is deterministic.
  </Step>

  <Step title="Review">
    Two views: the **Übersicht** across all employees, and the per-employee detail down
    to individual line items. HR staff can see both (`tenant:payroll-run:view`) even
    though they cannot change them.

    This is where you check the month-on-month deltas — a salary that moved without a
    corresponding change on the employee record is the thing to catch here.
  </Step>

  <Step title="Correct">
    On an `OPEN` run you can add manual **Korrekturen** — a one-off earning, a
    retroactive adjustment, an extra deduction — each against a Lohnart so it books and
    declares correctly. You can also set the per-employee free text
    (*individueller Text*) that appears on the payslip, and adjust the vacation
    counters shown there.
  </Step>

  <Step title="Lock">
    Locking closes the run permanently. Permission: `tenant:payroll-run:lock`
    (`ADMIN`+).

    <Warning>
      A locked run cannot be reopened. A correction after locking is made in a
      subsequent run as a retroactive adjustment — which is exactly how Swiss payroll
      corrections are supposed to work, and why the lock is a hard boundary rather than
      a soft one.
    </Warning>
  </Step>

  <Step title="Dispatch payslips">
    Payslip PDFs are e-mailed to employees. Each dispatch is tracked per employee —
    `PENDING` while the send is in flight, then `SENT` or `FAILED` — so a failed send is
    visible and re-sendable rather than lost.

    Permission: `tenant:payroll-run:dispatch` (`ADMIN`+). Mailing a payslip ships
    financial data outside the system, so it sits at the same tier as locking.
  </Step>
</Steps>

## What the engine computes

For each employee, in order:

1. **Gross** — salary from the employment period, prorated for partial months, plus
   recurring earnings, hourly time, and one-off corrections.
2. **Absence effects** — unpaid absence reduces the base; illness and accident route
   through their own Lohnarten with the
   [salary-continuation](/guides/time-absence/sick-leave) entitlement applied.
3. **Bases** — the AHV, ALV, UVG, KTG and BVG bases, each assembled from the Lohnarten
   flagged as belonging to it.
4. **Deductions** — social insurance at the configured rates, split employer/employee.
5. **Quellensteuer** — where applicable, from the cantonal tariff for the employee's
   profile.
6. **Net** — and the payment amount, which may differ where there are non-cash items.

All of it in decimal arithmetic, rounded to rappen only at the boundary.

## Bulk exports

A locked run produces the month's artefacts in one action
(`tenant:payroll-run:export`, `ADMIN`+):

* **Sammel-PDF** — every payslip in one file.
* **Buchungsjournal** — the journal entries for accounting.
* **Rekapitulation** — the month's totals per Lohnart and per account.

These aggregate every employee's compensation, which is why they sit at the same
permission tier as locking and dispatch.

## Lohnkonten

Per-employee and aggregate year-to-date payroll accounts, derived from the line items.
Read-only (`tenant:lohnkonto:view`, `HR_STAFF`+) — they mutate nothing and HR needs
them for monthly review and for answering employee questions.

## Corrections after locking

| Situation                            | What to do                                                            |
| ------------------------------------ | --------------------------------------------------------------------- |
| Wrong salary, run still open         | Fix the employment period and recompute.                              |
| Wrong salary, run locked             | Add a retroactive correction to the next run.                         |
| Absence recorded late                | Next run picks it up as a retroactive adjustment.                     |
| Employee left, discovered after lock | Retroactive correction plus a deregistration in the next declaration. |
| Payslip mailed to the wrong address  | Correct the record, resend from the dispatch view.                    |
