Generate NFe Key

2

I have closed source software that validates the NFe key in the invoice entry for the stock module.

I need to generate some NFe keys for testing.

So far, I know that the NFe key validates the provider's IBGE code, document number, and Note Series.

Does anyone have the algorithm for generating these invoice keys?

I need the algorithm to make a system for generating these keys.

I searched the internet but did not find this information, maybe looking wrong.

Can you help me?

Thank you.

    
asked by anonymous 19.09.2017 / 15:06

2 answers

4

The NFe key has the following rule:

   cUF - Código da UF do emitente do Documento Fiscal;
    AAMM - Ano e Mês de emissão da NF-e;
    CNPJ - CNPJ do emitente;
    mod - Modelo do Documento Fiscal;
    serie - Série do Documento Fiscal;
    nNF - Número do Documento Fiscal;
    tpEmis – forma de emissão da NF-e;
    cNF - Código Numérico que compõe a Chave de Acesso;
    cDV - Dígito Verificador da Chave de Acesso.

With table structure below:

Source: link

Manual Nfe: link

    
19.09.2017 / 15:11
0

link

class of the repository that generates the key, validates it, and generates it: link

This repository generates the key for you, transmits, generates xml.

    
11.10.2017 / 00:53