# BR-CO-25

Source: https://xmlvalid.com/rules/BR-CO-25

> In case the Amount due for payment (BT-115) is positive, either the Payment due date (BT-9) or the Payment terms (BT-20) shall be present.

- Level: error
- Rule sets: EXTENDED-CTC-FR rules (UBL) 1.4.0.04, Romanian RO e-Factura rules (UBL) 1.0.9
- Context: `/ubl:Invoice/cac:LegalMonetaryTotal/cbc:PayableAmount`
- Test: `((. > 0) and (exists(//cbc:DueDate) or exists(//cac:PaymentTerms/cbc:Note))) or (. <= 0)`

> In case the Amount due for payment (BT-115) is positive, either the Payment due date (BT-9) or the Payment terms (BT-20) shall be present.

- Level: error
- Rule sets: EXTENDED-CTC-FR rules (CII) 1.4.0.04
- Context: `/rsm:CrossIndustryInvoice`
- Test: `(xs:decimal(//ram:DuePayableAmount) > 0 and ((//ram:SpecifiedTradePaymentTerms/ram:DueDateDateTime) or (//ram:SpecifiedTradePaymentTerms/ram:Description))) or not(xs:decimal(//ram:DuePayableAmount)>0)`

> In case the Amount due for payment (BT-115) is positive, either the Payment due date (BT-9) or the Payment terms (BT-20) shall be present.

- Level: error
- Rule sets: Factur-X EXTENDED rules 1.09.2
- Context: `/rsm:CrossIndustryInvoice`
- Test: `(number(//ram:DuePayableAmount) > 0 and ((//ram:SpecifiedTradePaymentTerms/ram:DueDateDateTime) or (//ram:SpecifiedTradePaymentTerms/ram:Description))) or not(number(//ram:DuePayableAmount) > 0)`

## Why it fails

- An invoice with an amount to pay has neither `cbc:DueDate` nor `cac:PaymentTerms/cbc:Note` (in CII, `ram:DueDateDateTime` or `ram:Description` in `ram:SpecifiedTradePaymentTerms`).

## How to fix it

- Add the payment due date (BT-9) or a payment terms text (BT-20). A credit note or an invoice that is already paid (amount due of zero) needs neither.

Validate a document against these rules: https://xmlvalid.com/validate
