Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NOTA FISCAL ELETRÔNICA - COMPONENTE ACBRNFE
- CONFIGURAÇÕES
- Use {para conversão}
- pcnconversao, pcnconversaoNFE
- configuracoes.geral.modeloDF:= moNFE;
- configuracoes.geral.versaoDF:= ve400;
- formaEmissao:=teNormal;
- configuracoes.arquivos.pathSchemas:=(diretório dos arquivos .XSD)
- configuracoes.arquivos.separarporCNPJ:=true;
- configuracoes.arquivos.separarporAno:=true;
- configuracoes.arquivos.separarporMes:=true;
- webservices.visualisar:=true;
- webservices.UF:=’SP’;
- webservices.ambiente:=taHomologacao;//ambiente de testes
- webservices.ajustaAguardaConsultaRet:=True;
- webservices.aguardaConsultaRet:=4000; {em milesegundos = 4 segundos}
- webservices.intervalotentativas:=1000;
- webservices.tentativa:=3;
- //os arquivos .XSD podem ser encontrados no site da receita
- //ou na pasta acbr/exemplos/acbrDFE/Schemas/NFE
- CONFIGURAÇÃO PARA O CERTIFICADO DIGITAL
- //tipos de criptografias
- //Capicom = foi descontinuado no ACbrNFE
- //Wincrypt {nativo do próprio Windows} //aceita certificado A1 e A3
- //OpenSSL {Use DLL de terceiros, precisa copiar DLL junto ao EXE} //aceita só certificado A1
- //Certificado A1 – Fixo – Usa o arquivo PFX instalado no micro – Validade de 1 ano
- //Certificado A3 – Móvel – Validade de 3 anos
- Use {para criptografia}
- ACbrDFeSSL
- SSL.SSLCryptLib:=cryWinCrypt;
- //se for A3 - móvel
- SSL.SelecionarCertificado; //abre o gerenciador de certificados para selecionar o certificado
- Configuracoes.certificado.numeroserie:=’’; {para informar o número de série do certificado}
- Configuracoes.certificado.verificarValidade;
- //se for A1 - Fixo
- Configuracoes.certificado.PFX:=’’; {diretório do arquivo PFX + nome do arquivo + .PFX}
- //não esquecer de informar a extensão
- Configuracoes.certificado.senha:=’’; {senha do certificado}
- Configuracoes.certificado.verificarValidade;
- ACBRNF-E
- Notasfiscais[0].Clear; {limpar dados da nota fiscal}
- Notasfiscais[0].Add; {adiciona uma nota fiscal}
- INFORMANDO DADOS DO EMITENTE(EMISSOR)
- Notasfiscais[0].NFe.Emit.xNome:=’RAZAO SOCIAL DO EMITENTE’;
- Notasfiscais[0].NFe.Emit.xFant:=’NOME FANTASIA DO EMITENTE’;
- Notasfiscais[0].NFe.Emit.CNPJCPF:=’00.000.000/0001-00’;
- Notasfiscais[0].NFe.Emit.IE:=’0000000000’;
- Notasfiscais[0].NFe.Emit.IM:=’0000000000’;
- Notasfiscais[0].NFe.Emit.CNAE:=’9999’;
- Notasfiscais[0].NFe.Emit.CRT:= crtSimplesNacional; {crtRegimeNormal};
- Notasfiscais[0].NFe.Emit.EnderEmit.xLgr:=’RUA SETE DE SETEMBRO’;
- Notasfiscais[0].NFe.Emit.EnderEmit.nro:=’1451’;
- Notasfiscais[0].NFe.Emit.EnderEmit.xCpl:=’SALA B’;
- Notasfiscais[0].NFe.Emit.EnderEmit.xBairro:=’BAIRRO JD. DO SOFTWARE’;
- Notasfiscais[0].NFe.Emit.EnderEmit.cMun:=0000000;
- Notasfiscais[0].NFe.Emit.EnderEmit.xMun:=’CIDADE’;
- Notasfiscais[0].NFe.Emit.EnderEmit.UF:=’SP’;
- Notasfiscais[0].NFe.Emit.EnderEmit.cUF:=’35’;
- Notasfiscais[0].NFe.Emit.EnderEmit.CEP:=20490000;
- Notasfiscais[0].NFe.Emit.EnderEmit.xPais:=’BRASIL’;
- Notasfiscais[0].NFe.Emit.EnderEmit.cPais:=1058;
- Notasfiscais[0].NFe.Emit.EnderEmit.Fone:=’(19)0000-0000’;
- ACBRNF-E
- INFORMANDO DADOS DO DESTINATÁRIO(CLIENTE)
- Notasfiscais[0].NFe.Dest.CNPJCPF:= ’00.000.000/0001-00’;
- Notasfiscais[0].NFe.Dest.xNome:= ’NOME DO CLIENTE’;
- Notasfiscais[0].NFe.Dest.IM:= ‘’;
- Notasfiscais[0].NFe.Dest.IE:= ‘0000000000’;
- Notasfiscais[0].NFe.Dest.Email:= ‘email_do_cliente@cliente.com.br’;
- Notasfiscais[0].NFe.Dest.EnderDest.xLgr:= ‘RUA CARLOS GOMES’;
- Notasfiscais[0].NFe.Dest.EnderDest.nro:= ‘1541’;
- Notasfiscais[0].NFe.Dest.EnderDest.xCpl:= ‘SALA A’;
- Notasfiscais[0].NFe.Dest.EnderDest.xBairro:= ‘BAIRRO DO CLIENTE’;
- Notasfiscais[0].NFe.Dest.EnderDest.cMun:= 000000;
- Notasfiscais[0].NFe.Dest.EnderDest.xMun:= ‘CIDADE DO CLIENTE’;
- Notasfiscais[0].NFe.Dest.EnderDest.UF:= ‘SP’;
- Notasfiscais[0].NFe.Dest.EnderDest.cUF:= 35;
- Notasfiscais[0].NFe.Dest.EnderDest.CEP:= 20490000;
- Notasfiscais[0].NFe.Dest.EnderDest.indIEDest:= inIsneto; {inContribuinte, inNaoContribuinte}
- ACBRNF-E
- INFORMANDO DADOS DO CABEÇALHO DA NOTA FISCAL (IDENTIFICAÇÃO DA NOTA FISCAL)
- Obs: Não incluir dados com acentos (~^’)
- Notasfiscais[0].NFe.Ide.cUF:= 35;
- Notasfiscais[0].NFe.Ide.cNF:= 1; {código da chave de acesso//dica deixar a raiz do CNPJ}
- Notasfiscais[0].NFe.Ide.natOp:= ‘VENDA DE MERCADORIAS’;
- Notasfiscais[0].NFe.Ide.modelo:= 55;
- Notasfiscais[0].NFe.Ide.serie:= 001;
- Notasfiscais[0].NFe.Ide.nNF:= 1; {número da nota fiscal}
- Notasfiscais[0].NFe.Ide.dEmi:= now; {data de emissão da nota fiscal}
- Notasfiscais[0].NFe.Ide.dSaiEnt:= now; {data de saída/entrada}
- Notasfiscais[0].NFe.Ide.hSaiEnt:= now; {hora de saída/entrada}
- Notasfiscais[0].NFe.Ide.tpNF:= tnSaida; {tipos: tnEntrada/tnSaida}
- Notasfiscais[0].NFe.Ide.idDest:= doInterna; {tipos: doInterna/doInterestadual/doExterior}
- Notasfiscais[0].NFe.Ide.cMunFG:= 54540540; {código do município do Fato Gerador}
- Notasfiscais[0].NFe.Ide.tpImp:= tiRetrato; {tipo de impressão tiRetrato /tiPaisagem}
- Notasfiscais[0].NFe.Ide.tpEmis:= teNormal; {tipo de emissão }
- Notasfiscais[0].NFe.Ide.tpAmb:= taHomologacao; {tipo de ambiente Homolog/Produção}
- Notasfiscais[0].NFe.Ide.finNFe:= fnNormal; {finalidade da emissão: fnNormal/fnDevolução... }
- Notasfiscais[0].NFe.Ide.indFianl:= cfSim; { Consumidor final}
- Notasfiscais[0].NFe.Ide.indPres:= pcNao; { indicador presença cliente pcPresencial,pcInternet }
- Notasfiscais[0].NFe.Ide.procEmi:= peAplicativoContribuinte; { forma do processo de emissão}
- Notasfiscais[0].NFe.Ide.procEmi:= ‘1.0.0’; { versão aplicativo de emissão}
- ACBRNF-E
- INFORMANDO DADOS DO PRODUTO
- Obs: Não incluir dados com acentos (~^’)
- Notasfiscais[0].NFe.Det.Clear; { limpa itens de produtos da nota fiscal}
- Notasfiscais[0].NFe.Det.Add; { adiciona item de prod. na nota fiscal}//comando está obsoleto
- Notasfiscais[0].NFe.Det.New; { adiciona item de prod. na nota fiscal}
- Notasfiscais[0].NFe.Det.[0].Prod.cProd:=’001’;
- Notasfiscais[0].NFe.Det.[0].Prod.nItem:=1;
- Notasfiscais[0].NFe.Det.[0].Prod.cEAN:=’SEM GTIN’; {este campo não é obrigatório}
- Notasfiscais[0].NFe.Det.[0].Prod.xProd:=’NOME DO PRODUTO’;
- Notasfiscais[0].NFe.Det.[0].Prod.NCM:=’021031031’; {NCM DO PRODUTO}
- Notasfiscais[0].NFe.Det.[0].Prod.CFOP:=’5102’; {CFOP DA OPERAÇÃO}
- Notasfiscais[0].NFe.Det.[0].Prod.uCom:=’UN’; {Unidade de medida do produto}
- Notasfiscais[0].NFe.Det.[0].Prod.qCom:=100; {quantidade vendida do produto}
- Notasfiscais[0].NFe.Det.[0].Prod.vUnCom:=10; {valor unitário do produtos}
- Notasfiscais[0].NFe.Det.[0].Prod.vProd:=1000; {valor total = quantia x valor do produto}
- Notasfiscais[0].NFe.Det.[0].Prod.uTrib:=’UN’; {Unidade de medida tributada}
- Notasfiscais[0].NFe.Det.[0].Prod.qTrib:=1; {Quantidade tributada}
- Notasfiscais[0].NFe.Det.[0].Prod.vUnTrib:=10; {valor unitário tributado}
- Notasfiscais[0].NFe.Det.[0].Prod.cEANTrib:=’SEM GTIN’; {este campo não é obrigatório}
- ACBRNF-E
- INFORMANDO FORMAS DE PAGAMENTO
- Notasfiscais[0].NFe.pag.Clear; { limpa as formas de pagamentos da nota fiscal}
- Notasfiscais[0].NFe.pag.Add; {Adiciona forma de pagamento da nota fiscal}
- //exemplo no dinheiro
- Notasfiscais[0].NFe.pag[0].indPag:=ipVista; {indicador de pagamento: ipVista/ipPrazo }
- Notasfiscais[0].NFe.pag[0].tPag:=fpDinheiro; {forma de pagto: ipDinheiro/ipCartaoCredito}
- Notasfiscais[0].NFe.pag[0].vPag:=10; {valor do pagamento}
- //exemplo no Cartão Débito
- Notasfiscais[0].NFe.pag[0].indPag:=ipVista; {indicador de pagamento: ipVista/ipPrazo }
- Notasfiscais[0].NFe.pag[0].tPag:=fpCartaoDebito; {forma de pagto}
- Notasfiscais[0].NFe.pag[0].vPag:=10; {valor do pagamento}
- Notasfiscais[0].NFe.pag[0].tpIntegra:= tiIntegrado; {tiIntegrado, tinaoIntegrado, tiNaoInformado}//tipo de integração com máquina de cartão
- Notasfiscais[0].NFe.pag[0].tBand:=bcVisa; {bandeira do cartão: bcVisa, bcMastercard }
- Notasfiscais[0].NFe.pag[0].cAut:=’054035’; { código da autorização – nsu do cartão }
- Notasfiscais[0].NFe.pag[0].CNPJ:=’ 00.000.000/0001-00’; {CNPJ da administradora }
- //exemplo no boleto bancario
- Notasfiscais[0].NFe.pag[0].indPag:=ipPrazo; {indicador de pagamento: ipVista/ipPrazo }
- Notasfiscais[0].NFe.pag[0].tPag:=fpBoletoBancario; {forma de pagto: ipDinheiro/ipCartaoCredito/ ipBoletoBancario }
- Notasfiscais[0].NFe.pag[0].vPag:=10; {valor do pagamento}
- ACBRNF-E
- INFORMANDO FRETE
- Notasfiscais[0].NFe.Transp.modFrete:=mfSemFrete; {Tipo do frete: mfProprioDestinatario, mfContaTerceiros}
- // Notasfiscais[0].NFe.Transp.retTransp {impostos sobre o transporte}
- //Notasfiscais[0].NFe.Transp.veicTransp.placa:=’XXX-0099’ {placa do veículo do transporte}
- //Notasfiscais[0].NFe.Transp.veicTransp.uf:=’SP’ {UF do veículo do transporte}
- //Notasfiscais[0].NFe.Transp.Vol.Add {Adiciona volumes}
- ACBRNF-E
- INFORMANDO ICMS
- //para CST = Regime Normal
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.origem:=oeNacional; {origem da mercadoria}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.CST:=cst00; {código CST}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.modBC:=dbiValorOperacao; {modal. base de cálculo}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.vBC:=10; {valor da base de cálculo}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.pICMS:=18; {Alíquota de ICMS}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.vICMS:=1.8; {Valor do ICMS}
- //para CSOSN = Simples Nacional
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.origem:=oeNacional; {origem da mercadoria}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.CSOSN:=csosn101; {código CSOSN}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.pCredSN:=18; { Alíquota de ICMS }
- //para casos com ST = incluir o campo CEST do produto
- Notasfiscais[0].NFe.Det[0].Prod.CEST=’11212128’; { código do CEST do produto }
- ACBRNF-E
- INFORMANDO FUNDO DE COMBATE A POBREZA
- //FCP sem Substituição Tributária
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.pFCP:=2; {Aliquota do FCP}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.vFCP:=0.20; {Valor do FCP}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMSTot.vFCP:=0.20; {Valor total do FCP}
- //FCP com Substituição Tributária
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.pFCP:=0; {Aliquota do FCP}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.vFCP:=0; {Valor do FCP}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.vBCFCP:=0; {Valor Base Cálculo do FCP}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMSTot.vFCP:=0; {Valor do FCP}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.vBCFCPST:=20; {Valor Base Cálculo do FCP ST}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.pFCPST:=2; { Aliquota do FCP ST}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMS.vFCPST:=0.40; { Valor do FCP ST}
- Notasfiscais[0].NFe.Det[0].Imposto.ICMSTot.vFCPST:=0.40; {Valor total do FCPST}
- //exibir as informações sobre o FCP na nota fiscal
- Habilitar Propriedade ExibirBandInfoAdicProduto:=true; //no componente ACBrNFeDanfe
- Notasfiscais[0].NFe.Det[0].InfAdProd:=’Base Calculo FCP: 10 – Valor FCP: 0,20’; {informações adicionais do produto sobre Valor do FCP}
- Notasfiscais[0].NFe.InfAdic.InfAdFisco:=’Total Base Calculo FCP: 10 – Valor FCP: 0,20’; {informações adicionais do fisco sobre Valor do FCP}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement