# BR-33 Document level allowance reason or reason code is required

Each Document level allowance (BG-20) shall have a Document level allowance reason (BT-97) or a Document level allowance reason code (BT-98).

## Problem Description

Each Document level allowance (BG-20) shall have a Document level allowance reason (BT-97) or a Document level allowance reason code (BT-98).

> **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 allowance; if both are given they must describe the same reason.

- validate
- convert

## Valid Examples

- BT-97 = "Volume discount"
- BT-98 = 95 (discount)

## Invalid Examples

- Document 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>Volume discount</cbc:AllowanceChargeReason>
  <cbc:Amount currencyID="EUR">20.00</cbc:Amount>
</cac:AllowanceCharge>
```

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

## Affected Fields

- [BT-97 Document level allowance reason](/resources/xrechnung/bt-97-document-level-allowance-reason)
- [BT-98 Document level allowance reason code](/resources/xrechnung/bt-98-document-level-allowance-reason-code)

## Related Rules

- [BR-31](/resources/kosit-validator-errors/br-31-document-allowance-amount-required)
- [BR-32](/resources/kosit-validator-errors/br-32-document-allowance-vat-category-required)
- [BR-CO-05](/resources/kosit-validator-errors/br-co-05-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.
