Regula S.I.23: CustomerInfo
Elementul CustomerInfo din secțiunea Structuri comune (Structures) a declarației informative D406 este verificat de DUKIntegrator după regula S.I.23 din documentația oficială SAF-T publicată de ANAF. Cerința oficială este citată mai jos ca atare, împreună cu explicația erorii pe care regula o produce la validare.
Cerința oficială
Câmp definit în documentația oficială: CustomerID
Unique client code consisting of: type (two decimal places) followed by the unique client code, as follows: 1. 00 followed by CUI - where the type is 00, and CUI is the unique identification code for economic operators registered in Romania. The code is an integer, with 1 to 9 digits, followed by a control digit - Example: 004221306 - for the Ministry of Public Finance Attention! The fiscal attribute "RO" for VAT payers is not included 2. 01 followed by the country code (according to ISO 3166-1 - 2 letters) and the unique VAT Identification Code of the respective Member State - for the economic operators from the EU Member States, except Romania, verified according to the VIES system (VAT Information Exchange System) - Example: 01EL123456789 or 01HU12345678 3. 02 followed by the country code and the unique VAT identification code of the respective state, which is neither Romania nor EU member state - for economic operators from other states than Romania or EU members - Example: 02TK123005284 4. 03 followed by CNP for individuals Romanian citizens or 03 followed by the unique personal code for individuals resident in Romania (same format as CNP, but with the first digit being 7 or 8) or the NIF of non-resident individuals 5. 04 followed by the customer code uniquely associated by the economic operator, for individuals who do not declare their CNP on transactions (example: online commerce). 6. 05 followed by the country code and the customer code uniquely associated by the economic operator - for the economic operators that are not registered for VAT, from the EU Member States, except Romania 7. 06 followed by the country code and the customer code uniquely associated by the economic operator - for the economic operators that are not registered for VAT from non-EU states 8. 08 followed by 13 zero's (080000000000000) for unidentified customers with a fiscal code on transactions at the point-of-sales, like petrol stations and groceries. This code is restricted ONLY for such transactions, is not a replacement on invoices, etc. This code is NOT USED for SupplierID element - the identity of the supplier is known based on the fiscal code 9. 09 followed by NIF for non-resident legal entities registered in Romania; 10. 10 followed by the country code and the unique code assigned in the case of banking companies forcustomers of non-resident legal entities that are not found in category 01,02,05,06 and 09; 11. 11 followed by the country code and the unique code assigned in the case of banking companies for non-resident individuals customers who are not found in category 03
Text citat din documentația oficială SAF-T (SchemaDefCod), în limba originală, fără parafrazare.
Detalii din documentația oficială
Cod unic pentru client este format astfel: tip (două cifre zecimale) urmat de codul unic al clientului, după cum urmează: 1. 00 urmat de CUI - unde tipul este 00, iar CUI este codul unic de identificare pentru operatorii economici înregistrați în România. Codul este un număr întreg zecimal, cu 1 până la 9 cifre, urmat de o cifră de control - Exemplu: 004221306 - pentru Ministerul Finantelor Publice Atenție! Nu se trece și atributul fiscal ”RO” pentru plătitorii de TVA 2. 01 urmat de codul de țară (conform ISO 3166-1 - 2 litere) și de Codul unic de identificare pentru TVA din statul membru respectiv- pentru operatorii economici din statele membre ale UE, mai puțin România, verificate conform sistemului VIES (VAT Information Exchange System) - Exemplu: 01EL123456789 sau 01HU12345678 3. 02 urmat de codul de țară și de codul unic de identificare pentru TVA din statul respectiv, care nu este nici România, nici stat membru UE - pentru operatorii economici din alte state care nu sunt România sau membre UE - Exemplu: 02TK123005284 4. 03 urmat de CNP pentru persoane fizice cetățeni români sau 03 urmat de codul unic personal pentru persoane fizice rezidente în România (același format cu CNP-ul, dar la care prima cifra este 7 sau 8) sau NIF-ul persoanelor fizice nerezidente 5. 04 urmat de cod client asociat în mod unic de către operatorul economic, pentru pers. fizice care nu își declară CNP-ul pe tranzacții (exemplu: comerț online). 6. 05 urmat de codul de țară și de cod client asociat în mod unic de către operatorul economic - pentru operatorii economici care nu sunt înregistrați în scopuri de TVA din statele membre ale UE, mai puțin România 7. 06 urmat de codul de țară și de cod client asociat în mod unic de către operatorul economic - pentru operatorii economici care nu sunt înregistrați în scopuri de TVA din statele non-UE 8. 08 urmat de 13 cifre zero (080000000000000) pentru clienții care NU SE IDENTIFICĂ cu cod fiscal în tranzacțiile de la punctele de vânzare, precum stații de distribuție de carburanți-lubrefianți sau magazine cu vânzare în detaliu. Acest cod este utilizat NUMAI pentru astfel de tranzacții și nu este un inlocuitor universal în raportarea facturilor și plăților, etc. Acest cod NU SE UTILIZEAZĂ pentru elementul SupplierID - deoarece identitatea furnizorului pe bază de cod fiscal este mereu cunoscută 9. 09 urmat de NIF pentru persoane juridice nerezidente inregistrate in Romania; 10. 10 urmat de codul de tara si de codul unic alocat in cazul societatilor bancare pentru clientii persoane juridice nerezidente care nu se regasesc in categoria 01,02,05,06 si 09; 11. 11 urmat de codul de tara si de codul unic alocat in cazul societatilor bancare pentru clientii persoane fizice nerezidente care nu se regasesc in categoria 03
The syntactic validation for the element S.I.23 CustomerID is done as follows: 1. If the element S.I.23 CustomerID is different from ”0” (zero), then the value is validated as follows: If the first two characters from S.I.23 CustomerID are: 1.1. ”00” then the max length of the string without the prefix ”00”, must be 10 digits. The substring ”RO” is not accepted. The validation is made according to the well-known rules for CUI. CUI format is #########C – where ######### is the identification number, with length between 1 and 9 digits, and C is the control digit, 1 digit 1.2. ”01” then the code for the country (characters 3 and 4) must be a valid country code from the ISO 3166-1 - 2 letters nomenclature. – Example: ”EL” for 01EL123456789 or ”HU” for 01HU12345678 1.3. ”02” then the code for the country (characters 3 and 4) must be a valid country code from the ISO 3166-1 - 2 letters nomenclature. – Example: ”TK” for 02TK123005284 1.4. ”03” then the max length of the string without the prefix ”03”, must be 13 digits. The first digit in the string must be different from 0 (zero) 1.5. ”04” then the string is verified not to contain special characters (for example: ”.”, ”,”,”!”, ”-”, ”?” etc.) 1.6. ”05” then the code for the country (characters 3 and 4) must be a valid country code from the ISO 3166-1 - 2 letters nomenclature 1.7. ”06” then the code for the country (characters 3 and 4) must be a valid country code from the ISO 3166-1 - 2 letters nomenclature 1.8. ”08” then the max length of the string without the prefix ”08”, must be 13 digits. The value must be equal with ”080000000000000” 1.9 “09” then the max length of the string without the prefix ”09”, must be 13 digits. The first digit in the string must be different from 0 (zero) 1.10 “10” then TaxAccountingBasis (H2=BANK) and the code for the country (characters 3 and 4) must be a valid country code from the ISO 3166-1 - 2 letters nomenclature and the max length of the string without the prefix ”10”, must be max 20 character.- the code is used until the provisions of art 82, paragraph (6), letter e of law no. 207/2015 regarding the Fiscal Procedure Code with subsequent amendments and additions 1.11 “11” then TaxAccountingBasis (H2=BANK) then the code for the country (characters 3 and 4) must be a valid country code from the ISO 3166-1 - 2 letters nomenclature and the max length of the string without the prefix ”11”, must be max 20 character.- the code is used until the provisions of art 82, paragraph (6), letter e of law no. 207/2015 regarding the Fiscal Procedure Code with subsequent amendments and additions 1.12. In any other case the value is not validated and is return a syntactic validation error. (Validation error – CustomerID incorrect value) 2. Else if S.I.23 CustomerID is equal to ”0” (zero), then is return a syntactic validation error. (CustomerID can not be equal to ”0” (zero))
Validarea sintactică a valorii elementului S.I.23 CustomerID se face astfel: 1. Dacă elementul S.I.23 CustomerID este diferit de ”0” (zero), atunci valoarea se validează astfel: Dacă primele două caractere din S.I.23 CustomerID sunt: 1.1. ”00” atunci se verifică ca lungimea maximă a valorii fără prefixul ”00”, să fie de 10 caractere doar de tip numeric. Nu se acceptă caracterele ”RO”. Validarea se realizează după regulile cunoscute pentru CUI Formatul unui CUI este #########C – unde ######### este numărul de identificare, între 1 și 9 cifre, iar C este numărul de verificare, 1 cifră 1.2. ”01” atunci se verifică codul de țară (caracterele 3 și 4) care trebuie să fie un cod valid conform nomenclatorului ISO 3166-1 - 2 litere. - Exemplu: ”EL” pentru 01EL123456789 sau ”HU” pentru 01HU12345678 1.3. ”02” atunci se verifică codul de țară (caracterele 3 și 4) care trebuie să fie un cod valid conform nomenclatorului ISO 3166-1 - 2 litere. - Exemplu: ”TK” pentru 02TK123005284 1.4. ”03” atunci se verifică ca lungimea maximă a înregistrării fără prefixul ”03”, să fie de 13 caractere de tip numeric. Se verifică ca prima cifră din grupul de 13 caractere să fie diferită de 0. 1.5. ”04” atunci se verifică ca valoarea să nu conțină caractere speciale (de exemplu: ”.”, ”,”,”!”, ”-”, ”?” etc) 1.6. ”05” atunci se verifică codul de țară (caracterele 3 și 4) care trebuie să fie un cod valid conform nomenclatorului ISO 3166-1 - 2 litere 1.7. ”06” atunci se verifică codul de țară (caracterele 3 și 4) care trebuie să fie un cod valid conform nomenclatorului ISO 3166-1 - 2 litere. 1.8. ”08” atunci se verifică ca lungimea maximă a valorii fără prefixul ”08”, să fie de 13 caractere doar de tip numeric. Se verifică ca valoarea să fie egal cu ”080000000000000” 1.9. “09” atunci se verifică ca lungimea maximă a înregistrării fără prefixul ”09”, să fie de 13 caractere de tip numeric. Se verifică ca prima cifră din grupul de 13 caractere să fie diferită de 0 1.10 “10” atunci se verifică ca societatea are TaxAccountingBasis (H2) = Bank si codul de țară (caracterele 3 și 4) care trebuie să fie un cod valid conform nomenclatorului ISO 3166-1 - 2 litere si se verifică ca lungimea maximă a valorii fără prefixul ”10”, să fie de max 20 caractere alfanumerice - codul se foloseste pana la aplicarea prevederilor art 82, alin (6), lit e din legea nr. 207/2015 privind Codul de procedura fiscala cu modificarile si completarile ulterioare 1.11 “11” atunci se verifică ca societatea are TaxAccountingBasis (H2) = Bank si codul de țară (caracterele 3 și 4) care trebuie să fie un cod valid conform nomenclatorului ISO 3166-1 - 2 litere si se verifică ca lungimea maximă a valorii fără prefixul ”11”, să fie de max 20 caractere alfanumerice - codul se foloseste pana la aplicarea prevederilor art 82, alin (6), lit e din legea nr. 207/2015 privind Codul de procedura fiscala cu modificarile si completarile ulterioare 1.12. În orice alt caz nu se validează valoarea, semnalându-se eroare la validarea sintactică.(Validation error – CustomerID incorrect value) 2. Altfel dacă S.I.23 CustomerID este egal cu ”0” (zero) se semnalează eroare sintactică. ( CustomerID nu poate fi ”0” (zero))
The semantic validation for the element S.I.23 CustomerID is done as follows: 1. If the element S.I.23 CustomerID is different from ”0” (zero), then the value is validated as follows: If the first two characters from S.I.23 CustomerID are: 1.1. ”00” then the max length of the string without the prefix ”00”, must be 10 digits. The substring ”RO” is not accepted. The validation is made according to the well-known rules for CUI. CUI format is #########C – where ######### is the identification number, with length between 1 and 9 digits, and C is the control digit, 1 digit 1.2. ”01” then the code for the country (characters 3 and 4) must be a valid country code from the ISO 3166-1 - 2 letters nomenclature. – Example: ”EL” for 01EL123456789 or ”HU” for 01HU12345678 1.3. ”02” then the code for the country (characters 3 and 4) must be a valid country code from the ISO 3166-1 - 2 letters nomenclature. – Example: ”TK” for 02TK123005284 1.4. ”03” then the max length of the string without the prefix ”03”, must be 13 digits. The first digit in the string must be different from 0 (zero) 1.5. ”04” then the string is verified not to contain special characters (for example: ”.”, ”,”,”!”, ”-”, ”?” etc.) 1.6. ”05” then the code for the country (characters 3 and 4) must be a valid country code from the ISO 3166-1 - 2 letters nomenclature 1.7. ”06” then the code for the country (characters 3 and 4) must be a valid country code from the ISO 3166-1 - 2 letters nomenclature 1.8. ”08” then the max length of the string without the prefix ”08”, must be 13 digits. The value must be equal with ”080000000000000” 1.9 “09” then the max length of the string without the prefix ”09”, must be 13 digits. The first digit in the string must be different from 0 (zero) 1.10 “10” then TaxAccountingBasis (H2=BANK) and the code for the country (characters 3 and 4) must be a valid country code from the ISO 3166-1 - 2 letters nomenclature and the max length of the string without the prefix ”10”, must be max 20 character.- the code is used until the provisions of art 82, paragraph (6), letter e of law no. 207/2015 regarding the Fiscal Procedure Code with subsequent amendments and additions 1.11 “11” then TaxAccountingBasis (H2=BANK) then the code for the country (characters 3 and 4) must be a valid country code from the ISO 3166-1 - 2 letters nomenclature and the max length of the string without the prefix ”11”, must be max 20 character.- the code is used until the provisions of art 82, paragraph (6), letter e of law no. 207/2015 regarding the Fiscal Procedure Code with subsequent amendments and additions 1.12. In any other case the value is not validated and is return a semantic validation error. (Validation error – CustomerID incorrect value) 2. Else if S.I.23 CustomerID is equal to ”0” (zero), then is return a semantic validation error. (CustomerID can not be equal to ”0” (zero))
Validarea semantică a valorii elementului S.I.23 CustomerID se face astfel: 1. Dacă elementul S.I.23 CustomerID este diferit de ”0” (zero), atunci valoarea se validează astfel: Dacă primele două caractere din S.I.23 CustomerID sunt: 1.1. ”00” atunci se verifică ca lungimea maximă a valorii fără prefixul ”00”, să fie de 10 caractere doar de tip numeric. Nu se acceptă caracterele ”RO”. Validarea se realizează după regulile cunoscute pentru CUI Formatul unui CUI este #########C – unde ######### este numărul de identificare, între 1 și 9 cifre, iar C este numărul de verificare, 1 cifră 1.2. ”01” atunci se verifică codul de țară (caracterele 3 și 4) care trebuie să fie un cod valid conform nomenclatorului ISO 3166-1 - 2 litere. - Exemplu: ”EL” pentru 01EL123456789 sau ”HU” pentru 01HU12345678 1.3. ”02” atunci se verifică codul de țară (caracterele 3 și 4) care trebuie să fie un cod valid conform nomenclatorului ISO 3166-1 - 2 litere. - Exemplu: ”TK” pentru 02TK123005284 1.4. ”03” atunci se verifică ca lungimea maximă a înregistrării fără prefixul ”03”, să fie de 13 caractere de tip numeric. Se verifică ca prima cifră din grupul de 13 caractere să fie diferită de 0. 1.5. ”04” atunci se verifică ca valoarea să nu conțină caractere speciale (de exemplu: ”.”, ”,”,”!”, ”-”, ”?” etc) 1.6. ”05” atunci se verifică codul de țară (caracterele 3 și 4) care trebuie să fie un cod valid conform nomenclatorului ISO 3166-1 - 2 litere 1.7. ”06” atunci se verifică codul de țară (caracterele 3 și 4) care trebuie să fie un cod valid conform nomenclatorului ISO 3166-1 - 2 litere. 1.8. ”08” atunci se verifică ca lungimea maximă a valorii fără prefixul ”08”, să fie de 13 caractere doar de tip numeric. Se verifică ca valoarea să fie egal cu ”080000000000000” 1.9. “09” atunci se verifică ca lungimea maximă a înregistrării fără prefixul ”09”, să fie de 13 caractere de tip numeric. Se verifică ca prima cifră din grupul de 13 caractere să fie diferită de 0 1.10 “10” atunci se verifică ca societatea are TaxAccountingBasis (H2) = Bank si codul de țară (caracterele 3 și 4) care trebuie să fie un cod valid conform nomenclatorului ISO 3166-1 - 2 litere si se verifică ca lungimea maximă a valorii fără prefixul ”10”, să fie de max 20 caractere alfanumerice - codul se foloseste pana la aplicarea prevederilor art 82, alin (6), lit e din legea nr. 207/2015 privind Codul de procedura fiscala cu modificarile si completarile ulterioare 1.11 “11” atunci se verifică ca societatea are TaxAccountingBasis (H2) = Bank si codul de țară (caracterele 3 și 4) care trebuie să fie un cod valid conform nomenclatorului ISO 3166-1 - 2 litere si se verifică ca lungimea maximă a valorii fără prefixul ”11”, să fie de max 20 caractere alfanumerice - codul se foloseste pana la aplicarea prevederilor art 82, alin (6), lit e din legea nr. 207/2015 privind Codul de procedura fiscala cu modificarile si completarile ulterioare 1.12. În orice alt caz nu se validează valoarea, semnalându-se eroare la validarea semantică.(Validation error – CustomerID incorrect value) 2. Altfel dacă S.I.23 CustomerID este egal cu ”0” (zero) se semnalează eroare semantică. ( CustomerID nu poate fi ”0” (zero))
Valori scurte din coloanele fișei oficiale (tip de dată, sursă, obligativitate, cardinalitate), în ordinea din documentație:
SAFmiddle1textType ERP Mandatory Mandatory 1
Eroarea tipică la validare
La validare, DUKIntegrator semnalează această regulă atunci când elementul CustomerInfo lipsește, este gol sau nu respectă formatul cerut. Eroarea apare în secțiunea Structuri comune (Structures) a fișierului D406, iar mesajul validatorului indică de regulă linia din XML, nu și regula încălcată — pe aceasta o ai citată mai sus. Compară valoarea raportată cu cerința oficială înainte de a redepune.