Each Document level allowance (BG-20) shall contain a Document level allowance reason (BT-97) or a Document level allowance reason code (BT-98), or both.
The allowance has neither the textual reason ram:Reason nor the reason code ram:ReasonCode. At least one of these details must be present; both may also be provided.
The reason or reason code explains the allowance. This information makes it possible to understand the allowance in business terms.
The allowance is missing a reason. A written reason, a reason code, or both can describe why it was granted.
- 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 ram:Reason or ram:ReasonCode is present as a sibling element; both elements are also permitted.
The rule applies to a document-level allowance in ram:SpecifiedTradeAllowanceCharge.
rule/@context)assert/@test)