Tax total in tax currency only once

Error FX-SCH-A-000388 Factur-X

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

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

What the rule means

The tax total in the tax 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 tax currency only once

The tax total in the tax 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:TaxCurrencyCode.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:TaxCurrencyCode>EUR</ram:TaxCurrencyCode>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
  <ram:TaxTotalAmount currencyID="EUR">19.00</ram:TaxTotalAmount>
  <ram:TaxTotalAmount currencyID="EUR">20.00</ram:TaxTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
✓ Correct
<ram:TaxCurrencyCode>EUR</ram:TaxCurrencyCode>
<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:TaxCurrencyCode 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:TaxCurrencyCode.

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:TaxCurrencyCode])<=1