Invalid charge reason code

Error FX-SCH-A-001139 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 in ram:ReasonCode is neither empty nor included in the code list used for this check. The rule checks the value when the listID attribute is absent.

What the rule means

The reason for a charge is checked against a defined code list. A value not included in that list cannot be recognized as a valid charge reason.

Please check the charge reason code

The value given in ram:ReasonCode is not recognized as valid for this charge. This can be addressed with an empty value or a code included in the code list.

What to do
  1. Check the value in the charge’s ram:ReasonCode.
  2. Use only a code from the code list applicable to this rule, or leave the value empty.
  3. Generate the invoice again and validate it.
Technical details

The test passes if the resolved code is empty or appears in the enumeration with ID 29 in FACTUR-X_EXTENDED_codedb.xml. The context limits the check to charges and ram:ReasonCode without listID.

Where the rule applies

The rule applies to the ram:ReasonCode of a charge in an invoice line’s settlement when the associated udt:Indicator is true.

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