Reason for the document level allowance

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 is missing both ram:Reason and ram:ReasonCode. At least one of these elements must be present.

What the rule means

The reason explains why the document level allowance is granted. It can be provided as text, as a code, or in both forms.

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

A document level allowance is missing its reason. You can provide the reason as text, as a code, or in both forms.

What to do
  1. Add a reason for the allowance in ram:Reason or a reason code in ram:ReasonCode.
  2. Check the AddTradeAllowance(...) call and the values for Reason and ReasonCode.
  3. 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>Example reason</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 check runs for ram:ChargeIndicator with the value false. It passes when ram:Reason or ram:ReasonCode is present.

Where the rule applies

The rule applies to each allowance in ram:SpecifiedTradeAllowanceCharge within ram:ApplicableHeaderTradeSettlement that is identified as an allowance by ram:ChargeIndicator.

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