VRBL-INV-PEPPOL-PINT-122

Basic Info

Rule Each Document level Charge Group must have a Charge Reason or a Charge Reason Code.
Context /ubl:Invoice/cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'true']
Pattern vrbl-invoice-peppol-pint
Severity fatal

Implementation

(
	(
		boolean(cbc:AllowanceChargeReason)
		and
		not(boolean(/ubl:Invoice/cac:InvoiceLine/cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'true']/cbc:AllowanceChargeReason))
	)
	or
	(
		boolean(cbc:AllowanceChargeReasonCode)
		and
		not(boolean(/ubl:Invoice/cac:InvoiceLine/cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'true']/cbc:AllowanceChargeReasonCode))
	)
)
or
(
boolean(/ubl:Invoice/cac:InvoiceLine/cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'true']/cbc:AllowanceChargeReason)
or
boolean(/ubl:Invoice/cac:InvoiceLine/cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'true']/cbc:AllowanceChargeReasonCode)
)