Each Document level allowance (BG-20) shall have a Document level allowance reason (BT-97) or a Document level allowance reason code (BT-98).
The allowance has neither the textual reason ram:Reason nor the reason code ram:ReasonCode. At least one of these details must be present.
The reason or reason code explains why the allowance is granted. This makes the allowance understandable in business terms.
The allowance is missing a reason. You can provide a written reason, a reason code, or both.
- For the allowance, add either
ram:Reasonorram:ReasonCode; you may also add both. - For the reason code, check
AllowanceReasonCodesorTradeAllowance.ReasonCode; for the text, checkAbstractTradeAllowanceCharge.Reason. - Check the call to
AddTradeAllowance(...). - Regenerate the invoice and validate it again.
<ram:SpecifiedTradeAllowanceCharge> <ram:ChargeIndicator> <udt:Indicator>false</udt:Indicator> </ram:ChargeIndicator> </ram:SpecifiedTradeAllowanceCharge>
<ram:SpecifiedTradeAllowanceCharge> <ram:ChargeIndicator> <udt:Indicator>false</udt:Indicator> </ram:ChargeIndicator> <ram:Reason>Promotional allowance</ram:Reason> </ram:SpecifiedTradeAllowanceCharge>
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 test passes when at least one of the sibling elements ram:Reason or ram:ReasonCode is present.
The rule applies to a document-level allowance in ram:SpecifiedTradeAllowanceCharge.
rule/@context)assert/@test)