Provide a reason or code for a charge

Error BR-FXEXT-BR-38 Factur-X

Each Document level charge or tax (BG-21) shall contain a Document level charge or tax reason (BT-104) or a Document level charge reason code (BT-105) or Document level non-VAT tax code (BT-177), or both reason and code.

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

The SpecifiedTradeAllowanceCharge with ChargeIndicator set to true has neither a Reason nor a ReasonCode. As a result, no reason or reason code is provided for the charge.

What the rule means

A document-level charge requires a reason, a reason code, or both. This information describes the charge in business terms.

Affected fields BG-21 BT-104 BT-105 BT-177
Please provide a reason or reason code for the charge

A document-level charge is missing both a reason and a reason code. Either detail can be used to describe the charge.

What to do
  1. Add a reason or a reason code to the relevant charge.
  2. Check the values for ChargeReasonCodes, TradeCharge.ReasonCode, or AbstractTradeAllowanceCharge.Reason.
  3. Check the AddTradeCharge(...) call for the charge.
  4. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>true</ram:ChargeIndicator>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>true</ram:ChargeIndicator>
  <ram:Reason>Delivery fee</ram:Reason>
</ram:SpecifiedTradeAllowanceCharge>
Check in FactoorSharp
  • ChargeReasonCodes (Document level charge: BT-105)
  • TradeCharge.ReasonCode (Document level charge: BT-105)
  • AbstractTradeAllowanceCharge.Reason (Document level charge: BT-104)
  • FacturXInvoice.AddTradeCharge(basisAmount, currency, actualAmount, chargePercentage, reason, taxTypeCode, taxCategoryCode, taxPercent, reasonCode) (BG-21)
  • FacturXInvoice.AddTradeeCharge(basisAmount, currency, actualAmount, chargePercentage, reason, taxTypeCode, taxCategoryCode, taxPercent, reasonCode) (BG-21)
Technical details

For a SpecifiedTradeAllowanceCharge with ChargeIndicator set to true, the test checks whether at least one of the sibling elements Reason or ReasonCode exists.

Where the rule applies

The rule applies to a document-level charge in ApplicableHeaderTradeSettlement that is identified as a charge by ChargeIndicator.

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