# BR-CO-08 Line charge reason and code must agree

The invoice line charge reason code (BT-145) and the invoice line charge reason (BT-144) shall indicate the same type of charge reason.

## Problem Description

The invoice line charge reason code (BT-145) and the invoice line charge reason (BT-144) shall indicate the same type of charge reason.

> **ERROR**: XRechnung 3.0

## Context and Significance

This EN16931 core rule enforces semantic agreement between coded and free-text charge reasons at line level, mirroring the document-level rule BR-CO-06.

## Solution

Within the invoice line charge, make the free-text reason (BT-144) and the coded reason (BT-145) describe the same charge.

- validate
- convert

## Valid Examples

- BT-145 = ABL (Packaging) with BT-144 = "Special packaging"

## Invalid Examples

- BT-145 = ABL (Packaging) with BT-144 = "Loyalty discount"

## Code Examples

### Valid XML
```
<cac:InvoiceLine>
  <cac:AllowanceCharge>
    <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
    <cbc:AllowanceChargeReasonCode>ABL</cbc:AllowanceChargeReasonCode>
    <cbc:AllowanceChargeReason>Special packaging</cbc:AllowanceChargeReason>
    <cbc:Amount currencyID="EUR">3.00</cbc:Amount>
  </cac:AllowanceCharge>
</cac:InvoiceLine>
```

### Invalid XML
```
<cac:InvoiceLine>
  <cac:AllowanceCharge>
    <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
    <cbc:AllowanceChargeReasonCode>ABL</cbc:AllowanceChargeReasonCode>
    <cbc:AllowanceChargeReason>Loyalty discount</cbc:AllowanceChargeReason>
    <cbc:Amount currencyID="EUR">3.00</cbc:Amount>
  </cac:AllowanceCharge>
</cac:InvoiceLine>
```

## Affected Fields

- [BT-144 Invoice line charge reason](/resources/xrechnung/bt-144-invoice-line-charge-reason)
- [BT-145 Invoice line charge reason code](/resources/xrechnung/bt-145-invoice-line-charge-reason-code)

## Related Rules

- [BR-CO-06](/resources/kosit-validator-errors/br-co-06-charge-reason-code-match)
- [BR-CO-24](/resources/kosit-validator-errors/br-co-24-line-charge-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.
