UBL-SR-44
An Invoice may only have one unique PaymentID, but the PaymentID may be used for multiple PaymentMeans
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 | /cn:CreditNote
count(distinct-values(//cbc:PaymentID)) <= 1
Checked with EN 16931 Invoice (UBL), EN 16931 Credit Note (UBL), Croatia eRačun Invoice (UBL), Croatia eRačun Credit Note (UBL)
/ubl:Invoice | /cn:CreditNote
count(//cbc:PaymentID[not(preceding::cbc:PaymentID/. = .)]) <= 1
Checked with Peppol BIS Billing 3.0 Invoice, Peppol BIS Billing 3.0 Credit Note, France e-invoice (UBL), France e-credit note (UBL), XRechnung 3.0 Invoice (UBL), XRechnung 3.0 Credit Note (UBL)