# BR-31 Document level allowance amount is required

Each Document level allowance (BG-20) shall have a Document level allowance amount (BT-92).

## Problem Description

> **ERROR**: EN 16931 core business rule (CEN)

## Context and Significance

This is an EN 16931 core rule. A document level allowance (BG-20) lowers the invoice total without VAT (BT-109) and the VAT base, so without its amount the recipient cannot recalculate the totals. The UBL schema already requires cbc:Amount in cac:AllowanceCharge, so BR-31 is mainly reported for CII invoices whose allowance holds only a percentage (ram:CalculationPercent) or a reason, for example when only the discount rate is known.

## Solution

Add cbc:Amount to the document level cac:AllowanceCharge where cbc:ChargeIndicator is false (CII: ram:ActualAmount in ram:SpecifiedTradeAllowanceCharge). If only a percentage is known, calculate the amount as base amount × percentage ÷ 100.

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

## Valid Examples

- BT-92 = 20.00 on a document level allowance

## Invalid Examples

- CII document level allowance with a reason and a percentage but no ram:ActualAmount (BT-92); in UBL a cac:AllowanceCharge without cbc:Amount is already an XML schema error

## Code Examples

### Valid XML
```
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>false</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:CalculationPercent>2.00</ram:CalculationPercent>
  <ram:BasisAmount>1000.00</ram:BasisAmount>
  <ram:ActualAmount>20.00</ram:ActualAmount>
  <ram:Reason>Loyalty discount</ram:Reason>
</ram:SpecifiedTradeAllowanceCharge>
```

### Invalid XML
```
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>false</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:CalculationPercent>2.00</ram:CalculationPercent>
  <ram:BasisAmount>1000.00</ram:BasisAmount>
  <ram:Reason>Loyalty discount</ram:Reason>
</ram:SpecifiedTradeAllowanceCharge>
```

## Affected Fields

- [BT-92 Document level allowance amount](/resources/xrechnung/bt-92-document-level-allowance-amount)

## Related Rules

- [BR-32](/resources/kosit-validator-errors/br-32-document-allowance-vat-category-required)
- [BR-33](/resources/kosit-validator-errors/br-33-document-allowance-reason-required)
- [BR-36](/resources/kosit-validator-errors/br-36-document-charge-amount-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.
