# BR-30 Invoice line period end must not precede its start

If both Invoice line period start date (BT-134) and Invoice line period end date (BT-135) are given, BT-135 shall be later than or equal to BT-134.

## Problem Description

If both Invoice line period start date (BT-134) and Invoice line period end date (BT-135) are given, BT-135 shall be later than or equal to BT-134.

> **ERROR**: XRechnung 3.0

## Context and Significance

This rule comes from the EN16931 core semantic model enforced by the KoSIT XRechnung 3.0.2 Schematron, ensuring invoices carry the mandatory data needed for automated processing.

## Solution

Correct cac:InvoiceLine/cac:InvoicePeriod so cbc:EndDate is on or after cbc:StartDate, or remove the line period if not needed.

- validate
- convert

## Valid Examples

- BT-134 = 2026-02-01, BT-135 = 2026-02-28

## Invalid Examples

- BT-134 = 2026-02-28, BT-135 = 2026-02-01 — end before start

## Code Examples

### Valid XML
```
<cac:InvoiceLine>
  <cac:InvoicePeriod>
    <cbc:StartDate>2026-02-01</cbc:StartDate>
    <cbc:EndDate>2026-02-28</cbc:EndDate>
  </cac:InvoicePeriod>
</cac:InvoiceLine>
```

### Invalid XML
```
<cac:InvoiceLine>
  <cac:InvoicePeriod>
    <cbc:StartDate>2026-02-28</cbc:StartDate>
    <cbc:EndDate>2026-02-01</cbc:EndDate>
  </cac:InvoicePeriod>
</cac:InvoiceLine>
```

## Affected Fields

- [BT-134 Invoice line period start date](/resources/xrechnung/bt-134-invoice-line-period-start-date)
- [BT-135 Invoice line period end date](/resources/xrechnung/bt-135-invoice-line-period-end-date)

## Related Rules

- [BR-29](/resources/kosit-validator-errors/br-29-invoicing-period-end-after-start)

## Validation Tools

- [Official KoSIT Validator](https://erechnungsvalidator.service-bw.de/): Validate your XRechnung files against all BR-DE rules.
- [Convert PDF to XRechnung](/pdf-to-xrechnung): Automatic validation error fixes when converting.

## Related Resources

- [Official Specification](https://xeinkauf.de/xrechnung/)
- [Test Suite](https://github.com/itplr-kosit/xrechnung-testsuite)
- [Complete Error List](/resources/kosit-validator-errors): Overview of all German XRechnung validation rules.
