Charge requires exactly one indicator

Error FX-SCH-A-000477 Factur-X

Element 'ram:ChargeIndicator' must occur exactly 1 times.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The charge does not contain ram:ChargeIndicator exactly once. The element is missing or occurs more than once.

What the rule means

ram:ChargeIndicator identifies whether the amount is a charge. A single, clear indicator distinguishes a charge from an allowance.

Please identify the charge exactly once

The charge is missing ram:ChargeIndicator or contains it more than once. A single indicator makes the type of amount clear.

What to do
  1. Locate the charge in ram:SpecifiedTradeAllowanceCharge.
  2. Make sure there is exactly one ram:ChargeIndicator element with udt:Indicator set to true.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge/>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
</ram:SpecifiedTradeAllowanceCharge>
Technical details

The test counts the direct child elements ram:ChargeIndicator in the ram:SpecifiedTradeAllowanceCharge selected by udt:Indicator equal to true and requires a count of 1.

Where the rule applies

The rule applies to a document-level ram:SpecifiedTradeAllowanceCharge when udt:Indicator in ram:ChargeIndicator has the value true.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator="true"]
Test expression (assert/@test)
count(ram:ChargeIndicator)=1