# BR-42 Invoice line allowance reason or reason code is required

Each Invoice line allowance (BG-27) shall have an Invoice line allowance reason (BT-139) or an Invoice line allowance reason code (BT-140).

## Problem Description

Each Invoice line allowance (BG-27) shall have an Invoice line allowance reason (BT-139) or an Invoice line allowance reason code (BT-140).

> **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

Add cbc:AllowanceChargeReason text or cbc:AllowanceChargeReasonCode (UNCL5189) to the line allowance; if both are given they must describe the same reason.

- validate
- convert

## Valid Examples

- BT-139 = "Damaged packaging"
- BT-140 = 95 (discount)

## Invalid Examples

- Line allowance with amount only, no reason or reason code

## Code Examples

### Valid XML
```
<cac:AllowanceCharge>
  <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
  <cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode>
  <cbc:AllowanceChargeReason>Damaged packaging</cbc:AllowanceChargeReason>
  <cbc:Amount currencyID="EUR">3.00</cbc:Amount>
</cac:AllowanceCharge>
```

### Invalid XML
```
<cac:AllowanceCharge>
  <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
  <cbc:Amount currencyID="EUR">3.00</cbc:Amount>
</cac:AllowanceCharge>
```

## Affected Fields

- [BT-139 Invoice line allowance reason](/resources/xrechnung/bt-139-invoice-line-allowance-reason)
- [BT-140 Invoice line allowance reason code](/resources/xrechnung/bt-140-invoice-line-allowance-reason-code)

## Related Rules

- [BR-41](/resources/kosit-validator-errors/br-41-line-allowance-amount-required)
- [BR-CO-07](/resources/kosit-validator-errors/br-co-07-line-allowance-reason-code-match)

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