{
  "id": "BR-CO-16",
  "country": "EU",
  "syntax": "ubl",
  "group": "totals",
  "severity": "fatal",
  "severity_note": "fatal, from the Flag column of the Peppol BIS Billing 3.0 UBL rules index retrieved 2026-10-18.",
  "spec": "Peppol BIS Billing 3.0, May 2026 release, EN 16931 model bound to UBL",
  "statement": "Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Paid amount (BT-113) +Rounding amount (BT-114).",
  "statement_lang": "en",
  "context": "cac:LegalMonetaryTotal",
  "test": "(exists(cbc:PrepaidAmount) and not(exists(cbc:PayableRoundingAmount)) and (xs:decimal(cbc:PayableAmount) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or (not(exists(cbc:PrepaidAmount)) and not(exists(cbc:PayableRoundingAmount)) and xs:decimal(cbc:PayableAmount) = xs:decimal(cbc:TaxInclusiveAmount)) or (exists(cbc:PrepaidAmount) and exists(cbc:PayableRoundingAmount) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) * 10 * 10) div 100) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or (not(exists(cbc:PrepaidAmount)) and exists(cbc:PayableRoundingAmount) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) * 10 * 10) div 100) = xs:decimal(cbc:TaxInclusiveAmount)))",
  "meaning": "The amount due for payment (BT-115) must equal the invoice total with VAT (BT-112) minus the paid amount (BT-113) plus the rounding amount (BT-114). The statement has no space in -Paid or +Rounding, and it ends with a period. The published test covers a missing paid amount and a missing rounding amount. Both the present branch and the absent branch call exists.",
  "fix": "Set BT-115 to BT-112 minus BT-113 plus BT-114. Leave out a paid amount or a rounding amount only when that element is absent.",
  "example_fail": "BT-112 is 119, the paid amount is 19, there is no rounding amount, and BT-115 is 119.",
  "example_pass": "Those same amounts, and BT-115 is 100.",
  "example_note": "Illustration of the condition in the official statement. Not an example published by the source.",
  "source_url": "https://docs.peppol.eu/poacc/billing/3.0/rules/ubl-tc434/BR-CO-16/",
  "source_retrieved": "2026-10-18",
  "last_verified": "2026-10-18"
}
