Skip to content
Back to News
Changelog

Fix group VAT rounding (EN 16931 BR-CO-17) and expose the UBL payable amount

sdkapibugfix

Sub-cent line amounts could drift the emitted UBL by one cent: two €0.03 lines at 21% produced a €0.02 tax subtotal instead of the compliant €0.01, violating the EN 16931 BR-CO-17 Schematron rule. SDK 2.3.0 now computes each cbc:TaxAmount by rounding once per tax group, and the cbc:PayableAmount arithmetic no longer relies on raw floats — no more one-cent drift on float dust.

What changed

  • amountDue matches the UBL. The amount reported on invoices is derived from the document's PayableAmount — what your buyer's system reads is what you see.
  • New export computeUblPayableAmount(input) (with the UblMonetaryInput type) — the exact formula buildInvoiceXml renders into cac:LegalMonetaryTotal, line- and document-level allowances/charges, VAT, prepaid and rounding included. Use it instead of re-deriving the amount with a parallel formula that could drift from the UBL sent to the network.
  • CLI 0.5.1 rebundles the fix. getpeppr convert and getpeppr validate run the UBL builder locally, so they now emit the compliant output too.

No breaking change. Upgrade if you emit sub-cent line amounts or compute amounts due on your side.