UBLExplain

Check UBL invoice totals

Compare the sum of invoice lines, VAT and payable amount against the LegalMonetaryTotal block. Small rounding differences (≤ 0.02) are tolerated.

Paste or load UBL XML

Likely causes of mismatches

  • Per-line rounding accumulates across many lines.
  • VAT was calculated per line and per category, leading to small differences.
  • An allowance (discount) or charge was not included in the totals.
  • Different currencyID values were used on different amounts.
  • Gross prices were confused with net prices (BT-146/BT-148 confusion).
  • A prepaid amount or payable rounding amount is missing.

Tööriistad

Frequently asked questions

What tolerance is used?

Differences within 0.02 of the document currency are treated as acceptable rounding.

Why do my totals differ by a cent?

Per-line rounding, VAT rounding, or unincluded allowances/charges are the most common causes.

What this tool does

The UBL totals checker recomputes line, tax, charge, allowance and rounding amounts and compares them against the values declared in LegalMonetaryTotal.

Common UBL and Peppol problems it detects

  • Sum of LineExtensionAmount does not equal LegalMonetaryTotal/LineExtensionAmount.
  • TaxExclusiveAmount + TaxAmount ≠ TaxInclusiveAmount.
  • PayableAmount does not match TaxInclusiveAmount − PrepaidAmount + PayableRoundingAmount.
  • Rounding differences caused by per-line versus per-document VAT rounding.

Why this matters

Even a one-cent mismatch can cause a Peppol access point to reject the invoice. Many ERP systems silently accept the invoice but then fail to post it to the ledger.

Example: forgotten ChargeTotalAmount

Lines sum to 100.00 and VAT is 21.00, but PayableAmount is 126.00. A 5.00 shipping charge was added in LegalMonetaryTotal but never declared as ChargeTotalAmount, so the checker flags the 5.00 delta.

How to fix the issue

  1. Declare every surcharge as cac:AllowanceCharge with ChargeIndicator=true and aggregate it in ChargeTotalAmount.
  2. Declare discounts symmetrically with ChargeIndicator=false and AllowanceTotalAmount.
  3. If you round VAT per line, also round at the document level consistently and use PayableRoundingAmount for any leftover cent.
  4. Re-run the checker until all green.

Frequently asked questions

Why is my invoice off by one cent?

Almost always a rounding rule. Most accounting systems round VAT per line; if the document-level VAT is rounded differently, use PayableRoundingAmount to absorb the difference.

Does the checker support credit notes?

Yes. UBL 2.x CreditNote documents are supported with the same logic.