Provide exactly one calculated 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:CalculatedAmount does not occur exactly once in ram:IncludedTradeTax. The element is either missing or occurs more than once.

What the rule means

The VAT entry within the net price must contain exactly one calculated amount.

Please provide exactly one calculated amount for VAT

The calculated amount is missing or entered more than once in the VAT entry for an invoice line’s net price. The entry can be adjusted to contain exactly one ram:CalculatedAmount.

What to do
  1. Find ram:IncludedTradeTax within ram:NetPriceProductTradePrice.
  2. Check that 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>0</ram:CalculatedAmount>
</ram:IncludedTradeTax>
Technical details

The test counts the direct ram:CalculatedAmount elements within ram:IncludedTradeTax and requires a count of one.

Where the rule applies

The rule applies to ram:IncludedTradeTax within the net price of an invoice line.

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