VAT total must match the sum of VAT category amounts

Error BR-CO-14 EN 16931

Invoice total VAT amount (BT-110) = Σ VAT category tax amount (BT-117).

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

The VAT total ram:TaxTotalAmount does not equal the sum of the ram:CalculatedAmount values in the ram:ApplicableTradeTax entries, rounded to two decimal places.

What the rule means

The total VAT amount (BT-110) must equal the sum of the VAT category tax amounts (BT-117).

Affected fields BT-110 BT-117
Please make the VAT total match the tax amounts for each category

The stated VAT total differs from the sum of the VAT amounts for each category. These values can be brought into agreement.

What to do
  1. Compare ram:TaxTotalAmount with the ram:CalculatedAmount values in ram:ApplicableTradeTax.
  2. Check that the total equals their sum after rounding to two decimal places.
  3. Adjust the value using FacturXInvoice.TaxTotalAmount.
  4. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:TaxTotalAmount currencyID="EUR">20.00</ram:TaxTotalAmount>
<ram:ApplicableTradeTax>
  <ram:CalculatedAmount>19.00</ram:CalculatedAmount>
</ram:ApplicableTradeTax>
✓ Correct
<ram:TaxTotalAmount currencyID="EUR">19.00</ram:TaxTotalAmount>
<ram:ApplicableTradeTax>
  <ram:CalculatedAmount>19.00</ram:CalculatedAmount>
</ram:ApplicableTradeTax>
Check in FactoorSharp
  • FacturXInvoice.TaxTotalAmount (BT-110)
Technical details

The XPath sums the ram:CalculatedAmount values of all ram:ApplicableTradeTax elements, rounds the sum to two decimal places, and compares it with the context ram:TaxTotalAmount.

Where the rule applies

The rule applies to ram:TaxTotalAmount in the invoice currency within the settlement monetary totals and compares it with the amounts in the ram:ApplicableTradeTax entries.

Context (rule/@context)
//ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID=/ rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:InvoiceCurrencyCode]
Test expression (assert/@test)
. = (round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax/ram:CalculatedAmount)*10*10)div 100)