Disallowed reason code without a list identifier

Error FX-SCH-A-000978 Factur-X

Value of 'ram:ReasonCode[not (@listID)]' is not allowed.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The value of ram:ReasonCode is not empty and is not allowed by the code list applicable when the element has no listID. An empty value passes this check.

What the rule means

The reason code describes why the charge is applied. Without a listID, its value must still match the code list intended for this context.

Please use an allowed reason code for the charge

The charge’s reason code without a list identifier is not included in the code list allowed for this context. You can adjust the value or leave the element empty.

What to do
  1. Find the ram:ReasonCode element without listID in the charge.
  2. Compare its value with the codes allowed for this context.
  3. Adjust the value or leave ram:ReasonCode empty.
  4. Generate the invoice again and validate it.
Technical details

The XPath allows an empty ram:ReasonCode or requires its value to occur in the code list identified by 46; the context restricts the rule to elements without listID.

Where the rule applies

The rule applies to ram:ReasonCode without a listID attribute within a document-level ram:SpecifiedTradeAllowanceCharge marked as a charge.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator="true"]/ ram:ReasonCode[not (@listID)]
Test expression (assert/@test)
string-length($codeValue46)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=46]/enumeration[@value=$codeValue46]