Allowance tax requires exactly one type code

Error FX-SCH-A-000473 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 allowance’s tax information does not contain ram:TypeCode exactly once. It is missing or occurs more than once.

What the rule means

The type code identifies the kind of tax information. Exactly one value makes the tax classification unambiguous.

Please provide exactly one type code for the allowance tax

The tax information for an allowance is missing a type code or contains it more than once. You can resolve this by providing it exactly once.

What to do
  1. Locate the allowance’s ram:CategoryTradeTax tax information.
  2. Make sure it contains exactly one ram:TypeCode element.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:CategoryTradeTax/>
✓ Correct
<ram:CategoryTradeTax>
  <ram:TypeCode/>
</ram:CategoryTradeTax>
Technical details

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

Where the rule applies

The rule applies to the ram:CategoryTradeTax tax information of a document-level allowance in ram:SpecifiedTradeAllowanceCharge.

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