No more than two VAT registrations with scheme VA

Error FX-SCH-A-000386 Factur-X

Element variant 'ram:SpecifiedTaxRegistration[ram:ID/@schemeID="VA"]' may occur at maximum 2 times.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

More than two ram:SpecifiedTaxRegistration elements occur in ram:ManufacturerTradeParty with a ram:ID whose schemeID attribute has the value VA.

What the rule means

The rule limits to two the number of the manufacturer’s tax registrations identified with scheme VA.

Please limit the manufacturer’s registrations with scheme `VA` to two

More than two tax registrations with scheme VA are included for a product’s manufacturer. You can correct the invoice by limiting the number of these entries to no more than two.

What to do
  1. Find the product manufacturer’s ram:SpecifiedTaxRegistration elements with ram:ID and schemeID="VA".
  2. Limit these entries to no more than two.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:ManufacturerTradeParty>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="VA">1</ram:ID>
  </ram:SpecifiedTaxRegistration>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="VA">2</ram:ID>
  </ram:SpecifiedTaxRegistration>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="VA">3</ram:ID>
  </ram:SpecifiedTaxRegistration>
</ram:ManufacturerTradeParty>
✓ Correct
<ram:ManufacturerTradeParty>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="VA">1</ram:ID>
  </ram:SpecifiedTaxRegistration>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="VA">2</ram:ID>
  </ram:SpecifiedTaxRegistration>
</ram:ManufacturerTradeParty>
Technical details

Only direct ram:SpecifiedTaxRegistration elements whose ram:ID/@schemeID is exactly VA are counted; the test requires a count of no more than two.

Where the rule applies

The rule applies to the product’s manufacturer party, ram:ManufacturerTradeParty, within an invoice line.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedTradeProduct/ram:ManufacturerTradeParty
Test expression (assert/@test)
count(ram:SpecifiedTaxRegistration[ram:ID/@schemeID="VA"])<=2