Provide the tax type exactly once

Error FX-SCH-A-000458 Factur-X

Element 'ram:TypeCode' must occur exactly 1 times.

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

ram:TypeCode is missing from ram:ApplicableTradeTax or occurs more than once. It must occur exactly once.

What the rule means

ram:TypeCode identifies the tax type of the corresponding VAT breakdown entry.

Please provide the tax type exactly once

ram:TypeCode does not occur exactly once in the VAT breakdown entry. You can resolve this by including the element once in the entry.

What to do
  1. Find the relevant ram:ApplicableTradeTax.
  2. Check that ram:TypeCode occurs exactly once in it.
  3. Regenerate the invoice and check it again.
What it looks like
✗ Triggers the message
<ram:ApplicableTradeTax/>
✓ Correct
<ram:ApplicableTradeTax>
  <ram:TypeCode/>
</ram:ApplicableTradeTax>
Technical details

The test counts the direct ram:TypeCode elements within ram:ApplicableTradeTax and requires a count of 1.

Where the rule applies

The rule applies to each ram:ApplicableTradeTax element in the document-level VAT breakdown.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:ApplicableTradeTax
Test expression (assert/@test)
count(ram:TypeCode)=1