At most one tax amount in the invoice currency per invoice line

Error FX-SCH-A-000387 Factur-X

Element variant 'ram:TaxTotalAmount[@currencyID=/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode]' 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

In the invoice line summation, ram:TaxTotalAmount with an @currencyID value matching ram:InvoiceCurrencyCode occurs more than once. This variant may occur at most once.

What the rule means

The tax amount for an invoice line in the invoice currency is stated at most once.

Please state the tax amount in the invoice currency only once per invoice line

The tax amount in the invoice currency was provided more than once for an invoice line. The invoice contains ram:TaxTotalAmount with the matching @currencyID more than once.

What to do
  1. Compare the @currencyID values of the ram:TaxTotalAmount elements with ram:InvoiceCurrencyCode.
  2. Make sure no more than one ram:TaxTotalAmount uses the invoice currency.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementLineMonetarySummation>
  <ram:TaxTotalAmount currencyID="EUR">1.00</ram:TaxTotalAmount>
  <ram:TaxTotalAmount currencyID="EUR">2.00</ram:TaxTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
✓ Correct
<ram:SpecifiedTradeSettlementLineMonetarySummation>
  <ram:TaxTotalAmount currencyID="EUR">1.00</ram:TaxTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
Technical details

The XPath counts only ram:TaxTotalAmount elements whose @currencyID matches the header ram:InvoiceCurrencyCode and limits their number to one.

Where the rule applies

The rule applies to ram:TaxTotalAmount in an invoice line summation when its @currencyID value matches ram:InvoiceCurrencyCode.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeSettlementLineMonetarySummation
Test expression (assert/@test)
count(ram:TaxTotalAmount[@currencyID=/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode])<=1