Invoice total amount without VAT (BT-109) = Σ Invoice line net amount (BT-131) - Sum of allowances on document level (BT-107) + Sum of charges on document level (BT-108).
TaxBasisTotalAmount does not equal LineTotalAmount minus AllowanceTotalAmount plus ChargeTotalAmount. If either the allowance or charge total is absent, the invoice total excluding VAT must match the amounts that are present.
The amount excluding VAT combines the net amounts of invoice lines with document-level allowances and charges. The check ensures that these components calculate to the same invoice amount.
The amount excluding VAT does not match the invoice line net amounts and the allowances and charges. You can adjust the totals so that the invoice calculation balances.
- Compare
TaxBasisTotalAmountwithLineTotalAmountminusAllowanceTotalAmountplusChargeTotalAmount. - Include only the total elements that are present in the invoice.
- Check the
TaxBasisAmount,LineTotalAmount,AllowanceTotalAmountandChargeTotalAmountproperties. - Generate the invoice again and validate it again.
<ram:SpecifiedTradeSettlementHeaderMonetarySummation> <ram:LineTotalAmount>100.00</ram:LineTotalAmount> <ram:AllowanceTotalAmount>10.00</ram:AllowanceTotalAmount> <ram:ChargeTotalAmount>5.00</ram:ChargeTotalAmount> <ram:TaxBasisTotalAmount>96.00</ram:TaxBasisTotalAmount> </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation> <ram:LineTotalAmount>100.00</ram:LineTotalAmount> <ram:AllowanceTotalAmount>10.00</ram:AllowanceTotalAmount> <ram:ChargeTotalAmount>5.00</ram:ChargeTotalAmount> <ram:TaxBasisTotalAmount>95.00</ram:TaxBasisTotalAmount> </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
FacturXInvoice.AllowanceTotalAmount(BT-107)FacturXInvoice.ChargeTotalAmount(BT-108)FacturXInvoice.TaxBasisAmount(BT-109)TradeLineItem.LineTotalAmount(BT-131)
Technical details
The XPath check compares TaxBasisTotalAmount with the available totals and allows AllowanceTotalAmount or ChargeTotalAmount to be absent and omitted from the calculation. The comparison is rounded to two decimal places.
The rule applies to the amounts in SpecifiedTradeSettlementHeaderMonetarySummation: TaxBasisTotalAmount is checked against LineTotalAmount, AllowanceTotalAmount and ChargeTotalAmount.
rule/@context)assert/@test)