Regula SD.MG.22: SupplierID
Regula SD.MG.22 face parte din documentația oficială SAF-T publicată de ANAF și privește elementul SupplierID din secțiunea SourceDocuments a declarației informative D406. Validatorul DUKIntegrator o aplică la fiecare depunere; mai jos ai cerința oficială, citată ca atare, și explicația erorii pe care o produce la validare.
Cerința oficială
Unique supplier code consisting of: type (two decimal places) followed by the unique supplier 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 supplier 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 supplier 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 supplier code uniquely associated by the economic operator - for the economic operators that are not registered for VAT from non-EU states
Text citat din documentația oficială SAF-T (SchemaDefCod), în limba originală, fără parafrazare.
Detalii din documentația oficială
Cod unic pentru furnizor este format astfel: tip (două cifre zecimale) urmat de codul unic al furnizorului, 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 codul furnizorului 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 codul furnizorului 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 codul furnizorului 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
The syntactic validation for the element SD.MG.22 SupplierID is done as follows: 1. If the element SD.MG.22 SupplierID is reported with value ”0” (zero), then the element SD.MG.21 CustomerID must be different from ”0” (zero), meaning the identity of the partner to which the delivery was made (conventionally considered ”customer”) is reported 2. If the element SD.MG.22 SupplierID is different from value ”0” (zero) then the value is validated as follows: If the first two characters from SD.MG.22 SupplierID are: 2.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 2.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 2.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 2.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). 2.5. ”04” then the string is verified not to contain special characters (for example: ”.”, ”,”,”!”, ”-”, ”?” etc.) 2.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. 2.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. 2.8. In any other case the value is not validated and is return a syntactic validation error. (Validation error – SupplierID incorrect value) 3. Else if SD.MG.21 CustomerID AND SD.MG.22 SupplierID are concomitantly equal to ”0” (zero), then is return a syntactic validation error. (CustomerID and SupplierID can not be concomitantly 0(zero))
Validarea sintactică a valorii elementului SD.MG.22 SupplierID se face astfel: 1. Dacă elementul SD.MG.22 SupplierID este egal cu ”0” (zero), atunci elementul SD.MG.21 CustomerID trebuie să fie diferit de ”0” (zero), adică este completat cu identitatea partenerului către care s-a făcut livrarea (convențional considerat – „client”) 2. Dacă elementul SD.MG.22 SupplierID este diferit de ”0” (zero) atunci valoarea se validează astfel: Dacă primele două caractere din SD.MG.22 SupplierID sunt: 2.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ă 2.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 2.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 2.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. 2.5. ”04” atunci se verifică ca valoarea să nu conțină caractere speciale (de exemplu: ”.”, ”,”,”!”, ”-”, ”?” etc). 2.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. 2.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. 2.8. În orice alt caz nu se validează valoarea, semnalându-se eroare la validarea sintactică.(Validation error – SupplierID incorect value) 3. Altfel dacă SD.MG.21 CustomerID AND SD.MG.22 SupplierID sunt concomitent egale cu ”0” (zero) se semnalează eroare sintactică. ( CustomerID și SupplierID nu pot fi ambele simultan ”0” (zero))
The semantic validation for the element SD.MG.22 SupplierID is done as follows: 1. If the element SD.MG.22 SupplierID is reported with value ”0” (zero), then the element SD.MG.21 CustomerID must be different from ”0” (zero), meaning the identity of the partner to which the delivery was made (conventionally considered ”customer”) is reported 2. If the element SD.MG.22 SupplierID is different from value ”0” (zero) then the value is validated as follows: If the first two characters from SD.MG.22 SupplierID are: 2.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 2.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 2.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 2.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). 2.5. ”04” then the string is verified not to contain special characters (for example: ”.”, ”,”,”!”, ”-”, ”?” etc.) 2.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. 2.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. 2.8. In any other case the value is not validated and is return a semantic validation error. (Validation error – SupplierID incorrect value) 3. Else if SD.MG.21 CustomerID AND SD.MG.22 SupplierID are concomitantly equal to ”0” (zero), then is return a semantic validation error. (CustomerID and SupplierID can not be concomitantly 0(zero))
Validarea semantică a valorii elementului SD.MG.22 SupplierID se face astfel: 1. Dacă elementul SD.MG.22 SupplierID este egal cu ”0” (zero), atunci elementul SD.MG.21 CustomerID trebuie să fie diferit de ”0” (zero), adică este completat cu identitatea partenerului către care s-a făcut livrarea (convențional considerat – „client”) 2. Dacă elementul SD.MG.22 SupplierID este diferit de ”0” (zero) atunci valoarea se validează astfel: Dacă primele două caractere din SD.MG.22 SupplierID sunt: 2.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ă 2.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 2.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 2.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. 2.5. ”04” atunci se verifică ca valoarea să nu conțină caractere speciale (de exemplu: ”.”, ”,”,”!”, ”-”, ”?” etc). 2.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. 2.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. 2.8. În orice alt caz nu se validează valoarea, semnalându-se eroare la validarea semantică.(Validation error – SupplierID incorect value) 3. Altfel dacă SD.MG.21 CustomerID AND SD.MG.22 SupplierID sunt concomitent egale cu ”0” (zero) se semnalează eroare semantică. ( CustomerID și SupplierID nu pot fi ambele simultan ”0” (zero))
For records of lines of stock movements - the element SD.MG.22 SupplierID is filled with the identity of the partner from which the purchase was made (conventionally considered – "supplier") and with the value 0 (zero) for the element SD.MG.21 CustomerID.
Pentru înregistrările liniilor de mișcări de stocuri – se completează elementul SD.MG.22 SupplierID cu identitatea partenerului de la care s-a făcut achiziția (convențional considerat – „furnizor”) și cu valoarea 0 (zero) pentru elementul SD.MG.21 CustomerID. Pentru tranzacțiile si liniile corespunzătoare din sub-secțiunea 4.4.Movement of Goods care nu reprezintă ieșiri către clienți sau intrări de la furnizori, în câmpurile “SupplierID” si “CustomerID” se va completa codul unic al contribuabilului raportor. Aceste înregistrări sunt diferențiate prin faptul că SupplierID = CustomerID = RegistrationNumber (din structura 5.5 CompanyHeaderStructure), prefixat cu „00”, fără particula „RO” (în RegistrationNumber se completează CUI-ul contribuabilului raportor).
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
Dacă validatorul a semnalat această regulă, problema se află în secțiunea SourceDocuments: elementul SupplierID nu îndeplinește condiția citată mai sus. Cauzele frecvente sunt exportul incomplet din programul de contabilitate și datele de firmă sau de nomenclator neactualizate. Corectează la sursă, în programul din care generezi D406, nu direct în XML.