One ram:TypeCode for the charge tax category

Error FX-SCH-A-000480 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

The element ram:TypeCode does not occur exactly once in ram:CategoryTradeTax. It is either missing or occurs more than once.

What the rule means

Exactly one ram:TypeCode unambiguously identifies the tax type for the charge’s VAT category.

Please provide exactly one `ram:TypeCode` in `ram:CategoryTradeTax`

ram:CategoryTradeTax for the charge is missing ram:TypeCode, or the element occurs more than once. The rule requires exactly one.

What to do
  1. Locate ram:CategoryTradeTax in the charge.
  2. Ensure that ram:TypeCode occurs exactly once in it.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:CategoryTradeTax>
  <ram:CategoryCode>S</ram:CategoryCode>
</ram:CategoryTradeTax>
✓ Correct
<ram:CategoryTradeTax>
  <ram:TypeCode>VAT</ram:TypeCode>
</ram:CategoryTradeTax>
Technical details

The test counts direct ram:TypeCode children of ram:CategoryTradeTax and requires exactly one.

Where the rule applies

The rule applies to ram:CategoryTradeTax of a document-level charge.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator="true"]/ ram:CategoryTradeTax
Test expression (assert/@test)
count(ram:TypeCode)=1