Disallowed allowance reason code

Error FX-SCH-A-000623 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 in ram:ReasonCode is not included in the code list defined for the allowance reason. An empty value also passes this specific check.

What the rule means

ram:ReasonCode identifies the reason for the allowance. A non-empty value must come from the code list defined for this reason.

Please use an allowed code for the allowance reason

The code in ram:ReasonCode for the invoice line’s allowance is not included in the code list defined for it. An allowed code identifies the allowance reason correctly.

What to do
  1. Check ram:ReasonCode for the allowance on the affected invoice line.
  2. Compare the non-empty value with the codes allowed for allowance reasons.
  3. Generate the invoice again and validate it again.
Technical details

The context restricts the check to SpecifiedTradeAllowanceCharge where ChargeIndicator is false. An empty value or a value from codedb/cl[@id=11]/enumeration is accepted.

Where the rule applies

The rule applies to ram:ReasonCode of an allowance on an invoice line.

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