> ## 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.

# Payments and accounting

> pain.001 payment batches, camt reconciliation, FIBU transfer, and authority notifications.

Once a run is locked, three things leave the system: money, journal entries, and
declarations.

## Salary payments (pain.001)

A locked run produces a **payment batch** — an ISO 20022 `pain.001` credit-transfer
file addressed to the company's bank, one instruction per employee, drawn from the
bank accounts on the employee records.

| Step         | Permission                                  | Notes                                   |
| ------------ | ------------------------------------------- | --------------------------------------- |
| View batches | `tenant:payment-batch:view` (`HR_STAFF`+)   | Inspect what would be paid.             |
| Export       | `tenant:payment-batch:export` (`ADMIN`+)    | Produces the XML that goes to the bank. |
| Reconcile    | `tenant:payment-batch:reconcile` (`ADMIN`+) | Upload the bank's camt file.            |

An HR staffer can inspect a batch but cannot initiate a disbursement. That split is the
point.

### Idempotency

Batch creation is a cost-bearing operation, so it is **idempotent**: a client retrying
after a network blip presents the same `Idempotency-Key`, and the stored response is
replayed rather than a second batch being created. Keys are scoped per route so the
same key from two endpoints cannot collide.

### Reconciliation

The bank returns `camt.054` (debit notifications) or `camt.053` (statements). Uploading
one flips each payment instruction from `TRANSMITTED` to `CONFIRMED` or `FAILED`, so
the batch reflects what actually happened to the company's money rather than what was
intended.

A failed instruction — closed account, wrong IBAN — is visible per employee and can be
reissued.

## Financial accounting transfer (FIBU)

The **Finanzbuchhaltungs-Übertragung** turns a locked run into journal entries using
the [Kontenplan](/guides/payroll/master-data#kontenplan) mapping.

<Steps>
  <Step title="Preview">
    Check the preconditions and the entries that would be posted. Available to `HR_STAFF`+
    (`tenant:booking-batch:view`), including an Excel download.
  </Step>

  <Step title="Transfer">
    Flips the batch from `DRAFT` to `TRANSFERRED` and locks the entries. `ADMIN`+ only
    (`tenant:booking-batch:transfer`) — so a staffer cannot accidentally double-post a month.
  </Step>
</Steps>

Booking aggregates are computed in decimal throughout. A twelve-month aggregate built
on floating-point math was the third case that motivated
[ADR-007](/development/adr).

## Authority notifications (Behörden-Meldungen)

Two families of notification run monthly rather than annually:

<AccordionGroup>
  <Accordion title="EMA — event notifications">
    Wage-relevant events reported to the authority as they happen: joiners, leavers,
    and material changes.

    View and edit are `HR_STAFF`+; **submit** is `ADMIN`+. Submitting flips a
    submission from `DRAFT` to `TRANSMITTED` — the file leaves the system or is posted
    to ELM, and from that point corrections are a formal procedure.
  </Accordion>

  <Accordion title="QST — Quellensteuer">
    Monthly withholding-tax reports per canton, plus corrections for prior periods.
    Same view/edit/submit split.

    Corrections exist as a first-class concept because retroactive QST adjustments are
    routine — a tariff code corrected in March affects January and February.
  </Accordion>
</AccordionGroup>

## Lohnbüro export

Installations that keep payroll in an external Lohnbüro do not run the engine. They
use the platform for people data and export the month's inputs — employment terms,
absences, time, changes — in the format the payroll provider expects.

## Sequence

For a normal month:

<Steps>
  <Step title="Lock the run" />

  <Step title="Dispatch payslips">
    Employees should have the payslip before the money arrives, not after.
  </Step>

  <Step title="Create and export the payment batch">
    Respect the bank's cut-off for the value date.
  </Step>

  <Step title="Transfer to accounting" />

  <Step title="Submit EMA and QST" />

  <Step title="Reconcile camt when the bank returns it" />
</Steps>
