kapiaba Posted September 29, 2015 Report Share Posted September 29, 2015 Alessandro, está dando esta mensagem no RIO GRANDE DO SUL, verifique, porfa: Abs Quote Link to comment Share on other sites More sharing options...
kapiaba Posted September 29, 2015 Report Share Posted September 29, 2015 Resolvido Alessandro: ELSEIF ::cUF == "RS" oActiveXdo:All:Item("cgcmf",0):Value := cCnpj oActiveX:Silent := .T. Abs. Quote Link to comment Share on other sites More sharing options...
aferra Posted September 30, 2015 Report Share Posted September 30, 2015 sites com problemas. AC <- o retorno agora é em pdf AP <- o retorno agora é em pdf DF <- o retorno não consegue pegar os dados GO <- erro (DOS Error -2147352567) WINOLE/1007 (0x80004005): INNERHTML PE <- não consegue pegar o retorno PI <- não consegue pegar o retorno PR <- não acessou o site RR <- retorno sempre dando que não existe SC <- não acessou o site TO <- não acessou o site alguém que manja de html / java e quiser ajudar, estamos precisando rsrsrsrsrs Quote Link to comment Share on other sites More sharing options...
marcioe Posted May 17, 2016 Report Share Posted May 17, 2016 Galera esta rotina nao esta funcionando para MG Sabem se tem FONTE atualizado. Quote Link to comment Share on other sites More sharing options...
aferra Posted May 17, 2016 Report Share Posted May 17, 2016 é a resposta acima com os estado que vale ainda marcio, se alguem que manja de html e souber como pegar os retornos desses estados, é melhor do que a que está por sendo vendida, funciona é menor, porem não é atualizada e vem sem o IE Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 17, 2016 Report Share Posted May 17, 2016 Alessandro, está funcionando, mas agora é via SIARE e ele tem uma pergunta antes do CNPJ e quando você responde, o FDP do Programa do SIARE, apaga o CNPJ informado. Xeiro no kangotyyyyyyy.... kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 17, 2016 Report Share Posted May 17, 2016 O que ferra, é isso aqui: abs. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 17, 2016 Report Share Posted May 17, 2016 Como informar isso ao programa? <option value="2" >Número do CNPJ</option> Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 17, 2016 Report Share Posted May 17, 2016 Unnhhhaaaa... assim funcionou. ELSEIF ::cUF == "MG" oActiveXdo:All:Item("identificadorCmbOpcao",0):Value := 2 //"Número do CNPJ" oActiveXdo:All:Item("filtro",0):Value := cCnpj oActiveXdo:All:Item("recaptcha_response_field",0):Focus() Alessandro, eu acho que a minha versao(que e sua) ta melhor que a sua. kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk aferra 1 Quote Link to comment Share on other sites More sharing options...
aferra Posted May 17, 2016 Report Share Posted May 17, 2016 hummmm, testando...agora empatados... mas ainda faltando os demais kapiaba 1 Quote Link to comment Share on other sites More sharing options...
marcioe Posted May 19, 2016 Report Share Posted May 19, 2016 amigos, fiz a troca do código conforme indicado, mas mesmo assim ele nao abre correto Coloquei esse código ELSEIF ::cUF == "MG" oActiveXdo:All:Item("identificadorCmbOpcao",0):Value := 2 //"Número do CNPJ" oActiveXdo:All:Item("filtro",0):Value := cCnpj oActiveXdo:All:Item("recaptcha_response_field",0):Focus() Quote Link to comment Share on other sites More sharing options...
aferra Posted May 19, 2016 Report Share Posted May 19, 2016 digite e clique em pesquisa que vai Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 19, 2016 Report Share Posted May 19, 2016 digite e clique em pesquisa que vai Não precisa digitar, passe cCnpj por referencia, digite o Captcha e click em pesquisa que vai. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 19, 2016 Report Share Posted May 19, 2016 Faça um teste assim para entender: // TESTE PARA MINAS GERAIS CNPJ := "16716417000195" CUFFED := [MG] /* CNPJ := CCNPJ //-> aqui vem direto do seu banco dos clientes CUFFED := CCUF */ oSintegra := Sintegra():New() // Aqui, Vir carregado com o CNPJ do Cliente oSintegra:Consulta( CNPJ, CUFFED ) // CNPJ / UF EX: SP Quote Link to comment Share on other sites More sharing options...
marcioe Posted May 19, 2016 Report Share Posted May 19, 2016 Pessoal Estou fazendo assim FUNCTION WEB_SINTEGRA() LOCAL oSintegra := Sintegra():New() cCnpj := '06892990000104' aDados := oSintegra:Consulta(.t.) xBrowse( aDados, "Mostrando os Dados do Retorno" ) Return Quote Link to comment Share on other sites More sharing options...
marcioe Posted May 19, 2016 Report Share Posted May 19, 2016 Fiz assim e ficou 100% Ja aparece o cnpj, porem a combo ele nao troca, mas tá de boa assim. apenas para testar fiz assim e ele retorna o browse com os dados, porem tem como trazer os dados de atividade economica, situação, etc... FUNCTION WEB_SINTEGRA() CNPJ := "06892990000104" CUFFED := [MG] /* CNPJ := CCNPJ //-> aqui vem direto do seu banco dos clientes CUFFED := CCUF */ oSintegra := Sintegra():New() // Aqui, Vir carregado com o CNPJ do Cliente *oSintegra:Consulta( CNPJ, CUFFED ) // CNPJ / UF EX: SP aDados := oSintegra:Consulta(CNPJ, CUFFED,.t.) xBrowse( aDados, "Mostrando os Dados do Retorno" ) Return Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 19, 2016 Report Share Posted May 19, 2016 Não entendi sua pergunta, você se refere as isso? METHOD MontaSintegra() CLASS Sintegra LOCAL cLine, nLine, nTotal LOCAL aRetorno := {}, aRetDbf := {} LOCAL cTexto LOCAL nPos, nPo1 PRIV cSituacao, cResulSit, cResAtivo // Inlcuido em: 21/08/2014 cSintegra := ::cRetorno IF AT( "<!--", cSintegra ) > 0 //Retira Comentários do html WHILE ( nPos := AT( "<!--", cSintegra ) ) > 0 nPo1 := AT( "-->", cSintegra ) cTexto := SUBS( cSintegra, nPos, (nPo1-nPos) + 3 ) cSintegra := STRTRAN( cSintegra, cTexto, "" ) IF EMPTY(cTexto) EXIT ENDIF ENDDO ENDIF cSintegra := STRTRAN( cSintegra, "INFORMAÇÕES COMPLEMENTARES" ) cSintegra := STRTRAN( cSintegra, "ENDEREÇO DA EMPRESA" ) cSintegra := ::StripHTML( cSintegra ) IF ::cUF == "MS" .OR. ::cUF == "SP" .OR. ::cUF == "MG" .OR. ::cUF == "RJ" FErase( "Sintegra.TXT" ) MemoWrit("Sintegra.TXT",cSintegra) oText := TTxtFile():New( "Sintegra.TXT" ) FOR nLine := 1 TO LEN(::aDados[ ::nUF ]) FOR nCtr:=1 TO oText:RecCount() IF ::aDados[ ::nUF,nLine ] $ oText:cLine cLine := SUBS( oText:cLine, AT( ::aDados[ ::nUF,nLine ], oText:cLine ) + LEN(::aDados[ ::nUF,nLine ]) ) AADD( aRetorno, { nLine, ALLTRIM( ::RemoveChar( cLine, {[.],[-],[/],[:]} ) ) } ) ENDIF IF nCtr = 144 cSituacao := oText:cLine ENDIF /* Situação Cadastral Vigente: NÃO HABILITADO Inapto */ IF nCtr = 145 cResulSit := oText:cLine ENDIF IF nCtr = 146 cResAtivo := oText:cLine ENDIF // RIO DE JANEIRO.., QUE DUREZA... VOLTAR AQUI DEPOIS /* IF ::cUF == "RJ" cResulSit := oText:cLine // Situacao cadastral vigente do Rio de Janeiro. IF nCtr = 80 .AND. cResulSit = ALLTRIM( "NÃO HABILITADO" ) cResulSit := oText:cLine //? [80 ], cResulSit, nCtr // TESTE ELSEIF nCtr = 86 .AND. cResulSit = ALLTRIM( "NÃO HABILITADO" ) cResulSit := oText:cLine //? [86 ], cResulSit, nCtr // TESTE ELSEIF nCtr = 80 .AND. cResulSit = ALLTRIM( "HABILITADO" ) cResulSit := oText:cLine ELSEIF nCtr = 86 .AND. cResulSit = ALLTRIM( "HABILITADO" ) cResulSit := oText:cLine ENDIF ENDIF */ oText:Skip() NEXT oText:GoTop() NEXT oText:Close() IF ::cUF == "RJ" // POR ENQUANTO NAO DEU PARA MOSTRAR ELSE // Situação Cadastral Vigente: // incluido em: 21/08/2014 - Bete: Silco. // NÃO HABILITADO // Inapto IF cResulSit = ALLTRIM( "NÃO HABILITADO" ) .AND. ; cResAtivo = ALLTRIM( "Inapto" ) MsgStop( OemToAnsi( "ATEN€ÇO USUµRIO: " )+CRLF+; OemToAnsi( "SITUA€ÇO CADASTRAL VIGENTE NA SEFAZ: " )+CRLF+; OemToAnsi( "CLIENTE NÇO HABILITADO PARA COMPRAR. " )+CRLF+; OemToAnsi( "SINTEGRA RETORNOU QUE ELE ESTµ: INAPTO." )+CRLF+; OemToAnsi( "SIGNIFICA QUE GERARµ: USO DENEGADO. " )+CRLF+; OemToAnsi( "CLIENTE COM RESTRI€åES NA SEFAZ. " )+CRLF+; OemToAnsi( "NADA PODE SER FEITO. NÇO INSISTA. " )+CRLF+; OemToAnsi( "FAVOR DENEGAR A NOTA NO PLENO. " )+CRLF+; OemToAnsi( "TECLE <ENTER> PARA VER DADOS COMPLETOS." ), ; OemToAnsi( "CLIENTE NÇO HABILITADO PARA COMPRAR. " ) ) ELSEIF cResulSit = ALLTRIM( "NÃO HABILITADO" ) .AND. ; cResAtivo = ALLTRIM( "Uso denegado" ) MsgStop( OemToAnsi( "ATEN€ÇO USUµRIO: " )+CRLF+; OemToAnsi( "SITUA€ÇO CADASTRAL VIGENTE NA SEFAZ: " )+CRLF+; OemToAnsi( "CLIENTE NÇO HABILITADO PARA COMPRAR. " )+CRLF+; OemToAnsi( "SINTEGRA RETORNOU: USO DENEGADO. " )+CRLF+; OemToAnsi( "SIGNIFICA QUE GERARµ: USO DENEGADO. " )+CRLF+; OemToAnsi( "CLIENTE COM RESTRI€åES NA SEFAZ. " )+CRLF+; OemToAnsi( "NADA PODE SER FEITO. NÇO INSISTA. " )+CRLF+; OemToAnsi( "FAVOR DENEGAR A NOTA NO PLENO. " )+CRLF+; OemToAnsi( "TECLE <ENTER> PARA VER DADOS COMPLETOS." ), ; OemToAnsi( "CLIENTE NÇO HABILITADO PARA COMPRAR. " ) ) ELSEIF cResulSit = ALLTRIM( "NÃO HABILITADO" ) .AND. ; cResAtivo = ALLTRIM( "Baixado" ) MsgStop( OemToAnsi( "ATEN€ÇO USUµRIO: " )+CRLF+; OemToAnsi( "SITUA€ÇO CADASTRAL VIGENTE NA SEFAZ: " )+CRLF+; OemToAnsi( "CLIENTE NÇO HABILITADO - BAIXADO. . " )+CRLF+; OemToAnsi( "SINTEGRA RETORNOU: BAIXADO. " )+CRLF+; OemToAnsi( "SIGNIFICA QUE ELE PODE COMPRAR. " )+CRLF+; OemToAnsi( "MUDE A INSCRI€ÇO ESTADUAL NO PLENO, " )+CRLF+; OemToAnsi( "PARA: ISENTO. PRESTE ATEN€ÇO: ISENTO." )+CRLF+; OemToAnsi( "CLIENTE SEM RESTRI€åES DE COMPRA. " )+CRLF+; OemToAnsi( "TECLE <ENTER> PARA VER DADOS COMPLETOS." ), ; OemToAnsi( "CLIENTE NÇO HABILITADO - BAIXADO. " ) ) ELSEIF cResulSit = ALLTRIM( "NÃO HABILITADO" ) MsgStop( OemToAnsi( "ATEN€ÇO USUµRIO: " )+CRLF+; OemToAnsi( "SITUA€ÇO CADASTRAL VIGENTE NA SEFAZ: " )+CRLF+; OemToAnsi( "CLIENTE NÇO HABILITADO. " )+CRLF+; OemToAnsi( "SINTEGRA RETORNOU: NÇO HABILITADO. " )+CRLF+; OemToAnsi( "CONSULTE A SUA CONTABILIDADE POR FAVOR." )+CRLF+; OemToAnsi( "MUDE A INSCRI€ÇO ESTADUAL NO PLENO, " )+CRLF+; OemToAnsi( "PARA: ISENTO. PRESTE ATEN€ÇO: ISENTO." )+CRLF+; OemToAnsi( "CONSULTE A SUA CONTABILIDADE POR FAVOR." )+CRLF+; OemToAnsi( "TECLE <ENTER> PARA VER DADOS COMPLETOS." ), ; OemToAnsi( "CLIENTE NÇO HABILITADO - CONTABILIDADE." ) ) ELSE MsgStop( OemToAnsi( "ATEN€ÇO USUµRIO: " )+CRLF+; OemToAnsi( "SITUA€ÇO CADASTRAL VIGENTE NA SEFAZ: " )+CRLF+; OemToAnsi( "CLIENTE HABILITADO - ATIVO. " )+CRLF+; OemToAnsi( "SINTEGRA RETORNOU: HABILITADO - ATIVO. " )+CRLF+; OemToAnsi( "SIGNIFICA QUE ELE PODE COMPRAR. " )+CRLF+; OemToAnsi( "CLIENTE SEM RESTRI€åES DE COMPRA. " )+CRLF+; OemToAnsi( "TECLE <ENTER> PARA VER DADOS COMPLETOS." ), ; OemToAnsi( "CLIENTE HABILITADO - ATIVO. " ) ) ENDIF ENDIF // NAO DEU PARA MOSTRAR O RIO AINDA... cFile := "Sintegra.TXT" IF lBlocoNotas WinExec( "Notepad.exe " + cFile ) ENDIF FErase( "Sintegra.TXT" ) ELSE cSintegra := ::GroupBy( ::aSeekUrl[::nUF,1], ::aSeekUrl[::nUF,2], cSintegra, .F., .F. ) cSintegra := ::RemoveBlankLine( cSintegra ) nTotal := MLCount( cSintegra ) IF ::cUF == "TO" AADD( aRetorno, { 6, " " } ) ENDIF FOR nLine := 1 TO nTotal cLine := ALLTRIM(MEMOLINE(cSintegra,,nLine)) IF ::cUF == "GO" IF ( nFound := ASCAN( ::aDados[ ::nUF ], HB_ATokens( cLine, ":" )[1] ) ) # 0 AADD( aRetorno, { nFound, ALLTRIM( ::RemoveChar( HB_ATokens( cLine, ":" )[2], {[.],[-],[/],[:]} ) ) } ) ENDIF ELSE IF ( nFound := ASCAN(::aDados[ ::nUF ],cLine) ) # 0 IF ::cUF == "MT" IF ::aDados[ ::nUF,nFound ] == "Município/UF:" cTexto := ALLTRIM(MEMOLINE(cSintegra,,++nLine)) cTxtUF := ALLTRIM(HB_ATokens( cTexto, "-" )[2]) AADD( aRetorno, { 9, cTxtUF } ) cTexto := HB_ATokens( cTexto, "-" )[1] ELSE cTexto := ALLTRIM(MEMOLINE(cSintegra,,++nLine)) ENDIF ELSE cTexto := ALLTRIM(MEMOLINE(cSintegra,,++nLine)) ENDIF //Caso não haja a informação IF ASCAN( ::aDados[ ::nUF ],cTexto) # 0 cTexto := " " --nLine ENDIF //para o Caso do RJ IF cTexto == "Data da Concessão da Inscrição:" cTexto := " " --nLine ENDIF IF ASCAN(aRetorno, {|x| x[2] == cTexto} ) == 0 .OR. ASCAN(aRetorno, {|x| x[1] == nFound} ) == 0 AADD( aRetorno, { nFound, ::RemoveChar(cTexto,{[.],[-],[/],[:]}) } ) ENDIF ENDIF ENDIF NEXT nLine ENDIF aRetorno := ASort( aRetorno,,,{|x,y| x[1] < y[1]} ) FOR nCtr:=1 TO LEN(aRetorno) AADD( aRetDbf, aRetorno[nCtr,2] ) NEXT // xBrowse( aRetDbf, "Dados da Consutla do Sinterga") RETURN aRetDbf Quote Link to comment Share on other sites More sharing options...
marcioe Posted May 19, 2016 Report Share Posted May 19, 2016 Olá a Todos A rotina que Lê os dados salvo engano é aqui né METHOD MontaSintegra() CLASS Sintegra LOCAL cLine, nLine, nTotal LOCAL aRetorno := {}, aRetDbf := {} LOCAL cTexto LOCAL nPos, nPo1 cSintegra := ::cRetorno IF AT( "<!--", cSintegra ) > 0 //Retira Comentários do html while ( nPos := AT( "<!--", cSintegra ) ) > 0 nPo1 := AT( "-->", cSintegra ) cTexto := SUBS( cSintegra, nPos, (nPo1-nPos) + 3 ) cSintegra := STRTRAN( cSintegra, cTexto, "" ) IF EMPTY(cTexto) EXIT ENDIF ENDDO ENDIF cSintegra := STRTRAN( cSintegra, "INFORMAÇÕES COMPLEMENTARES" ) cSintegra := STRTRAN( cSintegra, "ENDEREÇO DA EMPRESA" ) cSintegra := ::StripHTML( cSintegra ) IF ::cUF == "MS" MemoWrit("Sintegra.TXT",cSintegra) oText := TTxtFile():New( oClassVar:cPasta + "Sintegra.TXT" ) FOR nLine := 1 TO LEN(::aDados[ ::nUF ]) FOR nCtr:=1 TO oText:RecCount() IF ::aDados[ ::nUF,nLine ] $ oText:cLine cLine := SUBS( oText:cLine, AT( ::aDados[ ::nUF,nLine ], oText:cLine ) + LEN(::aDados[ ::nUF,nLine ]) ) AADD( aRetorno, { nLine, ALLTRIM( ::RemoveChar( cLine, {[.],[-],[/],[:]} ) ) } ) ENDIF oText:Skip() NEXT oText:GoTop() NEXT oText:Close() FErase( oClassVar:cPasta + "Sintegra.TXT" ) ELSE cSintegra := ::GroupBy( ::aSeekUrl[::nUF,1], ::aSeekUrl[::nUF,2], cSintegra, .F., .F. ) cSintegra := ::RemoveBlankLine( cSintegra ) nTotal := MLCount( cSintegra ) IF ::cUF == "TO" AADD( aRetorno, { 6, " " } ) ENDIF FOR nLine := 1 TO nTotal cLine := ALLTRIM(MEMOLINE(cSintegra,,nLine)) IF ::cUF == "GO" IF ( nFound := ASCAN( ::aDados[ ::nUF ], HB_ATokens( cLine, ":" )[1] ) ) # 0 AADD( aRetorno, { nFound, ALLTRIM( ::RemoveChar( HB_ATokens( cLine, ":" )[2], {[.],[-],[/],[:]} ) ) } ) ENDIF ELSE IF ( nFound := ASCAN(::aDados[ ::nUF ],cLine) ) # 0 IF ::cUF == "MT" IF ::aDados[ ::nUF,nFound ] == "Município/UF:" cTexto := ALLTRIM(MEMOLINE(cSintegra,,++nLine)) cTxtUF := ALLTRIM(HB_ATokens( cTexto, "-" )[2]) AADD( aRetorno, { 9, cTxtUF } ) cTexto := HB_ATokens( cTexto, "-" )[1] ELSE cTexto := ALLTRIM(MEMOLINE(cSintegra,,++nLine)) ENDIF ELSE cTexto := ALLTRIM(MEMOLINE(cSintegra,,++nLine)) ENDIF //Caso não haja a informação IF ASCAN( ::aDados[ ::nUF ],cTexto) # 0 cTexto := " " --nLine ENDIF //para o Caso do RJ IF cTexto == "Data da Concessão da Inscrição:" cTexto := " " --nLine ENDIF IF ASCAN(aRetorno, {|x| x[2] == cTexto} ) == 0 .OR. ASCAN(aRetorno, {|x| x[1] == nFound} ) == 0 AADD( aRetorno, { nFound, ::RemoveChar(cTexto,{[.],[-],[/],[:]}) } ) ENDIF ENDIF ENDIF NEXT nLine ENDIF aRetorno := ASort( aRetorno,,,{|x,y| x[1] < y[1]} ) FOR nCtr:=1 TO LEN(aRetorno) AADD( aRetDbf, aRetorno[nCtr,2] ) NEXT RETURN aRetDbf Queria que nesse browse fosse carregados com os dados destacados Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 19, 2016 Report Share Posted May 19, 2016 Eu mostro todos os dados assim: cFile := "Sintegra.TXT" IF lBlocoNotas // .T. WinExec( "Notepad.exe " + cFile ) ENDIF Quote Link to comment Share on other sites More sharing options...
marcioe Posted May 19, 2016 Report Share Posted May 19, 2016 nao entendi.. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 19, 2016 Report Share Posted May 19, 2016 dados destacados, não são os dados do cliente no sintegra? sesim, abra com o Bloco de Notas e entenderá. Eu não gostei dos dados no xBrowse, por isso eu mostro no Bloco de Notas. Se é que eu entendi o que vc. quer. Quote Link to comment Share on other sites More sharing options...
marcioe Posted May 19, 2016 Report Share Posted May 19, 2016 Tá blz 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.