# PEPPOL-EN16931-R051

Source: https://xmlvalid.com/rules/PEPPOL-EN16931-R051

> All currencyID attributes must have the same value as the invoice currency code (BT-5), except for the invoice total VAT amount in accounting currency (BT-111).

- Level: error
- Rule sets: Peppol BIS Billing 3.0 rules 3.0.21
- Context: `cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cac:TaxTotal[cac:TaxSubtotal]/cbc:TaxAmount | cac:TaxSubtotal/cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount`
- Test: `@currencyID = $documentCurrencyCode`

## Why it fails

- An amount has a `currencyID` other than the invoice currency (`cbc:DocumentCurrencyCode`), for example EUR on a line of an invoice in SEK.
- Amounts were copied from an order or a price list in another currency.

## How to fix it

- Every amount takes the invoice currency. Only the second `cac:TaxTotal/cbc:TaxAmount`, the VAT total in the accounting currency (BT-111), may differ.

Validate a document against these rules: https://xmlvalid.com/validate
