VRBL-INV-DE-PEPPOL-26

Basic Info

Rule The Seller Tax ID or the Tax Representative Tax Company ID must exist for certain Charge Tax ID values. If they do not exist the value of the Charge Tax ID must not be contained in VAT Codes [VRBL-CL-DE-PEPPOL-VAT-Code]. Not allowed values: AE, E, G, K, L, M, S, Z.
Context /ubl:Invoice/cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'true']/cac:TaxCategory/cbc:ID
Pattern vrbl-invoice-de-peppol-3p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = .
codeList = !$VRBL-CL-DE-PEPPOL-VAT-Code
showValues = true

Implementation

(
	boolean(/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) or boolean(/ubl:Invoice/cac:TaxRepresentativeParty/cac:PartyTaxScheme/cbc:CompanyID)
)
or
(
	not(boolean(.))
	or
	(
		not(
			not(
				contains(
					normalize-space(.),
					substring($VRBL-CL-DE-PEPPOL-VAT-Code, 1, 1)
				)
			)
			and
			contains(
				$VRBL-CL-DE-PEPPOL-VAT-Code,
				concat(
					substring($VRBL-CL-DE-PEPPOL-VAT-Code, 1, 1),
					normalize-space(.),
					substring($VRBL-CL-DE-PEPPOL-VAT-Code, 1, 1)
				)
			)
		)
	)
)