Sum of allowances on document level (BT-107) = Σ Document level allowance amount (BT-92).
If document level allowances are present, ram:AllowanceTotalAmount does not match the sum of their ram:ActualAmount amounts. If there are no such allowances, ram:AllowanceTotalAmount must not be present.
ram:AllowanceTotalAmount reports the total of document level allowances. The total must equal the sum of the individual allowance amounts; if there are no allowances, no allowance total is reported.
The reported allowance total does not match the individual allowance amounts, or a total is present when there are no allowances. Adjust the total to match the allowances present.
- Check the document level allowances and their
ActualAmountvalues. - Make
AllowanceTotalAmountequal to the sum of those allowance amounts. - If there are no allowances, omit
AllowanceTotalAmount. - Generate the invoice again and validate it.
<ram:SpecifiedTradeAllowanceCharge> <ram:ChargeIndicator> <udt:Indicator>false</udt:Indicator> </ram:ChargeIndicator> <ram:ActualAmount>10.00</ram:ActualAmount> </ram:SpecifiedTradeAllowanceCharge> <ram:SpecifiedTradeSettlementHeaderMonetarySummation> <ram:AllowanceTotalAmount>8.00</ram:AllowanceTotalAmount> </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:SpecifiedTradeAllowanceCharge> <ram:ChargeIndicator> <udt:Indicator>false</udt:Indicator> </ram:ChargeIndicator> <ram:ActualAmount>10.00</ram:ActualAmount> </ram:SpecifiedTradeAllowanceCharge> <ram:SpecifiedTradeSettlementHeaderMonetarySummation> <ram:AllowanceTotalAmount>10.00</ram:AllowanceTotalAmount> </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
FacturXInvoice.AllowanceTotalAmount(BT-107)AbstractTradeAllowanceCharge.ActualAmount(Document level allowance: BT-92)
Technical details
The test allows either the absence of both allowances and ram:AllowanceTotalAmount, or equality between that total and the sum of all allowance ram:ActualAmount values (ram:ChargeIndicator is false), rounded to two decimal places.
The rule applies to ram:AllowanceTotalAmount in ram:SpecifiedTradeSettlementHeaderMonetarySummation and the document level allowances in ram:SpecifiedTradeAllowanceCharge.
rule/@context)assert/@test)