Invoice line tax category

Error FX-SCH-A-000536 Factur-X

Element 'ram:CategoryCode' 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:ApplicableTradeTax does not contain exactly one ram:CategoryCode. The element is missing or occurs more than once.

What the rule means

The tax category code is part of the invoice line tax entry. Exactly one code ensures that the tax category is stated unambiguously.

Please include the invoice line tax category exactly once

ram:CategoryCode is missing or appears more than once in this invoice line tax entry. You can adjust the entry in ram:ApplicableTradeTax.

What to do
  1. Make sure ram:ApplicableTradeTax contains exactly one ram:CategoryCode.
  2. Generate the invoice again and check it again.
What it looks like
✗ Triggers the message
<ram:ApplicableTradeTax/>
✓ Correct
<ram:ApplicableTradeTax>
  <ram:CategoryCode/>
</ram:ApplicableTradeTax>
Technical details

The check counts the direct ram:CategoryCode elements in ram:ApplicableTradeTax and requires a count of 1.

Where the rule applies

In ram:ApplicableTradeTax within the settlement of an invoice line.

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