Generate Nfe Key

Asked

Viewed 13,376 times

3

I have a closed source software that validates the Nfe key in the invoice entry by the stock module.

I need to generate some Nfe keys for testing.

So far I know that the Nfe key validates the supplier’s IBGE code, document number, and Note Series.

Someone has the algorithm for generating these key bills?

I need the algorithm to make a key generation system.

I searched the internet but I didn’t find this information, maybe I’m looking for wrong.

Can you help me?

Thank you.

2 answers

5


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:

inserir a descrição da imagem aqui

Source: http://www.oobj.com.br/bc/article/comor-%C3%A9-formed-the-access-key-of-a-nf-e-nfc-a-ct-e-e-a-mdf-E-281.html

Manual Nfe: http://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=9hd38oni4Nc=

  • 1

    Perfect, @Anthraxisbr! I will only suggest you also take a look at the Acbr Project, which I always recommend when dealing with any commercial software related subject. They have interesting examples that may be useful :)

  • It helped a lot, I will try to generate the keys with the information of this manual.

-2

Browser other questions tagged

You are not signed in. Login or sign up in order to post.