Allowance reason or reason code is missing

Error BR-42 EN 16931

Each Invoice line allowance (BG-27) shall have an Invoice line allowance reason (BT-139) or an Invoice line allowance reason code (BT-140).

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

The invoice line allowance contains neither ram:Reason nor ram:ReasonCode. Each such allowance must have a reason or a reason code.

What the rule means

A reason or reason code explains the allowance on the invoice line.

Affected fields BG-27 BT-139 BT-140
Please add a reason or reason code for the allowance

A reason is missing for an allowance on the invoice line. You can provide a reason as text or as a code.

What to do
  1. Add either ram:Reason or ram:ReasonCode under ram:SpecifiedTradeAllowanceCharge.
  2. Set the text through AbstractTradeAllowanceCharge.Reason or the code through TradeAllowance.ReasonCode.
  3. Generate the invoice again and validate it once more.
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>Motif</ram:Reason>
</ram:SpecifiedTradeAllowanceCharge>
Check in FactoorSharp
  • AllowanceReasonCodes (Line level allowance: BT-140)
  • TradeAllowance.ReasonCode (Line level allowance: BT-140)
  • AbstractTradeAllowanceCharge.Reason (Line level allowance: BT-139)
  • TradeLineItem.SpecifiedTradeAllowanceCharges (BG-27)
  • AbstractTradeAllowanceCharge (Line level allowance: BG-27)
Technical details

For the allowance identified by udt:Indicator with false, the test checks whether the parent ram:SpecifiedTradeAllowanceCharge contains ram:Reason or ram:ReasonCode.

Where the rule applies

The rule applies to an invoice line allowance identified by ram:ChargeIndicator with the value false.

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