Nfce - RS
Moderador: Moderadores
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Nfce - RS
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- Itamar M. Lins Jr.
- Administrador

- Mensagens: 7928
- Registrado em: 30 Mai 2007 11:31
- Localização: Ilheus Bahia
- Curtiu: 1 vez
Nfce - RS
Olá!
Produção também está errado para NFCe.
Servidores de NFCe do RS começam com NFCe.
Saudações,
Itamar M. Lins Jr.
Produção também está errado para NFCe.
Servidores de NFCe do RS começam com NFCe.
Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Itamar M. Lins Jr.
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Nfce - RS
Aproveitando...
Itamar, acho que você está com versão bem antiga dos fontes.
A configuração, na grande parte, tá em CH há alguns anos.
https://github.com/JoseQuintas/sefazcla ... azclass.ch
O que diferencia consumidor ou não é cNFCE contendo "S" ou "N"
Itamar, acho que você está com versão bem antiga dos fontes.
A configuração, na grande parte, tá em CH há alguns anos.
https://github.com/JoseQuintas/sefazcla ... azclass.ch
O que diferencia consumidor ou não é cNFCE contendo "S" ou "N"
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- Itamar M. Lins Jr.
- Administrador

- Mensagens: 7928
- Registrado em: 30 Mai 2007 11:31
- Localização: Ilheus Bahia
- Curtiu: 1 vez
Nfce - RS
Olá!
No Git está assim:
Arquivo, ze_sefazdanfce.prg
Saudações,
Itamar M. Lins Jr.
No Git está assim:
Código: Selecionar todos
METHOD ConsultaChaveAcesso() CLASS hbNFeDaNFCe
LOCAL cUF, cUFList, cUrl
// DIVISAO IV - Informacoes da consulta via chave de acesso -------------------------------------------------------------------
cUFList := "AC,12,AL,27,AM,13,AP,16,BA,29,CE,23,DF,53,ES,32,GO,52,MG,31,MS,50,MT,51,MA,21,PA,15,PB,25,PE,26,PI,22,PR,41,RJ,33,RO,11,RN,24,RR,14,RS,43,SC,42,SE,28,SP,35,TO,17,"
cUF := Substr( cUFList, At( ::aIde[ "cUF" ], cUFList ) - 3, 2 )
// Fonte: http://nfce.encat.org/consumidor/consulte-sua-nota/
IF ::aIde[ "tpAmb" ] == WS_AMBIENTE_PRODUCAO
DO CASE
CASE cUF == "AC" ; cUrl := "www.sefaznet.ac.gov.br/nfce/consulta"
CASE cUF == "AL" ; cUrl := "http://nfce.sefaz.al.gov.br/consultaNFCe.htm"
CASE cUF == "AP" ; cUrl := "https://www.sefaz.ap.gov.br/sate/seg/SEGf_AcessarFuncao.jsp?cdFuncao=FIS_1261"
CASE cUF == "AM" ; cUrl := "sistemas.sefaz.am.gov.br/nfceweb/formConsulta.do"
CASE cUF == "BA" ; cUrl := "nfe.sefaz.ba.gov.br/servicos/nfce/default.aspx"
CASE cUF == "CE" ; cUrl := ""
CASE cUF == "DF" ; cUrl := "http://dec.fazenda.df.gov.br/NFCE/"
CASE cUF == "ES" ; cUrl := "http://app.sefaz.es.gov.br/ConsultaNFCe"
CASE cUF == "GO" ; cUrl := ""
CASE cUF == "MA" ; cUrl := "http://www.nfce.sefaz.ma.gov.br/portal/consultaNFe.do?method=preFilterCupom&"
CASE cUF == "MT" ; cUrl := "http://www.sefaz.mt.gov.br/nfce/consultanfce"
CASE cUF == "MS" ; cUrl := "http://www.dfe.ms.gov.br/nfce"
CASE cUF == "MG" ; cUrl := ""
CASE cUF == "PA" ; cUrl := "https://appnfc.sefa.pa.gov.br/portal/view/consultas/nfce/consultanfce.seam"
CASE cUF == "PB" ; cUrl := "www.receita.pb.gov.br/nfce"
CASE cUF == "PR" ; cUrl := "http://www.fazenda.pr.gov.br"
CASE cUF == "PE" ; cUrl := ""
CASE cUF == "PI" ; cUrl := "http://webas.sefaz.pi.gov.br/nfceweb/consultarNFCe.jsf"
CASE cUF == "RJ" ; cUrl := "www.nfce.fazenda.rj.gov.br/consulta"
CASE cUF == "RN" ; cUrl := "http://nfce.set.rn.gov.br/consultarNFCe.aspx"
CASE cUF == "RS" ; cUrl := "https://www.sefaz.rs.gov.br/NFCE/NFCE-COM.aspx"
CASE cUF == "RO" ; cUrl := "http://www.nfce.sefin.ro.gov.br"
CASE cUF == "RR" ; cUrl := "https://www.sefaz.rr.gov.br/nfce/servlet/wp_consulta_nfce"
CASE cUF == "SC" ; cUrl := ""
CASE cUF == "SP" ; cUrl := "https://www.nfce.fazenda.sp.gov.br/NFCeConsultaPublica/Paginas/ConsultaPublica.aspx"
CASE cUF == "SE" ; cUrl := "http://www.nfce.se.gov.br/portal/portalNoticias.jsp"
CASE cUF == "TO" ; cUrl := ""
ENDCASE
ELSE
DO CASE
CASE cUF == "AC" ; cUrl := "http://hml.sefaznet.ac.gov.br/nfce/consulta"
CASE cUF == "AL" ; cUrl := "http://nfce.sefaz.al.gov.br/consultaNFCe.htm"
CASE cUF == "AP" ; cUrl := "https://www.sefaz.ap.gov.br/sate1/seg/SEGf_AcessarFuncao.jsp?cdFuncao=FIS_1261"
CASE cUF == "AM" ; cUrl := "homnfce.sefaz.am.gov.br/nfceweb/formConsulta.do"
CASE cUF == "BA" ; cUrl := "http://hnfe.sefaz.ba.gov.br/servicos/nfce/default.aspx"
CASE cUF == "CE" ; cUrl := "http://nfceh.sefaz.ce.gov.br/pages/consultaNota.jsf"
CASE cUF == "DF" ; cUrl := "http://dec.fazenda.df.gov.br/NFCE/"
CASE cUF == "ES" ; cUrl := "http://homologacao.sefaz.es.gov.br/ConsultaNFCe"
CASE cUF == "GO" ; cUrl := ""
CASE cUF == "MA" ; cUrl := "http://www.hom.nfce.sefaz.ma.gov.br/portal/consultarNFCe.jsp"
CASE cUF == "MT" ; cUrl := "http://homologacao.sefaz.mt.gov.br/nfce/consultanfce"
CASE cUF == "MS" ; cUrl := "http://www.dfe.ms.gov.br/nfce"
CASE cUF == "MG" ; cUrl := ""
CASE cUF == "PA" ; cUrl := "https://appnfc.sefa.pa.gov.br/portal-homologacao/view/consultas/nfce/consultanfce.seam"
CASE cUF == "PB" ; cUrl := ""
CASE cUF == "PR" ; cUrl := "http://www.fazenda.pr.gov.br"
CASE cUF == "PE" ; cUrl := ""
CASE cUF == "PI" ; cUrl := "http://webas.sefaz.pi.gov.br/nfceweb-homologacao/consultarNFCe.jsf"
CASE cUF == "RJ" ; cUrl := "www.nfce.fazenda.rj.gov.br/consulta"
CASE cUF == "RN" ; cUrl := "http://nfce.set.rn.gov.br/consultarNFCe.aspx"
CASE cUF == "RS" ; cUrl := "https://www.sefaz.rs.gov.br/NFCE/NFCE-COM.aspx"
CASE cUF == "RO" ; cUrl := "http://www.nfce.sefin.ro.gov.br"
CASE cUF == "RR" ; cUrl := "http://200.174.88.103:8080/nfce/servlet/wp_consulta_nfce"
CASE cUF == "SC" ; cUrl := ""
CASE cUF == "SP" ; cUrl := "https://www.
homologacao.nfce.fazenda.sp.gov.br/NFCeConsultaPublica/Paginas/ConsultaPublica.aspx"
CASE cUF == "SE" ; cUrl := "http://www.hom.nfe.se.gov.br/portal/portalNoticias.jsp"
CASE cUF == "TO" ; cUrl := ""
ENDCASE
ENDIF
::DrawTexto( 6, ::nLinhaPDF - 10, 220, NIL, "Consulte pela Chave de Acesso em:", HPDF_TALIGN_CENTER, ::oPDFFontNormal, 7 )
IF Len( cUrl ) <= 69
Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Itamar M. Lins Jr.
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Nfce - RS
Isso é para o PDF, não tem a ver com a autorização.
Mas poderia ser movido para o CH geral....
Mas poderia ser movido para o CH geral....
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Nfce - RS
Mestre, help-me.
Pelo que vc postou deveria informar que é nfce, fiz assim e não envia. O que estou fazendo de errado?
Pelo que vc postou deveria informar que é nfce, fiz assim e não envia. O que estou fazendo de errado?
Código: Selecionar todos
Static Procedure fNfeAssinar(oArq, cId, cNf)
Local oSefaz:= SefazClass():New(), cNfeXml:= hb_MemoRead(oArq)
If !Empty(GetProperty([Form_GNFEXML], [p_Certificado], [Value]))
oSefaz:cCertificado:= Alltrim(GetProperty([Form_GNFEXML], [p_Certificado], [Value]))
Else
oSefaz:cCertificado:= Alltrim(parametrosiniciais->cerdanfe)
Endif
oSefaz:cVersao := [4.00]
oSefaz:cAmbiente := Str(parametrosiniciais->TPANFE, 1)
oSefaz:cNFCE := [S]
oSefaz:NFeLoteEnvia(cNfeXml, [1], Alltrim(parametrosiniciais->Estado))
Inkey(.7)
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Nfce - RS
Pergunta vaga, qual o retorno?malcarli escreveu:Pelo que vc postou deveria informar que é nfce, fiz assim e não envia. O que estou fazendo de errado?
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- Itamar M. Lins Jr.
- Administrador

- Mensagens: 7928
- Registrado em: 30 Mai 2007 11:31
- Localização: Ilheus Bahia
- Curtiu: 1 vez
Nfce - RS
Olá!
Ai, já passou o primeiro problema.
Mude para síncrono o envio.
Está dizendo que vai mandar várias NFCe, e só manda 1 NFCe.
Saudações,
Itamar M. Lins Jr.
Ai, já passou o primeiro problema.
Mude para síncrono o envio.
Está dizendo que vai mandar várias NFCe, e só manda 1 NFCe.
Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Itamar M. Lins Jr.
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Nfce - RS
Não, aí sim é o problema.Itamar M. Lins Jr. escreveu:Ai, já passou o primeiro problema.
Mude para síncrono o envio.
Está dizendo que vai mandar várias NFCe, e só manda 1 NFCe.
Preciso verificar na sefazclass sobre essa mudança.
Antigamente só existia o modo assíncrono, que é enviar notas e mais tarde pegar resposta.
Depois fizeram esse síncrono, de enviar e já pegar a resposta na hora, mas ficou opcional, talvez muitas UFs nem tenham implementado.
Pela mensagem, agora no RS ficou o síncrono pra uma nota, e assíncrono pra várias notas.
Talvez seja só pra NF Consumidor.
Agora sim, vou ter que verificar a classe, porque não lembro se está preparada pra isso.
E pelo jeito, pode ser que vá alguma indicação no XML.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- Itamar M. Lins Jr.
- Administrador

- Mensagens: 7928
- Registrado em: 30 Mai 2007 11:31
- Localização: Ilheus Bahia
- Curtiu: 1 vez
Nfce - RS
Olá!
Já passei por isso.
No ACBrMonitor em 2021.
Itamar M. Lins Jr.
Já passei por isso.
No ACBrMonitor em 2021.
Para o ambiente de homologação, esta validação e consequente rejeição da NFCe já está em vigor desde 01/07/2021 e entrará em produção em 01/09/2021.
Saudações,//-------------------------------- Exemplo ACBrMonitorPLUS --------------------------------------//
Parâmetros:
cArqXML - Caminho do arquivo XML a ser enviado.
nLote - Número do Lote
bAssina - Coloque 0 se não quiser que o componente assine o arquivo. - Parâmetro Opcional
nImprime - Coloque 1 se quiser que o DANFe seja impresso logo após a autorização - Parâmetro Opcional
cImpressora - Informe o nome da impressora - Parâmetro Opcional
bSincrono- Coloque 1 para indicar modo síncrono e 0 para modo assíncrono. // <---------- AQUI -----------
bValidaXML- Coloque 1 para Validar e 0 para não Validar. - Parâmetro Opcional
bGerarNovoXML- Coloque 1 para Gerar um novo XML para envio e 0 para não Gerar. - Parâmetro Opcional
NFE.ENVIARNFE("c:\35XXXXXXXXXXXXXXXX550010000000050000000058-nfe.xml",1,1,0,,1)
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Itamar M. Lins Jr.
- Itamar M. Lins Jr.
- Administrador

- Mensagens: 7928
- Registrado em: 30 Mai 2007 11:31
- Localização: Ilheus Bahia
- Curtiu: 1 vez
Nfce - RS
Olá!
Quinta entendi que é uma TAG <indSinc>1<indSinc>
https://pt.stackoverflow.com/questions/ ... o-da-sefaz

Saudações,
Itamar M. Lins Jr.
Quinta entendi que é uma TAG <indSinc>1<indSinc>
Código: Selecionar todos
-<enviNFe versao=”3.10″ xmlns=”http://www.portalfiscal.inf.br/nfe”>
<idLote>1</idLote>
<indSinc>1</indSinc>

No caso NFCe é indSinc 1 mesmo.A variável $indSinc estava setada com valor '1', ou seja SERVIÇO SÍNCRONO, bastando então alterar para '0'.
Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Itamar M. Lins Jr.
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Nfce - RS
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Nfce - RS
Resolvido, eis a solução abaixo:
Código: Selecionar todos
Static Procedure fNfeAssinar(oArq, cId, cNf)
Local oSefaz:= SefazClass():New(), cNfeXml:= hb_MemoRead(oArq)
If !Empty(GetProperty([Form_GNFEXML], [p_Certificado], [Value]))
oSefaz:cCertificado:= Alltrim(GetProperty([Form_GNFEXML], [p_Certificado], [Value]))
Else
oSefaz:cCertificado:= Alltrim(parametrosiniciais->cerdanfe)
Endif
oSefaz:cVersao := [4.00]
oSefaz:cAmbiente := Str(parametrosiniciais->TPANFE, 1)
If parametrosiniciais->modnfe == [65]
oSefaz:cNFCE := [S]
oSefaz:cIndSinc:= [1]
Endif
oSefaz:NFeLoteEnvia(cNfeXml, [1], Alltrim(parametrosiniciais->Estado))
Inkey(.7)
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Nfce - RS
Síncrono e assíncrono, a diferença é ter a resposta na hora, ou apenas enviar e pegar a resposta depois.
Lógico.... desde o começo sempre foi pegar a resposta depois.
Quando inventaram a opção ainda precisava que as UFs modificassem seus sistemas.
Pelo jeito, no RS se for somente uma nota fiscal, ela obriga que seja com resposta na hora, e pelo jeito, somente nota consumidor.
É como eu sempre disse sobre essa coisa toda: apesar do projeto ser padrão, cada UF pode ter alguma coisa particular diferente das outras.
Procurei deixar a classe flexível, pra não causar dependência de versão nova.
É por isso que continua a mesma há alguns anos.
Lembrando: como EU só uso pra São Paulo, só tenho clientes de São Paulo, pras outras UFs a particularidade só aparece quando alguém usa pela primeira vez - se tiver particularidade.
Lógico.... desde o começo sempre foi pegar a resposta depois.
Quando inventaram a opção ainda precisava que as UFs modificassem seus sistemas.
Pelo jeito, no RS se for somente uma nota fiscal, ela obriga que seja com resposta na hora, e pelo jeito, somente nota consumidor.
É como eu sempre disse sobre essa coisa toda: apesar do projeto ser padrão, cada UF pode ter alguma coisa particular diferente das outras.
Procurei deixar a classe flexível, pra não causar dependência de versão nova.
É por isso que continua a mesma há alguns anos.
Lembrando: como EU só uso pra São Paulo, só tenho clientes de São Paulo, pras outras UFs a particularidade só aparece quando alguém usa pela primeira vez - se tiver particularidade.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
