Provide the VAT amount in the VAT accounting currency

Error PEPPOL-EN16931-R054 Peppol

Only one tax total amount must be provided where currency id equals tax currency code, if tax currency code (BT-6) is provided.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

When ram:TaxCurrencyCode is provided, exactly one ram:TaxTotalAmount must have a currencyID different from the document currency. If ram:TaxCurrencyCode is absent, no such amount in another currency may be present.

What the rule means

A provided VAT accounting currency requires exactly one corresponding VAT amount in that currency. If no VAT accounting currency is provided, no VAT amount in a different currency is expected.

Affected fields BT-6
Please match the VAT amount to the VAT accounting currency

The VAT accounting currency and VAT amount information do not match. When a VAT accounting currency is provided, exactly one VAT amount in a currency different from the invoice currency must be present.

What to do
  1. Check TaxCurrency for the VAT accounting currency provided.
  2. Check the SetTaxCurrencyExchange(...) call and the accounting currency it sets.
  3. Make sure exactly one ram:TaxTotalAmount has a currencyID different from the invoice currency.
  4. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:ApplicableHeaderTradeSettlement>
  <ram:TaxCurrencyCode>USD</ram:TaxCurrencyCode>
  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
    <ram:TaxTotalAmount currencyID="EUR">10.00</ram:TaxTotalAmount>
  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
✓ Correct
<ram:ApplicableHeaderTradeSettlement>
  <ram:TaxCurrencyCode>USD</ram:TaxCurrencyCode>
  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
    <ram:TaxTotalAmount currencyID="EUR">10.00</ram:TaxTotalAmount>
    <ram:TaxTotalAmount currencyID="USD">11.00</ram:TaxTotalAmount>
  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
Check in FactoorSharp
  • FacturXInvoice.TaxCurrency (BT-6)
  • FacturXInvoice.SetTaxCurrencyExchange(taxTotalInAccountingCurrency, accountingCurrency, conversionRate, conversionRateTimestamp) (accountingCurrency: BT-6)
Technical details

The test compares the count of ram:TaxTotalAmount elements with a currencyID different from $documentCurrencyCode to 1 when ram:TaxCurrencyCode is present, and to 0 otherwise.

Where the rule applies

The rule applies to ram:TaxTotalAmount in the VAT breakdown of the settlement header summary and to ram:TaxCurrencyCode in ram:ApplicableHeaderTradeSettlement.

Context (rule/@context)
ram:ApplicableHeaderTradeSettlement
Test expression (assert/@test)
count(ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID != $documentCurrencyCode]) = (if (ram:TaxCurrencyCode) then 1 else 0)