One ram:ChargeIndicator for the charge

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 element ram:ChargeIndicator does not occur exactly once in this charge. It is either missing or occurs more than once.

What the rule means

Exactly one ram:ChargeIndicator unambiguously identifies whether the amount is an allowance or a charge. This rule concerns the entry marked as a charge.

Please mark the charge with exactly one `ram:ChargeIndicator`

The charge entry is missing ram:ChargeIndicator, or the element occurs more than once. This can be resolved by having the element occur once.

What to do
  1. Locate the charge in ram:SpecifiedTradeAllowanceCharge.
  2. Ensure that ram:ChargeIndicator occurs exactly once in it.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ActualAmount>10.00</ram:ActualAmount>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
</ram:SpecifiedTradeAllowanceCharge>
Technical details

The test counts direct ram:ChargeIndicator children of the applicable ram:SpecifiedTradeAllowanceCharge and requires exactly one.

Where the rule applies

The rule applies to a document-level charge marked by ram:ChargeIndicator with the value true in ram:SpecifiedTradeAllowanceCharge.

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