SDI-00427
1.1.4 <CodiceDestinatario> di 7 caratteri a fronte di 1.1.3 <FormatoTrasmissione> con valore FPA12 o 1.1.4 <CodiceDestinatario> di 6 caratteri a fronte di 1.1.3 <FormatoTrasmissione> con valore FPR12
In English The recipient code (CodiceDestinatario, 1.1.4) does not fit the transmission format: public administrations have six character codes (FPA12), everyone else seven (FPR12).
Why it fails
- An invoice to a public administration was sent as FPR12 with its six character IPA office code, or a B2B invoice as FPA12 with a seven character code.
How to fix it
Use FPA12 (in FormatoTrasmissione and the versione attribute) with the office's six character code from IndicePA, or FPR12 with a seven character code, 0000000 when the buyer has none.
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.
/p:FatturaElettronica
not(($format = 'FPA12' and string-length($recipient) = 7) or ($format = 'FPR12' and string-length($recipient) = 6))
Checked with FatturaPA 1.2.3