Allowance tax category

Error FX-SCH-A-000474 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 is missing from ram:CategoryTradeTax, or the element occurs more than once. The tax information must contain exactly one tax category.

What the rule means

ram:CategoryCode specifies the tax category for the allowance’s tax information. Exactly one category is required to make the classification structurally unambiguous.

Please provide the allowance tax category

The tax category is missing from the allowance’s tax information or has been provided more than once. Exactly one ram:CategoryCode makes the entry unambiguous.

What to do
  1. Add exactly one ram:CategoryCode to ram:CategoryTradeTax.
  2. Remove duplicate ram:CategoryCode elements if present.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:CategoryTradeTax/>
✓ Correct
<ram:CategoryTradeTax>
  <ram:CategoryCode/>
</ram:CategoryTradeTax>
Technical details

The test counts ram:CategoryCode within ram:CategoryTradeTax and requires the count to equal 1.

Where the rule applies

The rule applies to ram:CategoryCode within ram:CategoryTradeTax, the tax information for a document-level allowance. The allowance in ram:SpecifiedTradeAllowanceCharge is identified by ram:ChargeIndicator having the value false.

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