DK-R-016
For Danish Suppliers, a Credit note cannot have a negative total (PayableAmount)
error: the document is invalid
Peppol documentation ↗
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
Context
ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK'] | ubl-invoice:Invoice[$DKSupplierCountry = 'DK']
Test
not((boolean(/ubl-creditnote:CreditNote) and ($DKCustomerCountry = 'DK')) and (number(cac:LegalMonetaryTotal/cbc:PayableAmount/text()) < 0) )
Checked with Peppol BIS Billing 3.0 Invoice, Peppol BIS Billing 3.0 Credit Note