marcioe Posted January 27, 2016 Report Share Posted January 27, 2016 Amigos, alguem já usou a dll do site fsist para baixar arquivos xml tanto de NFe quanto de Cte o site é esse http://www.fsist.com.br/ link para as dll nfe http://www.fsist.com.br/DownloadXMLNFeDesktop.zip Cte http://www.fsist.com.br/DownloadXMLCTeDesktop.zip Se sim por favor postem exemplos Quote Link to comment Share on other sites More sharing options...
aokisantos Posted January 27, 2016 Report Share Posted January 27, 2016 Amigo, usamos a muito tempo e funciona perfeitamente. O suporte do Fernando é sensacional. Quote Link to comment Share on other sites More sharing options...
marcioe Posted January 27, 2016 Author Report Share Posted January 27, 2016 olá amigo, aokisantosSe puder postar o source de como é Feito !Creio que ajudaria muito outros colegas aqui deste forum Obrigado. Quote Link to comment Share on other sites More sharing options...
aokisantos Posted January 27, 2016 Report Share Posted January 27, 2016 Espero que possa ajudar os amigos do forum, como disse o suporte do Fernando é muito bom, vale muito a pena comprar a DLL. #include 'fivewin.ch' #include 'hbdll.ch' static s_hDLL, s_cSistema, s_cTituloMensagem /******************************************************************************/ procedure DownloadNFe( cChave, cPasta, cSerie ) local oDialog, oIcone, oFonte, hInput := HB_Hash() local cCaptcha := Space( 6 ) local lSemParametros := Empty( PCount() ) if lSemParametros cChave := Space( 44 ) cPasta := m->cDiretorioXML cSerie := m->cCertificado endif define font oFonte name 'Arial' size 6, 16 bold define icon oIcone resource 'MAINSG' define dialog oDialog title 'Download XML - NFe' from 0, 0 to 164, 565 pixel font oFonte icon oIcone @ 7, 112 say 'Chave:' of oDialog pixel @ 34, 112 say 'Captcha:' of oDialog pixel @ 16, 112 get hInput['Chave'] var cChave of oDialog pixel size 165, 13 picture '@9' Valid ValidaChaveConsulta( cChave ) @ 43, 112 get hInput['Captcha'] var cCaptcha of oDialog pixel size 34, 13 picture '@!' @ 8, 4 image hInput['Imagem'] of oDialog pixel size 104, 48 adjust @ 64, 174 button '&Baixar' of oDialog pixel size 45, 12 action XmlDownload( hInput, cPasta, cSerie, oDialog, lSemParametros ) @ 64, 226 button '&Sair' of oDialog pixel size 45, 12 action oDialog:End() cancel @ 64, 4 button '&Atualizar Captcha' of oDialog pixel size 64, 12 action AtualizaCaptcha( hInput, oDialog ) oDialog:lHelpIcon := .f. activate dialog oDialog centered on init ( IIf( lSemParametros,, hInput['Chave']:disable() ), ; AtualizaCaptcha( hInput, oDialog ) ) oIcone:end() oFonte:end() return /******************************************************************************/ static function ValidaChaveConsulta( cChave ) /* */ if !ValidaChaveDaNFE( cChave ) return .f. endif if !ValidaDVNfe(cChave) return(.f.) endif return(.t.) /******************************************************************************/ function CarregaDLLDownloadNFe( cSistema ) local oPulsante if s_cTituloMensagem == nil if HB_IsString( cSistema ) s_cSistema := cSistema s_cTituloMensagem := cSistema else s_cTituloMensagem := 'Aviso do Sistema' endif endif if s_hDLL == nil if !File( 'BaixarXMLNFe.dll' ) MsgStop( 'Arquivo não encontrado: BaixarXMLNFe.dll' + CRLF + 'Verifique!', s_cTituloMensagem ) return .f. endif oPulsante := TPul():new( 'Aguarde.' + CRLF + 'Carregando e registrando DLL...' ) s_hDLL := LoadLibrary( 'BaixarXMLNFe.dll' ) DllRegistra() DllLicenca( "LICENSA FERNANDO" ) // Fornecido por: Fernando (fsist.com.br) oPulsante:end() endif return .t. /******************************************************************************/ procedure SetProxyDownloadNFe( lProxy, cIP, nPorta, cUsuario, cSenha ) if lProxy Proxy( cIP, nPorta, cUsuario, cSenha ) else Proxy( '', 0, '', '' ) endif return /******************************************************************************/ procedure FinalizaDLLDownloadNFe() if !Empty( s_hDLL ) FreeLib32( s_hDLL ) s_hDLL := nil endif return /******************************************************************************/ static procedure XmlDownload( hInput, cPasta, cSerie, oDialog, lSemParametros ) local cChave := AllTrim( hInput['Chave' ]:value() ) local cCaptcha := AllTrim( hInput['Captcha']:value() ) local cArquivoXML := cPasta + '\' + cChave + '.xml' local bDownload, nRetorno, nErro, cErro if Len( cChave ) < 44 MsgStop( 'Chave tem que ter 44 digitos!', s_cTituloMensagem ) hInput['Chave']:setFocus() return endif if Len( cCaptcha ) < 6 MsgStop( 'Favor informar o captcha corretamente!', s_cTituloMensagem ) hInput['Captcha']:setFocus() return endif if Empty( cSerie ) bDownload := { || nRetorno := BaixarXMLNFeSemCert( cChave, cCaptcha, cArquivoXML ) } else bDownload := { || nRetorno := BaixarXMLNFeComCert( cChave, cCaptcha, cArquivoXML ) } endif SetCertificadoDigital( cSerie ) MsgRun( 'Aguarde! Realizando Download do XML...', s_cSistema, bDownload ) if nRetorno == 1 MsgInfo( 'Download realizado com sucesso! Arquivo gerado:' + CRLF + cArquivoXML, ; 'NF-e ' + IIf( Empty( cSerie ), 'sem', 'com' ) + ' certificado digital' ) if lSemParametros AtualizaCaptcha( hInput, oDialog ) hInput['Chave' ]:cText( Space( 44 ) ) hInput['Captcha']:cText( Space( 6 ) ) hInput['Chave' ]:setFocus() else oDialog:end() endif else nErro := MsgCode() do case case nErro == 1 cErro := 'É necessário digitar a chave da nfe.' case nErro == 2 cErro := 'É necessário digitar o captcha.' case nErro == 3 cErro := 'Código da Imagem inválido. Tente novamente.' case nErro == 4 cErro := 'NF-e INEXISTENTE na base nacional.' otherwise cErro := 'Desconhecido' endcase MsgStop( 'Não foi possível realizar o download do XML!' + CRLF + ; 'Erro ' + AllTrim( Str( nErro ) ) + ': ' + cErro, s_cTituloMensagem ) AtualizaCaptcha( hInput, oDialog ) hInput['Captcha']:cText( Space( 6 ) ) hInput['Captcha']:setFocus() hInput['Captcha']:setPos( 1 ) endif return /******************************************************************************/ static procedure AtualizaCaptcha( hInput, oDialog ) local nRetorno MsgRun( 'Aguarde! Atualizando Captcha...', s_cSistema, { || nRetorno := Captcha( 'Captcha.jpg' ) } ) if nRetorno == 0 // retorna 1 ou 0, 1 é ok MsgStop( 'Não foi possível carregar o captcha!', s_cTituloMensagem ) oDialog:end() else hInput['Imagem']:loadImage( , 'Captcha.jpg' ) hInput['Imagem']:refresh() endif return /******************************************************************************/ DLL32 FUNCTION Captcha(SalvarEm AS STRING) AS LONG PASCAL LIB 'BaixarXMLNFe.dll' DLL32 FUNCTION BaixarXMLNFeSemCert(Chave AS STRING, Captcha AS STRING, SalvarEm AS STRING) AS LONG PASCAL LIB 'BaixarXMLNFe.dll' DLL32 FUNCTION BaixarXMLNFeComCert(Chave AS STRING, Captcha AS STRING, SalvarEm AS STRING) AS LONG PASCAL LIB 'BaixarXMLNFe.dll' DLL32 FUNCTION GetCertificadoDigital() AS LONG PASCAL LIB 'BaixarXMLNFe.dll' DLL32 FUNCTION SetCertificadoDigital(Cert AS STRING) AS LONG PASCAL LIB 'BaixarXMLNFe.dll' DLL32 FUNCTION MsgCode() AS LONG PASCAL LIB 'BaixarXMLNFe.dll' DLL32 FUNCTION DLLRegistra() AS LONG PASCAL LIB 'BaixarXMLNFe.dll' DLL32 FUNCTION DLLLicenca(Chave AS STRING) AS LONG PASCAL LIB 'BaixarXMLNFe.dll' DLL32 FUNCTION Proxy(Host AS STRING, Port AS LONG, User AS STRING, Pass AS STRING) AS LONG PASCAL LIB 'BaixarXMLNFe.dll' frkiko 1 Quote Link to comment Share on other sites More sharing options...
marcioe Posted January 28, 2016 Author Report Share Posted January 28, 2016 show amigo, vou testar, mas será de grande ajuda a todos os amigos do forum.eu preciso tambem para ct-e, mas as rotinas devem ser iguais, só mudando para CT-e.. Mais uma ver obrigado e caso precise de algo estamos de pé e a ordem... Quote Link to comment Share on other sites More sharing options...
kapiaba Posted January 28, 2016 Report Share Posted January 28, 2016 Posso usar esta DLL que está no blog dele para testes? http://fsist.blogspot.com.br/2013/04/dll-para-download-do-xml-da-nfe-nota.html abs. Quote Link to comment Share on other sites More sharing options...
Luiz Fernando Posted January 29, 2016 Report Share Posted January 29, 2016 Amigo, usamos a muito tempo e funciona perfeitamente. O suporte do Fernando é sensacional. Colega eu já passei email pro Fernando a 3 dias e não tive resposta, vc poderia me informar se com a compra da DLL eu posso usar em todos meus cliente, ou teria quem comprar uma para cada cliente. Obrigado Quote Link to comment Share on other sites More sharing options...
aokisantos Posted January 29, 2016 Report Share Posted January 29, 2016 Luiz, até onde sei vai valer para todos seus clientes, tentou neste email: fernando-mm@hotmail.com Quote Link to comment Share on other sites More sharing options...
marcioe Posted January 29, 2016 Author Report Share Posted January 29, 2016 Posta aqui depois fernando a resposta, pois servirá para todos os colegas Quote Link to comment Share on other sites More sharing options...
fladimir Posted January 30, 2016 Report Share Posted January 30, 2016 Segue resposta do Fernando (via e-mail, recebida hoje) Gostaria de saber como funciona e qto custa? A DLL de NFe gera o xml sem certificado digital sem assinatura digital com base na consulta publica de NFe da fazenda http://www.nfe.fazenda.gov.br/portal/consulta.aspx?tipoConsulta=completa&tipoConteudo=XbSeqxE8pl8= ou com com certificado digital com assinatura digital. A licença para uso da DLL de Download de XML de NFe sem limite de downloads com digitação manual de captcha é R$ 350,00 Você poderá baixar as atualizações que eu tiver em até 1 ano sem custo, depois de 1 ano caso deseje atualizar R$ 85,00. O valor da atualização será corrigido proporcionalmente ao valor da DLL. Aqui você pode baixar a DLL de NFE e os exemplos de uso. http://www.fsist.com.br/BaixarXMLNFeDLL.rar A licença para uso da DLL de Download de XML de CTe sem limite de downloads com digitação manual de captcha é R$ 350,00 Você poderá baixar as atualizações que eu tiver em até 1 ano sem custo, depois de 1 ano caso deseje atualizar R$ 85,00. O valor da atualização será corrigido proporcionalmente ao valor da DLL. Aqui você pode baixar a DLL de CTe e os exemplos de uso. Não tenho exemplos de uso em Harbour http://www.fsist.com.br/DownloadXMLCTeDesktop.zip Se eu comprar 1 posso usar nos meus clientes ou é 1 pra cada? Desde que você utilize em seu software não tem limite de maquinas. Vc tem algo a nível de puxar os dados do CPF / CNPJ da web tb? DLL de Consulta de CPF, poderá baixar as atualizações que eu tiver em até 1 ano sem custo. DLL de Consulta de CNPJ, poderá baixar as atualizações que eu tiver em até 1 ano sem custo. Mais não tenho exemplos de uso em Harbour Luiz Fernando 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.