# SDI-00427

Source: https://xmlvalid.com/rules/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

- Level: error
- Rule sets: SdI checks (FatturaPA ordinary invoice) Specifiche tecniche 1.9.1
- Context: `/p:FatturaElettronica`
- Test: `not(($format = 'FPA12' and string-length($recipient) = 7) or ($format = 'FPR12' and string-length($recipient) = 6))`

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.

Validate a document against these rules: https://xmlvalid.com/validate
