One ram:CategoryTradeTax for the charge

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 element ram:CategoryTradeTax does not occur exactly once in the charge. It is either missing or occurs more than once.

What the rule means

Exactly one ram:CategoryTradeTax assigns the VAT category to the charge. The rule requires this association exactly once.

Please assign exactly one `ram:CategoryTradeTax` to the charge

The charge entry is missing ram:CategoryTradeTax, or the element occurs more than once. The rule allows exactly one occurrence.

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

The test counts direct ram:CategoryTradeTax children of the applicable ram:SpecifiedTradeAllowanceCharge and requires exactly one.

Where the rule applies

The rule applies to an entry marked as a charge in ram:SpecifiedTradeAllowanceCharge at document level.

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