# BR-38 Document level charge reason or reason code is required

Each Document level charge (BG-21) shall have a Document level charge reason (BT-104) or a Document level charge reason code (BT-105).

## Problem Description

Each Document level charge (BG-21) shall have a Document level charge reason (BT-104) or a Document level charge reason code (BT-105).

> **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 (UNCL7161) to the charge; if both are given they must describe the same reason.

- validate
- convert

## Valid Examples

- BT-104 = "Freight"
- BT-105 = FC (freight charge)

## Invalid Examples

- Document charge with amount only, no reason or reason code

## Code Examples

### Valid XML
```
<cac:AllowanceCharge>
  <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
  <cbc:AllowanceChargeReasonCode>FC</cbc:AllowanceChargeReasonCode>
  <cbc:AllowanceChargeReason>Freight</cbc:AllowanceChargeReason>
  <cbc:Amount currencyID="EUR">9.90</cbc:Amount>
</cac:AllowanceCharge>
```

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

## Affected Fields

- [BT-104 Document level charge reason](/resources/xrechnung/bt-104-document-level-charge-reason)
- [BT-105 Document level charge reason code](/resources/xrechnung/bt-105-document-level-charge-reason-code)

## Related Rules

- [BR-36](/resources/kosit-validator-errors/br-36-document-charge-amount-required)
- [BR-37](/resources/kosit-validator-errors/br-37-document-charge-vat-category-required)
- [BR-CO-06](/resources/kosit-validator-errors/br-co-06-charge-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.
