ActualAmount at most once

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

- 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

ram:ActualAmount occurs more than once inside ram:SpecifiedTradeAllowanceCharge. This element may appear at most once in the entry.

What the rule means

ram:ActualAmount contains the actual amount of the allowance or charge. Repeating it makes the amount for that entry ambiguous.

Please include `ram:ActualAmount` only once

An entry in ram:SpecifiedTradeAllowanceCharge contains ram:ActualAmount more than once. You can resolve this by having the element appear only once.

What to do
  1. Find the affected ram:SpecifiedTradeAllowanceCharge entry.
  2. Check how many times ram:ActualAmount occurs in it.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ActualAmount>10.00</ram:ActualAmount>
  <ram:ActualAmount>5.00</ram:ActualAmount>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ActualAmount>10.00</ram:ActualAmount>
</ram:SpecifiedTradeAllowanceCharge>
Technical details

The XPath test counts direct ram:ActualAmount child elements of ram:SpecifiedTradeAllowanceCharge and permits no more than one.

Where the rule applies

The rule applies to each ram:SpecifiedTradeAllowanceCharge entry at document level.

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