ram:TaxTotalAmount in the tax currency may occur at most once

Error FX-SCH-A-000192 Factur-X

Element variant 'ram:TaxTotalAmount[@currencyID=../../ram:TaxCurrencyCode]' 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

More than one ram:TaxTotalAmount has an @currencyID matching ram:TaxCurrencyCode. There may be at most one such element for the tax currency.

What the rule means

The VAT amount in the tax currency must not be stated more than once in the settlement totals. This keeps the tax amount for that currency unambiguous.

Please provide the VAT amount in the tax currency no more than once

The VAT amount in the tax currency is entered more than once. Keep no more than one ram:TaxTotalAmount with the matching @currencyID.

What to do
  1. Find ram:SpecifiedTradeSettlementHeaderMonetarySummation and its ram:TaxCurrencyCode.
  2. Check the @currencyID values of the ram:TaxTotalAmount elements there.
  3. Make sure no more than one element uses the same currency as ram:TaxCurrencyCode.
  4. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:TaxCurrencyCode>EUR</ram:TaxCurrencyCode>
  <ram:TaxTotalAmount currencyID="EUR">19.00</ram:TaxTotalAmount>
  <ram:TaxTotalAmount currencyID="EUR">19.00</ram:TaxTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
✓ Correct
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:TaxCurrencyCode>EUR</ram:TaxCurrencyCode>
  <ram:TaxTotalAmount currencyID="EUR">19.00</ram:TaxTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
Technical details

Only ram:TaxTotalAmount elements whose @currencyID matches the value of ram:TaxCurrencyCode are counted. The permitted count is zero or one.

Where the rule applies

The rule applies to the monetary settlement totals in ram:SpecifiedTradeSettlementHeaderMonetarySummation and concerns ram:TaxTotalAmount whose @currencyID matches ram:TaxCurrencyCode.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeSettlementHeaderMonetarySummation
Test expression (assert/@test)
count(ram:TaxTotalAmount[@currencyID=../../ram:TaxCurrencyCode])<=1