Exactly one calculated tax amount

Error FX-SCH-A-001060 Factur-X

Element 'ram:CalculatedAmount' 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

ram:IncludedTradeTax does not contain exactly one ram:CalculatedAmount: the element is missing or occurs more than once.

What the rule means

ram:CalculatedAmount states the calculated tax amount for the included tax entry.

Please provide the calculated tax amount exactly once

ram:CalculatedAmount is missing or appears more than once in the net-price tax entry. You can adjust the structure so that it occurs exactly once.

What to do
  1. Find ram:IncludedTradeTax within ram:NetPriceProductTradePrice.
  2. Make sure it contains exactly one ram:CalculatedAmount.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:IncludedTradeTax/>
✓ Correct
<ram:IncludedTradeTax>
  <ram:CalculatedAmount/>
</ram:IncludedTradeTax>
Technical details

The rule counts ram:CalculatedAmount within ram:IncludedTradeTax and requires exactly one element.

Where the rule applies

The rule applies to ram:CalculatedAmount within ram:IncludedTradeTax in an invoice line’s net price.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeAgreement/ram:NetPriceProductTradePrice/ram:IncludedTradeTax
Test expression (assert/@test)
count(ram:CalculatedAmount)=1