# BR-CO-24 Line charge needs a reason or reason code

Each invoice line charge (BG-28) shall contain an invoice line charge reason (BT-144) or an invoice line charge reason code (BT-145), or both.

## Problem Description

Each invoice line charge (BG-28) shall contain an invoice line charge reason (BT-144) or an invoice line charge reason code (BT-145), or both.

> **ERROR**: XRechnung 3.0

## Context and Significance

This EN16931 core rule is the line-level counterpart of BR-CO-22, requiring every line surcharge to be justified.

## Solution

For every invoice line charge, add an AllowanceChargeReason (BT-144) and/or AllowanceChargeReasonCode (BT-145).

- validate
- convert

## Valid Examples

- Line charge with BT-145 = ABL and BT-144 = "Special packaging"

## Invalid Examples

- Line charge amount 3.00 with neither BT-144 nor BT-145

## 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:Amount currencyID="EUR">3.00</cbc:Amount>
  </cac:AllowanceCharge>
</cac:InvoiceLine>
```

## Affected Fields

- [BG-28 Invoice line charges](/resources/xrechnung)
- [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-08](/resources/kosit-validator-errors/br-co-08-line-charge-reason-code-match)
- [BR-CO-22](/resources/kosit-validator-errors/br-co-22-document-charge-reason-required)
- [BR-CO-23](/resources/kosit-validator-errors/br-co-23-line-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.
