Amount due for payment

Error BR-FXEXT-CO-16 Factur-X

Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Paid amount (BT-113) + Rounding amount (BT-114) + Sum of Charge amount collected on behalf of a third party (BT-179).

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

ram:DuePayableAmount does not equal the invoice total with VAT minus amounts already prepaid, plus the rounding amount and charges collected on behalf of third parties.

What the rule means

The amount due shows what remains payable after accounting for prepayments, rounding, and amounts collected on behalf of third parties.

Affected fields BT-115 BT-112 BT-113 BT-114 BT-179
Please reconcile the amount still due

The amount still due does not match the invoice total after accounting for prepayments, rounding, and amounts collected on behalf of third parties. You can compare the individual components.

What to do
  1. Compare FacturXInvoice.DuePayableAmount with FacturXInvoice.GrandTotalAmount minus FacturXInvoice.TotalPrepaidAmount.
  2. Also account for FacturXInvoice.RoundingAmount and the FinancialAdjustment.ActualAmount values for SpecifiedFinancialAdjustment.
  3. Generate the invoice again and validate it once more.
Check in FactoorSharp
  • FacturXInvoice.DuePayableAmount (BT-115)
  • FacturXInvoice.GrandTotalAmount (BT-112)
  • FacturXInvoice.RoundingAmount (BT-114)
  • FacturXInvoice.TotalPrepaidAmount (BT-113)
  • FinancialAdjustment.ActualAmount (SpecifiedFinancialAdjustment: BT-179)
Technical details

The test compares ram:DuePayableAmount with ram:GrandTotalAmount minus ram:TotalPrepaidAmount, plus ram:RoundingAmount and the sum of ram:ActualAmount values in ram:SpecifiedFinancialAdjustment.

Where the rule applies

The rule applies to ram:SpecifiedTradeSettlementHeaderMonetarySummation and checks ram:DuePayableAmount against the invoice, prepaid, rounding, and third-party amounts.

Context (rule/@context)
//ram:SpecifiedTradeSettlementHeaderMonetarySummation
Test expression (assert/@test)
xs:decimal(ram:DuePayableAmount) = xs:decimal(sum(ram:GrandTotalAmount/xs:decimal(.))) - xs:decimal(sum(ram:TotalPrepaidAmount/ xs:decimal(.))) + xs:decimal(sum(ram:RoundingAmount/xs:decimal(.))) + xs:decimal(sum(../ ram:SpecifiedFinancialAdjustment/ram:ActualAmount/xs:decimal(.)))