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).
If exactly one ram:TaxTotalAmount in the invoice currency is present, ram:GrandTotalAmount must equal the sum of ram:TaxBasisTotalAmount and that tax amount, within a tolerance of 0.01 for each included invoice line, allowance, or charge. If there is not exactly one such tax amount, ram:GrandTotalAmount must equal ram:TaxBasisTotalAmount.
The invoice total including VAT (BT-112) is derived from the amount excluding VAT (BT-109) and the tax amount in the invoice currency (BT-110). If there is not exactly one tax amount in the invoice currency, the rule requires BT-112 and BT-109 to be equal.
The invoice total including VAT does not match the amount excluding VAT plus the tax amount in the invoice currency. If there is not exactly one tax amount in the invoice currency, the two invoice totals must be equal.
- Compare
ram:GrandTotalAmountwithram:TaxBasisTotalAmountand the amount inram:TaxTotalAmountwhosecurrencyIDmatchesram:InvoiceCurrencyCode. - Check the invoice currency through
Currencyand the amounts throughGrandTotalAmount,TaxBasisAmount, andTaxTotalAmount. - If there is not exactly one tax amount in the invoice currency, reconcile
ram:GrandTotalAmountandram:TaxBasisTotalAmount. - Generate the invoice again and validate it.
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 test counts ram:TaxTotalAmount elements whose currencyID equals ram:InvoiceCurrencyCode. With exactly one match, it checks that the absolute difference between ram:GrandTotalAmount and the sum of ram:TaxBasisTotalAmount and that tax amount is within 0.01 multiplied by the number of included lines, allowances, and charges. For any other match count, it checks that ram:GrandTotalAmount equals ram:TaxBasisTotalAmount.
Applies to ram:GrandTotalAmount and ram:TaxBasisTotalAmount in the monetary summary. It also compares tax amounts in ram:TaxTotalAmount whose currencyID matches the invoice currency in ram:InvoiceCurrencyCode.
rule/@context)assert/@test)