VRBL-INV-EN16931-M-51

Basic Info

Rule An Invoice that contains an Invoice Line where the Invoiced Item Tax Scheme Code is "Reverse charge" must contain the Seller Tax ID, Seller Tax Representative Tax ID and/or the Buyer Tax ID and the Buyer Legal Registration ID.
Context /ubl:Invoice
Pattern vrbl-invoice-en16931-ubl-model
Severity fatal

Implementation

(
	boolean(cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[cbc:ID = 'AE'][cac:TaxScheme/cbc:ID = 'VAT']) 
	and 
	(
		boolean(cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) 
		or 
		boolean(cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID)
	)
	and 
	(
		boolean(cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID) 
		or 
		boolean(cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID) 
	)
)
or 
not(boolean(cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[cbc:ID = 'AE'][cac:TaxScheme/cbc:ID='VAT']))