Invoice line allowance requires a reason

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 allowance has neither ram:Reason nor ram:ReasonCode.

What the rule means

An invoice line allowance must be explained by a reason or a reason code.

Affected fields BG-27 BT-139 BT-140
Please provide a reason for the invoice line allowance

No reason is provided for the invoice line allowance. You can add either a reason text or a reason code.

What to do
  1. Check the allowance with ChargeIndicator set to false.
  2. Add either Reason or ReasonCode.
  3. Check the mapping through AbstractTradeAllowanceCharge.Reason or TradeAllowance.ReasonCode.
  4. Generate the invoice again and validate it.
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>...</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 ram:ChargeIndicator with the value false, the test requires ram:Reason or ram:ReasonCode in the parent ram:SpecifiedTradeAllowanceCharge.

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)