XV-FI-09
The payment reference '…' has no valid check digit: a Finnish reference number (SPY) ends in a 7-3-1 check digit, an international one (ISO, RF) has ISO 11649 check digits (Finvoice 3.0 guidelines, 13).
error: the document is invalid
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
/Finvoice/EpiDetails/EpiPaymentInstructionDetails/EpiRemittanceInfoIdentifier[normalize-space(.) != '']
Test
if (@IdentificationSchemeName = 'ISO' or starts-with($ref, 'RF')) then (matches($ref, '^RF[0-9]{2}[0-9A-Za-z]{1,21}$') and fi:iso7064($ref)) else fi:reference($ref)
Checked with Finvoice 3.0