CalculatedAmount no more than once

Error FX-SCH-A-000338 Factur-X

Element 'ram:CalculatedAmount' may occur at maximum 1 times.

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

ram:ApplicableTradeTax contains ram:CalculatedAmount more than once.

What the rule means

ram:CalculatedAmount may occur no more than once within this tax information. Multiple occurrences would state the calculated tax amount more than once at the same location.

Please include the calculated tax amount only once

ram:CalculatedAmount appears more than once in ram:ApplicableTradeTax for an invoice line. You can reduce this to a single occurrence.

What to do
  1. Locate ram:ApplicableTradeTax in the settlement for the affected invoice line.
  2. Keep no more than one ram:CalculatedAmount element within it.
  3. Generate the invoice again and check it once more.
What it looks like
✗ Triggers the message
<ram:ApplicableTradeTax>
  <ram:CalculatedAmount>10.00</ram:CalculatedAmount>
  <ram:CalculatedAmount>10.00</ram:CalculatedAmount>
</ram:ApplicableTradeTax>
✓ Correct
<ram:ApplicableTradeTax>
  <ram:CalculatedAmount>10.00</ram:CalculatedAmount>
</ram:ApplicableTradeTax>
Technical details

The test counts direct ram:CalculatedAmount elements within ram:ApplicableTradeTax and permits no more than one.

Where the rule applies

The rule applies to ram:CalculatedAmount within ram:ApplicableTradeTax on an invoice line.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax
Test expression (assert/@test)
count(ram:CalculatedAmount)<=1