# BR-CO-05 Document allowance reason and code must agree

The document level allowance reason code (BT-98) and the document level allowance reason (BT-97) shall indicate the same type of allowance.

## Problem Description

The document level allowance reason code (BT-98) and the document level allowance reason (BT-97) shall indicate the same type of allowance.

> **ERROR**: XRechnung 3.0

## Context and Significance

This EN16931 core rule keeps the human-readable and coded allowance descriptions semantically consistent so downstream systems interpret the deduction the same way.

## Solution

Align the free-text reason (BT-97) with the coded reason (BT-98) so both describe the same allowance, e.g. code 95 with a discount description.

- validate
- convert

## Valid Examples

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

## Invalid Examples

- BT-98 = 95 (Discount) with BT-97 = "Late delivery penalty"

## 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">10.00</cbc:Amount>
</cac:AllowanceCharge>
```

### Invalid XML
```
<cac:AllowanceCharge>
  <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
  <cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode>
  <cbc:AllowanceChargeReason>Late delivery penalty</cbc:AllowanceChargeReason>
  <cbc:Amount currencyID="EUR">10.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-CO-06](/resources/kosit-validator-errors/br-co-06-charge-reason-code-match)
- [BR-CO-21](/resources/kosit-validator-errors/br-co-21-document-allowance-reason-required)

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