PintLint

Rules / IBR-SR-30

IBR-SR-30 error

Allowance reason must occur maximum once

Allowance reason (ibt-097) must occur maximum once.

Fails

<cac:AllowanceCharge>
  <cbc:AllowanceChargeReason>…</cbc:AllowanceChargeReason>
  <cbc:AllowanceChargeReason>…</cbc:AllowanceChargeReason>
</cac:AllowanceCharge>

Fix

Keep a single cbc:AllowanceChargeReason here and delete the duplicates. If both values matter, one of them belongs in a different field.

Schematron
Context
cac:AllowanceCharge[cbc:ChargeIndicator = false()]
Test
(count(cbc:AllowanceChargeReason) <= 1)

Official text: Allowance reason (ibt-097) MUST occur maximum once

Official · PINT shared rules. Severity: error. Runs on UBL XML.

Check an invoice