Charge requires exactly one tax entry

Error FX-SCH-A-000479 Factur-X

Element 'ram:CategoryTradeTax' 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 charge does not contain ram:CategoryTradeTax exactly once. The tax entry is missing or occurs more than once.

What the rule means

ram:CategoryTradeTax associates the relevant tax information with the charge. Exactly one such entry makes this association unambiguous.

Please provide exactly one tax entry for the charge

The charge is missing its tax entry or contains it more than once. A single entry clearly associates the tax information.

What to do
  1. Locate the charge in ram:SpecifiedTradeAllowanceCharge.
  2. Make sure it contains exactly one ram:CategoryTradeTax element.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:CategoryTradeTax/>
</ram:SpecifiedTradeAllowanceCharge>
Technical details

The test counts the direct child elements ram:CategoryTradeTax in the ram:SpecifiedTradeAllowanceCharge selected by the charge indicator and requires a count of 1.

Where the rule applies

The rule applies to a document-level ram:SpecifiedTradeAllowanceCharge when udt:Indicator in ram:ChargeIndicator has the value true.

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