Allowance reason or reason code

Error BR-CO-21 EN 16931

Each Document level allowance (BG-20) shall contain a Document level allowance reason (BT-97) or a Document level allowance reason code (BT-98), or both.

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

The allowance has neither the textual reason ram:Reason nor the reason code ram:ReasonCode. At least one of these details must be present; both may also be provided.

What the rule means

The reason or reason code explains the allowance. This information makes it possible to understand the allowance in business terms.

Affected fields BG-20 BT-97 BT-98
Please provide a reason for the allowance

The allowance is missing a reason. A written reason, a reason code, or both can describe why it was granted.

What to do
  1. For the allowance, add either ram:Reason or ram:ReasonCode; you may also add both.
  2. For the reason code, check AllowanceReasonCodes or TradeAllowance.ReasonCode; for the text, check AbstractTradeAllowanceCharge.Reason.
  3. Check the call to AddTradeAllowance(...).
  4. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>false</udt:Indicator>
  </ram:ChargeIndicator>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>false</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:Reason>Promotional allowance</ram:Reason>
</ram:SpecifiedTradeAllowanceCharge>
Check in FactoorSharp
  • AllowanceReasonCodes (Document level allowance: BT-98)
  • TradeAllowance.ReasonCode (Document level allowance: BT-98)
  • AbstractTradeAllowanceCharge.Reason (Document level allowance: BT-97)
  • FacturXInvoice.AddTradeAllowance(basisAmount, currency, actualAmount, chargePercentage, reason, taxTypeCode, taxCategoryCode, taxPercent, reasonCode) (BG-20)
  • FacturXInvoice.GetTradeAllowances() (BG-20)
Technical details

The test passes when ram:Reason or ram:ReasonCode is present as a sibling element; both elements are also permitted.

Where the rule applies

The rule applies to a document-level allowance in ram:SpecifiedTradeAllowanceCharge.

Context (rule/@context)
//ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:ChargeIndicator[udt:Indicator='false']
Test expression (assert/@test)
(../ram:Reason) or (../ram:ReasonCode)