VRBL-INV-PEPPOL-PINT-89

Basic Info

Rule The Accounting Tax Amount and the Invoice Tax Amount must have the same operational sign.
Context /ubl:Invoice
Pattern vrbl-invoice-peppol-pint
Severity fatal

Implementation

not(boolean(/ubl:Invoice/cbc:TaxCurrencyCode))
or
(
	cac:TaxTotal[cbc:TaxAmount/@currencyID = ../cbc:TaxCurrencyCode]/cbc:TaxAmount <= 0
	and
	cac:TaxTotal[cbc:TaxAmount/@currencyID = ../cbc:DocumentCurrencyCode]/cbc:TaxAmount <= 0
)
or
(
	cac:TaxTotal[cbc:TaxAmount/@currencyID = ../cbc:TaxCurrencyCode]/cbc:TaxAmount >= 0
	and 
	cac:TaxTotal[cbc:TaxAmount/@currencyID = ../cbc:DocumentCurrencyCode]/cbc:TaxAmount >= 0
)