Exactly one tax category code for the advance payment

Error FX-SCH-A-000954 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:CategoryCode must occur exactly once in ram:IncludedTradeTax. The element is either missing or appears more than once.

What the rule means

The tax category code assigns the advance payment’s tax information to a tax category. Exactly one such code is required for this information.

Please provide the advance payment tax category code exactly once

The tax category code is missing from the advance payment’s tax information or appears more than once. The structure can be adjusted so that the code occurs exactly once.

What to do
  1. Locate ram:IncludedTradeTax for the advance payment.
  2. Check that it contains ram:CategoryCode exactly once.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:IncludedTradeTax/>
✓ Correct
<ram:IncludedTradeTax>
  <ram:CategoryCode>S</ram:CategoryCode>
</ram:IncludedTradeTax>
Technical details

The rule checks whether ram:IncludedTradeTax contains exactly one direct child element named ram:CategoryCode.

Where the rule applies

The rule applies within ram:IncludedTradeTax for the tax information of an advance payment.

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