Line charge or tax needs a reason

Error BR-FXEXT-BR-44 Factur-X

Each Invoice line charge or tax (BG-28) shall have an Invoice line charge or tax reason (BT-144), an Invoice line charge reason code (BT-145) or an Invoice line-level non-VAT tax type code (BT-193).

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

This charge or tax at invoice line level has neither ram:Reason nor ram:ReasonCode. The test checks whether at least one of these two elements is present.

What the rule means

A reason or reason code describes the charge or tax at invoice line level. This rule ensures that at least one of these explanations is present.

Affected fields BG-28 BT-144 BT-145 BT-193
Please provide a reason for the line charge or tax

A reason is missing for this charge or tax at invoice line level. You can provide a text reason or a reason code.

What to do
  1. Find the relevant ram:SpecifiedTradeAllowanceCharge.
  2. Add either AbstractTradeAllowanceCharge.Reason or TradeCharge.ReasonCode.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:Reason>Transport</ram:Reason>
</ram:SpecifiedTradeAllowanceCharge>
Check in FactoorSharp
  • ChargeReasonCodes (Line level charge: BT-145)
  • TradeCharge.ReasonCode (Line level charge: BT-145)
  • AbstractTradeAllowanceCharge.Reason (Line level charge: BT-144)
  • TradeLineItem.SpecifiedTradeAllowanceCharges (BG-28)
  • AbstractTradeAllowanceCharge (Line level charge: BG-28)
Technical details

The test runs for ram:ChargeIndicator with udt:Indicator equal to true and requires ram:Reason or ram:ReasonCode on the enclosing element. Although the rule text also mentions BT-193, the XPath expression does not check that field.

Where the rule applies

The rule applies to ram:SpecifiedTradeAllowanceCharge in ram:SpecifiedLineTradeSettlement when ram:ChargeIndicator contains the value true.

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