Use an allowed reason code for the allowance

Error FX-SCH-A-000186 Factur-X

Value of 'ram:ReasonCode' 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 non-empty value of ram:ReasonCode is not in the value list used by this rule. An empty value passes this specific test.

What the rule means

The reason code identifies the reason for the allowance. A code not in the list cannot be recognized as an allowed reason using the specified value list.

Please use an allowed reason code for the allowance

The value entered in ram:ReasonCode is not among the values allowed by this rule. You can correct it using the applicable code list.

What to do
  1. Locate ram:ReasonCode on the allowance in ram:SpecifiedTradeAllowanceCharge.
  2. Compare its value with the code list allowed by this rule.
  3. Generate the invoice again and validate it again.
Technical details

The test permits an empty string; otherwise, the value must be present as an enumeration in codedb/cl[@id=17].

Where the rule applies

The rule checks the value of ram:ReasonCode on the document-level allowance in ram:SpecifiedTradeAllowanceCharge.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator="false"]/ ram:ReasonCode
Test expression (assert/@test)
string-length($codeValue17)=0 or document('FACTUR-X_BASIC-WL_codedb.xml')/codedb/cl[@id=17]/enumeration[@value=$codeValue17]