# BR-DEX-09 Amount due must account for third party payments

Amount due for payment (BT-115) must equal Invoice total amount with VAT (BT-112) minus Paid amount (BT-113) plus Rounding amount (BT-114) plus the sum of Third party payment amount (BT-DEX-002).

## Problem Description

Amount due for payment (BT-115) must equal Invoice total amount with VAT (BT-112) minus Paid amount (BT-113) plus Rounding amount (BT-114) plus the sum of Third party payment amount (BT-DEX-002).

> **ERROR**: XRechnung 3.0

## Context and Significance

This XRechnung Extension rule extends the core amount-due calculation (BR-CO-16) with the third party payment total that only the Extension scenario supports.

## Solution

Recompute BT-115 as BT-112 − BT-113 + BT-114 + Σ BT-DEX-002 and adjust the third party payment amounts if they do not reconcile. If no third party payments apply, use the standard XRechnung CIUS profile, where BR-CO-16 governs the amount due.

- validate
- convert

## Valid Examples

- BT-112 = 119.00, BT-113 = 0.00, BT-114 = 0.00, Σ BT-DEX-002 = 20.00 → BT-115 = 139.00

## Invalid Examples

- BT-115 = 119.00 while Σ BT-DEX-002 = 20.00 was omitted from the calculation

## Code Examples

### Valid XML
```
<cac:LegalMonetaryTotal>
  <cbc:TaxInclusiveAmount currencyID="EUR">119.00</cbc:TaxInclusiveAmount>
  <cbc:PrepaidAmount currencyID="EUR">0.00</cbc:PrepaidAmount>
  <cbc:PayableAmount currencyID="EUR">139.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:PrepaidPayment>
  <cbc:PaidAmount currencyID="EUR">20.00</cbc:PaidAmount>
</cac:PrepaidPayment>
```

### Invalid XML
```
<cac:LegalMonetaryTotal>
  <cbc:TaxInclusiveAmount currencyID="EUR">119.00</cbc:TaxInclusiveAmount>
  <cbc:PrepaidAmount currencyID="EUR">0.00</cbc:PrepaidAmount>
  <cbc:PayableAmount currencyID="EUR">119.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:PrepaidPayment>
  <cbc:PaidAmount currencyID="EUR">20.00</cbc:PaidAmount>
</cac:PrepaidPayment>
```

## Affected Fields

- [BT-115 Amount due for payment](/resources/xrechnung/bt-115-amount-due-for-payment)
- [BT-112 Invoice total amount with VAT](/resources/xrechnung/bt-112-invoice-total-amount-with-vat)
- [BT-113 Paid amount](/resources/xrechnung/bt-113-paid-amount)
- [BT-114 Rounding amount](/resources/xrechnung/bt-114-rounding-amount)
- [BT-DEX-002 Third party payment amount](/resources/xrechnung)

## Related Rules

- [BR-CO-16](/resources/kosit-validator-errors/br-co-16-amount-due-for-payment-must-match)
- [BR-DEX-11](/resources/kosit-validator-errors/br-dex-11-third-party-payment-amount-required)

## Validation Tools

- [Official KoSIT Validator](https://erechnungsvalidator.service-bw.de/): Validate your XRechnung files against all BR-DE rules.
- [Convert PDF to XRechnung](/pdf-to-xrechnung): Automatic validation error fixes when converting.

## Related Resources

- [Official Specification](https://xeinkauf.de/xrechnung/)
- [Test Suite](https://github.com/itplr-kosit/xrechnung-testsuite)
- [Complete Error List](/resources/kosit-validator-errors): Overview of all German XRechnung validation rules.
