{
  "id": "BR-CO-12",
  "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": "Sum of charges on document level (BT-108) = Σ Document level charge amount (BT-99).",
  "statement_lang": "en",
  "context": "cac:LegalMonetaryTotal",
  "test": "xs:decimal(cbc:ChargeTotalAmount) = (round(sum(../cac:AllowanceCharge[cbc:ChargeIndicator=true()]/xs:decimal(cbc:Amount)) * 10 * 10) div 100) or (not(cbc:ChargeTotalAmount) and not(../cac:AllowanceCharge[cbc:ChargeIndicator=true()]))",
  "meaning": "The sum of charges on document level (BT-108) must equal the sum of the document-level charge amounts (BT-99). The statement uses U+03A3 and ends with a period. The published test rounds that sum to two decimals. It also passes when the charge total is absent and no document-level charge is present. That absent branch is not() and does not call exists. The charge-indicator comparison is ChargeIndicator=true() with no space before =.",
  "fix": "Set BT-108 to the sum of the document-level charge amounts (BT-99). Omit the charge total only when the invoice has no document-level charge.",
  "example_fail": "Document-level charge amounts are 10 and 5, and BT-108 is 10.",
  "example_pass": "Those same amounts, and BT-108 is 15.",
  "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-12/",
  "source_retrieved": "2026-10-18",
  "last_verified": "2026-10-18"
}
