At most one actual amount per allowance or charge

Error CII-SR-473 Syntax (UBL/CII)

[CII-SR-473] - ActualAmount should exist maximum once

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

A ram:SpecifiedTradeAllowanceCharge contains more than one ram:ActualAmount element. The test limits the count to at most one; it does not require the element to be present.

What the rule means

The rule limits the number of actual amounts within an allowance or charge to one.

Please provide no more than one actual amount for each allowance or charge.

Multiple actual amounts are entered for an allowance or charge. Keep no more than one entry; this test does not require an actual amount.

What to do
  1. Look for repeated ram:ActualAmount elements in the affected allowance or charge.
  2. Remove any extra ram:ActualAmount elements.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ActualAmount>10</ram:ActualAmount>
  <ram:ActualAmount>5</ram:ActualAmount>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ActualAmount>10</ram:ActualAmount>
</ram:SpecifiedTradeAllowanceCharge>
Technical details

The test counts ram:ActualAmount elements within ram:SpecifiedTradeAllowanceCharge and allows at most one.

Where the rule applies

The rule applies within each document-level ram:SpecifiedTradeAllowanceCharge.

Context (rule/@context)
//ram:SpecifiedTradeAllowanceCharge
Test expression (assert/@test)
count(ram:ActualAmount) <= 1