Invoice total with VAT

Error BR-FXEXT-CO-15 Factur-X

If Invoice Total VAT amount (BT-110) ,where currency (BT-110-0) is equal to BT-5, is present, then the Absolute Value of (Invoice total amount with VAT (BT-112) - Invoice total amount without VAT (BT-109) - Invoice total VAT amount (BT-110)) <= 0,01 * (Number of line net amounts (BT-131) + Number of Document level allowance amounts (BT-92) + Number of Document level charges amounts (BT-99) + Number of Logistics Service fee amounts (BT-X-272). Else, Invoice total amount with VAT (BT-112) is equal to Invoice total amount without VAT (BT-109).

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

If exactly one ram:TaxTotalAmount in the invoice currency is present, ram:GrandTotalAmount does not equal ram:TaxBasisTotalAmount plus that VAT amount within the permitted tolerance. If no matching VAT amount or more than one is present, ram:GrandTotalAmount must equal ram:TaxBasisTotalAmount exactly.

What the rule means

The invoice total with VAT is derived from the amount without VAT and the VAT amount in the invoice currency. If there is no single VAT amount in that currency, the total must not differ from the amount without VAT.

Please reconcile the invoice total with VAT

The invoice total with VAT does not match the tax basis and VAT amount in the invoice currency. You can compare the amounts and check how many tax amounts are present in that currency.

What to do
  1. Compare FacturXInvoice.GrandTotalAmount with FacturXInvoice.TaxBasisAmount and the FacturXInvoice.TaxTotalAmount in the invoice currency.
  2. Check whether exactly one tax amount uses the currency from FacturXInvoice.Currency; otherwise, the total and tax basis amounts must be equal.
  3. Generate the invoice again and validate it once more.
Check in FactoorSharp
  • AbstractTradeAllowanceCharge.ActualAmount (Document level allowance: BT-92; Document level charge: BT-99)
  • FacturXInvoice.Currency (Invoice currency: BT-5)
  • FacturXInvoice.GrandTotalAmount (BT-112)
  • FacturXInvoice.TaxBasisAmount (BT-109)
  • FacturXInvoice.TaxTotalAmount (BT-110)
Technical details

The XPath counts ram:TaxTotalAmount elements whose currencyID matches ram:InvoiceCurrencyCode. With exactly one match, it checks the difference between ram:GrandTotalAmount, ram:TaxBasisTotalAmount, and the matching tax amount against a tolerance based on lines and charges; otherwise, it requires the total and tax basis amounts to be equal.

Where the rule applies

The rule applies to ram:SpecifiedTradeSettlementHeaderMonetarySummation and compares ram:GrandTotalAmount with the amount without VAT and the VAT amount in the invoice currency.

Context (rule/@context)
//ram:SpecifiedTradeSettlementHeaderMonetarySummation
Test expression (assert/@test)
for $Currency in ../ram:InvoiceCurrencyCode, $BT109 in xs:decimal(ram:TaxBasisTotalAmount), $BT110 in xs:decimal(ram:TaxTotalAmount[@currencyID=$Currency]), $BT112 in xs:decimal(ram:GrandTotalAmount), $nbTaxTotalAmountInvoiceCurrency in count (ram:TaxTotalAmount[@currencyID=$Currency] ), $nbLineItems in xs:decimal(count(../../ram:IncludedSupplyChainTradeLineItem[ not(ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode) or ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode = 'DETAIL' ])), $nbAllowanceItems in xs:decimal(count(../ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/ udt:Indicator='false'])), $nbChargeItems in xs:decimal(count(../ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/ udt:Indicator='true']) + count(../ram:SpecifiedLogisticsServiceCharge)), $tolerance in xs:decimal(0.01), $maxTolerance in $tolerance * ($nbLineItems + $nbAllowanceItems + $nbChargeItems), $diff in xs:decimal($BT112 - $BT110 - $BT109), $abs in xs:decimal(abs($diff)) return ( $abs le $maxTolerance and $nbTaxTotalAmountInvoiceCurrency eq 1 ) or ($BT109 eq $BT112 and $nbTaxTotalAmountInvoiceCurrency ne 1)