Tax total in invoice currency only once

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

ram:TaxTotalAmount occurs more than once in an invoice line’s summation with a currencyID matching the invoice currency.

What the rule means

The tax total in the invoice currency may be stated only once in an invoice line’s summation. Multiple occurrences would state this amount more than once.

Please include the tax total in the invoice currency only once

The tax total in the invoice currency appears more than once in an invoice line’s summation. This variant may occur there no more than once.

What to do
  1. Check the ram:TaxTotalAmount elements in the invoice line’s summation.
  2. Make sure no more than one element uses the currencyID from ram:InvoiceCurrencyCode.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
  <ram:TaxTotalAmount currencyID="EUR">19.00</ram:TaxTotalAmount>
  <ram:TaxTotalAmount currencyID="EUR">20.00</ram:TaxTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
✓ Correct
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
  <ram:TaxTotalAmount currencyID="EUR">19.00</ram:TaxTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
Technical details

The XPath counts only ram:TaxTotalAmount elements whose currencyID matches the value of ram:InvoiceCurrencyCode in the header; the test passes with at most one match.

Where the rule applies

The rule applies to ram:TaxTotalAmount in an invoice line’s monetary summation. It checks the variant whose currencyID 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