fatalEN 16931EN 16931 business ruleCIIUBLBG-3BT-25
Each Preceding Invoice reference (BG-3) shall contain a Preceding Invoice reference (BT-25).
A preceding invoice reference group (BG-3) has no reference (BT-25).
Add BT-25 - the number of the invoice being corrected or credited (UBL cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID). Credit notes and corrective invoices need it.
CII — context $Preceding_Invoice
normalize-space(ram:IssuerAssignedID) != ''
UBL — context cac:BillingReference
exists(cac:InvoiceDocumentReference/cbc:ID)
Nothing is stored, and the whole invoice is checked, not just this rule. A PDF only works if it is Factur-X / ZUGFeRD — a PDF with the invoice XML inside it.