# 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

> **ERROR**: EN 16931 calculation and consistency rule (BR-CO)

## Context and Significance

This rule is the line-level counterpart of BR-CO-06. The EN 16931 validation artefacts for UBL and CII that the KoSIT validator uses contain only a placeholder check for BR-CO-08 that always passes, so BR-CO-08 never appears in a validation report. The requirement still applies: a line charge whose reason code (BT-145) and text (BT-144) contradict each other, such as code ABL (Additional packaging) with the text "Loyalty discount", leads to manual review at the buyer. A typical cause is a discount that was entered as a negative surcharge in the ERP.

## Solution

Within the invoice line charge, make the free-text reason (BT-144) and the reason code (BT-145) describe the same charge, for example code ABL (Additional packaging) with the text "Special packaging". If the amount is actually a discount, model it as an invoice line allowance (BG-27).

- [Validate XML](/en/xrechnung-validator?source=resource&rule=BR-CO-08)
- [Convert invoice](/en/pdf-to-xrechnung?source=resource&rule=BR-CO-08)

## Valid Examples

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

## Invalid Examples

- BT-145 = ABL (Additional 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://github.com/itplr-kosit/validator): Run the official KoSIT validator with the XRechnung configuration to check EN 16931 and XRechnung rules.
- [Convert PDF to XRechnung](/pdf-to-xrechnung): Find validation errors during conversion and review each correction.

## Related Resources

- [Official Specification](https://docs.peppol.eu/poacc/billing/3.0/rules/ubl-tc434/)
- [Test Suite](https://github.com/itplr-kosit/xrechnung-testsuite)
- [All validation errors](/resources/kosit-validator-errors): Overview of the EN 16931, XRechnung and Peppol validation rules explained here.
