VRBL-INV-IT-1p2-5

Basic Info

Rule For the Invoice Type Code "TD16", "TD17", "TD18", "TD19", the Seller Tax ID used as VAT ID must not equal the Buyer Tax Company ID used as VAT ID.
Context /ubl:Invoice
Pattern vrbl-invoice-it-1p2
Severity fatal

Implementation

not(
	cbc:InvoiceTypeCode = concat($VRBL-IT-Prefix, 'TD16')
	or
	cbc:InvoiceTypeCode = concat($VRBL-IT-Prefix, 'TD17')
	or
	cbc:InvoiceTypeCode = concat($VRBL-IT-Prefix, 'TD18')
	or
	cbc:InvoiceTypeCode = concat($VRBL-IT-Prefix, 'TD19')
)
or
not(cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID = cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID)