XV-RO-12
CUI cumparator incorect. #The buyer's tax code (CUI) fails ANAF's check: at most ten digits, no leading zero, and a valid check digit.
Why it fails
- The buyer's CUI has a typo, so its last digit (the check digit, key 753217532) does not match.
- The code has a leading zero, more than ten digits, spaces inside or another prefix than RO (
RO 123,R0123). - The code ANAF's validator reads is not the one you meant: it takes
cac:PartyTaxScheme/cbc:CompanyIDfirst, andcac:PartyLegalEntity/cbc:CompanyIDonly when that is missing or not a Romanian code.
How to fix it
Copy the buyer's CUI from the ANAF register, as RO followed by the digits for a VAT payer, or the digits alone. This is our check, written after ANAF's validator, not one of the published rules.
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.
/ubl:Invoice | /cn:CreditNote
$buyer != 'cui'
Checked with Romania RO e-Factura Invoice (UBL), Romania RO e-Factura Credit Note (UBL)