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.
Why it fails
- An invoice with an amount to pay has neither
cbc:DueDatenorcac:PaymentTerms/cbc:Note(in CII,ram:DueDateDateTimeorram:Descriptioninram: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.
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
/ubl:Invoice/cac:LegalMonetaryTotal/cbc:PayableAmount
((. > 0) and (exists(//cbc:DueDate) or exists(//cac:PaymentTerms/cbc:Note))) or (. <= 0)
Checked with France EXTENDED-CTC-FR (UBL)
/rsm:CrossIndustryInvoice
(xs:decimal(//ram:DuePayableAmount) > 0 and ((//ram:SpecifiedTradePaymentTerms/ram:DueDateDateTime) or (//ram:SpecifiedTradePaymentTerms/ram:Description))) or not(xs:decimal(//ram:DuePayableAmount)>0)
Checked with France EXTENDED-CTC-FR (CII)
/rsm:CrossIndustryInvoice
(number(//ram:DuePayableAmount) > 0 and ((//ram:SpecifiedTradePaymentTerms/ram:DueDateDateTime) or (//ram:SpecifiedTradePaymentTerms/ram:Description))) or not(number(//ram:DuePayableAmount) > 0)
Checked with France Factur-X EXTENDED, Factur-X / ZUGFeRD EXTENDED