# Auto-accrual of night-work credit

**For:** Admin

{{ app_name }} accrues time-compensation credit for you whenever a worker submits time on a shift that's eligible for Swiss ArG 17b (Arbeitsgesetz, Swiss labor law) night-work compensation. You don't have to post the rows by hand — they appear in the ledger as soon as the time entry is submitted.

## What it does

When a time entry is submitted on the {doc}`/track-time/timesheet/index`, the system asks two questions:

1. Is the shift's work rule a Swiss rule with **'Enable ArG 17b time compensation'** turned on? See {doc}`/rules-and-compliance/work-rules/swiss-night-work`.
2. Did any of the worked time fall inside the rule's night band?

If both answers are yes, the system multiplies the night-band minutes by the rule's compensation rate (10% by default) and posts a positive row to the person's time-comp ledger, tagged with the source shift and the source **'Night-work accrual'**.

The accrual is **reversed** automatically when the time entry is **unsubmitted** on the timesheet (i.e. clock data is cleared). Unsubmit posts an offsetting **'Manual adjustment'** row of equal magnitude pointing at the same source shift. The original positive row is never edited — that keeps the ledger immutable and the audit trail intact.

```{note}
Unapproving a time entry does **not** by itself reverse the accrual — the underlying clock data is still there. To reverse, unsubmit (clear attendance) first; unapprove on its own only clears the approval timestamp.
```

## When it kicks in

- **On submit.** As soon as the row leaves **'Published'** for **'Submitted'** on the timesheet, the accrual posts. Only the worked portion of the shift counts — not the scheduled portion.
- **On unsubmit.** The matching reversal row posts immediately.
- **Re-submit.** Submitting the row again posts a fresh accrual; the old reversal stays in the audit trail.

The auto-accrual is independent of the night pay premium ({doc}`/rules-and-compliance/work-rules/premiums`). Both can apply to the same hour — they're different forms of compensation under the law.

## How it shows in the app

- The ledger row's source column says **'Night-work accrual'** and links to the originating shift. See {doc}`detail`.
- The Payroll report breaks out night-compensation hours separately from regular and overtime hours.
- A reversed accrual shows as two rows in the ledger — the original positive entry and the offsetting negative entry — both linked to the same shift.

## Related

- {doc}`/rules-and-compliance/work-rules/swiss-night-work`
- {doc}`view-time-compensation`
- {doc}`detail`
- {doc}`/track-time/timesheet/index`
