Charge requires exactly one amount

Error FX-SCH-A-000478 Factur-X

Element 'ram:ActualAmount' 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:ActualAmount exactly once. The amount is missing or occurs more than once.

What the rule means

ram:ActualAmount provides the actual amount of the charge. Exactly one amount element makes the amount unambiguous.

Please provide exactly one amount for the charge

The charge is missing its actual amount or contains it more than once. A single amount makes the charge clear.

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

The test counts the direct child elements ram:ActualAmount in the ram:SpecifiedTradeAllowanceCharge selected by the charge indicator 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:ActualAmount)=1