Jump to content
Fivewin Brasil

zekasan

Membros
  • Posts

    146
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by zekasan

  1. Estranho que não funcione para vc, nos meus programas não travam
  2. Uso uma rotina que o Vagner fez faz um tempão TAMANHO_VIDEO:=VRESVIDEO() ? TAMANHO_VIDEO[1],TAMANHO_VIDEO[2] /********************************************************* * Função : Funcao em C para pegar a Resolução da Tela * Data : 13/03/2013 à s 12:05:26 por Vagner * Revisado em : 13/03/2013 à s 12:05:35 por Vagner * Parâmetros : * iWidthNew - Largura Mínima Necessária * iHeightNew - Altura Mínima Necessária **********************************************************/ #Pragma BEGINDUMP #include <Windows.h> #include <ShellApi.h> #include <Wingdi.h> #include <hbapi.h> HB_FUNC (VRESVIDEO) { int iWidth,iHeight ; //Pega a Configuração Atual DEVMODE DeviceMode = { 0 }; EnumDisplaySettings( NULL, ENUM_CURRENT_SETTINGS, &DeviceMode ); iWidth = DeviceMode.dmPelsWidth; iHeight = DeviceMode.dmPelsHeight; hb_reta( 2 ); hb_storni( iWidth , -1, 1 ); hb_storni( iHeight, -1, 2 ); } #pragma ENDDUMP
  3. Bom dia, poderiam me ajudar como verificar se o código de barras de um boleto de arrecadação é válido após sua leitura?? Tem que ser de arrecadação e não boletos bancários. Imensamente Grato.
  4. Bom dia Srs e Sras. Alguém pode me informar onde acho os fontes da rotina do get qdo o mesmo pega um dado tipo data? Preciso alterar a rotina para que qdo seja digitado somente o dia ele complete com o mês e ano corrente e, qdo digitado dia e mês ele pegue o ano corrente. Fico muito agradecido pela colaboração. Uso a versão 1207 ainda.
  5. Boa tarde eu uso assim,eu acho prático, me deram a dica aqui no grupo: Pego os dados "oLloyds:Fields("tSaoCte"):Value" , e neste caso os transfiro para uma planilha "oSheetPr:Cells(4,2):value:=oLloyds:Fields("tSaoCte"):Value" ..... ABRE_SQL() cCmdSql:="select sum(SaoCte) as tSaoCte,sum(SaoVol) as tSaoVol,sum(SaoM3) as tSaoM3,sum(SaoFrete) as tSaoFrete, "+; "sum(RioCte) as tRioCte,sum(RioVol) as tRioVol,sum(RioM3) as tRioM3,sum(RioFrete) as tRioFrete, "+; "sum(BhzCte) as tBhzCte,sum(BhzVol) as tBhzVol,sum(BhzM3) as tBhzM3,sum(BhzFrete) as tBhzFrete "+; "from LLOYDS_CTE "+; "where DtEmissao >= '"+data_sql(c1101)+"' and DtEmissao <= '"+data_sql(c1102)+"'" try oLloyds := oCon:Execute(cCmdSql) catch oErr msginfo( "Erro ao abrir Tabela LLOYDS_CTE","ATENÇÃO" ) return(.f.) end oSheetPr:Cells(4,2):value:=oLloyds:Fields("tSaoCte"):Value oSheetPr:Cells(4,3):value:=oLloyds:Fields("tSaoVol"):Value oSheetPr:Cells(4,4):value:=oLloyds:Fields("tSaoM3"):Value oSheetPr:Cells(4,5):value:=oLloyds:Fields("tSaoFrete"):Value oSheetPr:Cells(5,2):value:=oLloyds:Fields("tRioCte"):Value oSheetPr:Cells(5,3):value:=oLloyds:Fields("tRioVol"):Value oSheetPr:Cells(5,4):value:=oLloyds:Fields("tRioM3"):Value oSheetPr:Cells(5,5):value:=oLloyds:Fields("tRioFrete"):Value oSheetPr:Cells(6,2):value:=oLloyds:Fields("tBhzCte"):Value oSheetPr:Cells(6,3):value:=oLloyds:Fields("tBhzVol"):Value oSheetPr:Cells(6,4):value:=oLloyds:Fields("tBhzM3"):Value oSheetPr:Cells(6,5):value:=oLloyds:Fields("tBhzFrete"):Value ... FECHA_SQL() function ABRE_SQL() * Server = nome do servidor ou seu IP * Database = nome do seu BD * Uid = usuário * Pwd = senha cConnection := "driver={SQL Server};Server=xxx.xxx.xxx.xxx;Database=NONAME;Uid=nonane;Pwd=noname" try oCon:=tOleAuto():new("ADODB.Connection") oCon:Open( cConnection ) CATCH oError MsgInfo( "Problema com a conexão ao banco de dados!" +CRLF+ ; "Error: " + Transform(oError:GenCode, nil) + ";" +CRLF+ ; "SubC: " + Transform(oError:SubCode, nil) + ";" +CRLF+ ; "OSCode: " + Transform(oError:OsCode, nil) + ";" +CRLF+ ; "SubSystem: " + Transform(oError:SubSystem, nil) + ";" +CRLF+ ; "Mensaje: " + oError:Description, "Atenção" ) return(.f.) end return(.t.) function FECHA_SQL() oCon:close() return(.t.)
  6. Precisei algo parecido, caso exista eu atualizo algumas variáveis, caso contrário eu insiro os dados: cCmdSql:="if exists (select usuario from SSW_USUARIO where Usuario = '"+cGet01_S1+"') "+; " begin "+; " update ssw_usuario set "+; " nome = '"+ cGet06_S1 +"',"+; " senha = '"+ cGet02_S1 +"',"+; " nivel = "+ str(cGet05_S1,1)+","+; " email = '"+ cGetEma +"',"+; " emailsenha = '"+ cGetSen +"',"+; " telddd = '"+ cGetDDD +"',"+; " telnr = '"+ cGetTel +"',"+; " telramal = '"+ cGetRam +"'"+; " where usuario = '"+cGet01_S1+"' "+; " end "+; "else "+; " begin "+; " insert into ssw_usuario(filial,usuario,nome,senha,nivel,email,emailsenha,telddd,telnr,telramal) "+; " values( "+; " '"+RET_FILIAL_SSW(cGet04_S1)+"',"+; " '"+cGet01_S1+"',"+; " '"+cGet06_S1+"',"+; " '"+cGet02_S1+"',"+; " "+str(cGet05_S1,1)+","+; " '"+cGetEma+"',"+; " '"+cGetSen+"',"+; " '"+cGetDDD+"',"+; " '"+cGetTel+"',"+; " '"+cGetRam+"')"+; " end"
  7. Muito obrigado, irei implementar
  8. Bom dia, alguma alma nobre pode me ajudar com estas encrenca? Estou procurando exemplo na versão 1207 e não estou achando, alguém tem esta COISA??? Agradeço muito se puderem me ajudar.
  9. COLOQUEI O SEGUINTE do whil .t. try CONDICAO:=oOle:readystate catch exit end syswait(.5) enddo
  10. Preciso que fique em um loop após ser aberta até a janela ser fechada, para dar prosseguimento a uma outra rotina, essa outra rotina será executada assim que esta janela aberta for fechada.
  11. Bom dia, alguém pode me ajudar??? Como fico sabendo se a janela aberta na rotina CreateObject("InternetExplorer.Application"), está aberta??? oOle:= CreateObject("InternetExplorer.Application") oOle:Visible := .t. oOle:ToolBar := .f. oOle:StatusBar := .f. oOle:MenuBar := .f. oOle:Navigate2("https://www.sefaz.rs.gov.br/NFE/NFE-CCC.aspx") hWnd:=oOle:hWnd ShowWindow(hWnd, 1 ) BringWindowToTop(hWnd) While oOle:Busy syswait(.5) End * cCopiar("60157377000504") try oOle1 := oOle:Document() oOle1:getElementById("ctl00_cphConteudo_cmbUF"):value := "35" // 35-> SP oOle1:getElementById("ctl00_cphConteudo_cmbUF"):Focus() oOle1:getElementById("ctl00_cphConteudo_cmbUF"):Click() oOle1:getElementById("tbxCNPJContrib"):value := QUAL_CNPJ catch end do while JANELA_ABERTA???? syswait(??) enddo GRATO
  12. caracas, comeu de novo o caracter colchete, tem quer sre IO:=ARR0+caracter colchete+ I + caracter colchete
  13. agora que vi que comeu uma parte do texto: onde se le IO:=ARR0 deve ser substituído por IO:=ARR0
  14. Boa tarde, eu dei uma mudadinha, retorna um array com os dados FUNCTION PEGA_CNPJ(PROC_CNPJ) Local oServerWS, cUrl, aCNPJ[12] if LEN(PROC_CNPJ)#14 MSGINFO("Este busca não funciona para CPF!") return .t. endif cUrl:= "https://www.receitaws.com.br/v1/cnpj/"+PROC_CNPJ Try oServerWS := CreateObject( 'MSXML2.ServerXMLHTTP.5.0' ) Catch oError try oServerWS := CreateObject( 'MSXML2.ServerXMLHTTP.6.0' ) catch oError try oServerWS := CreateObject("Microsoft.XMLHTTP") catch oError ? e:Description return nil end END end TRY oServerWS:open('GET', cUrl, .f.) oServerWS:setRequestHeader('Content-Type' , 'text/xml; charset=utf-8') // Obtém ou define o valor de cabeçalho de Content-type HTTP. oServerWS:send() CATCH ? "Não conseguiu enviar solicitação para requisição dos dados do CNPJ" return .t. END * Verifica o status do request. Exibe erro se houver IF oServerWS:Status != 200 // OK MsgStop( Alltrim(STR(oServerWS:Status)) +" - "+ oServerWS:StatusText , "Erro") RETURN NIL ENDIF WHILE oServerWS:readyState != 4 oServerWS:waitForResponse(1000) END * decodifica o arquivo json e transforma em um array multidimensional ** x := hb_jsondecode( oServerWS:responseText, @aArray ) txt:= oServerWS:responseText *? txt Arq_1:=ALLTRIM(txt) ARR0:=HB_ATokens( Arq_1, CHR(10) ) *xbrowse(ARR0) TAB:={} QT:=0 n_f1:="" n_f2:="" FOR I=1 TO LEN(ARR0) if substr(ARR0,4,4) = "nome" // REG 1 - Nome I0:=ARR0 I0:=StrTran( I0, "nome" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[1] := alltrim(I0) endif endif if substr(ARR0,4,2) = "uf" // REG 2 - UF I0:=ARR0 I0:=StrTran( I0, "uf" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[2] := alltrim(I0) endif ENDIF if substr(ARR0,4,10) = "logradouro" // REG 3 - LOGRADOURO I0:=ARR0 I0:=StrTran( I0, "logradouro" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[3] := alltrim(I0) endif ENDIF if substr(ARR0,4,6) = "numero" // REG 4 - NÚMERO I0:=ARR0 I0:=StrTran( I0, "numero" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[4] := alltrim(I0) endif ENDIF if substr(ARR0,4,3) = "cep" // REG 5 - CEP I0:=ARR0 I0:=StrTran( I0, "cep" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, "." ) I0:=StrTran( I0, "-" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[5] := transform(alltrim(I0),"@R 99999-999") endif ENDIF if substr(ARR0,4,9) = "municipio" // REG 6 - MUNICÍPIO I0:=ARR0 I0:=StrTran( I0, "municipio" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[6] := alltrim(I0) endif ENDIF if substr(ARR0,4,8) = "abertura" // REG 7 - DT ABERTURA I0:=ARR0 I0:=StrTran( I0, "abertura" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[7] := alltrim(I0) endif ENDIF if substr(ARR0,4,6) = "bairro" // REG 8 - BAIRRO I0:=ARR0 I0:=StrTran( I0, "bairro" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[8] := alltrim(I0) endif ENDIF if substr(ARR0,4,11) = "complemento" // REG 9 - COMPLEMENTO I0:=ARR0 I0:=StrTran( I0, "complemento" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[9] := alltrim(I0) endif ENDIF if substr(ARR0,4,5) = "email" // REG 10 - EMAIL I0:=ARR0 I0:=StrTran( I0, "email" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[10] := alltrim(I0) endif ENDIF if substr(ARR0,4,8) = "telefone" // REG 11 - TELEFONE I0:=ARR0 I0:=StrTran( I0, "telefone" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[11] := alltrim(I0) * IF AT("/",TEL_C)>0 * TEL_C:=ALLTRIM(LEFT(TEL_C,AT("/",TEL_C)-1)) * ENDIF endif ENDIF if substr(ARR0,4,8) = "fantasia" // REG 12 - FANTASIA I0:=ARR0 I0:=StrTran( I0, "fantasia" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[12] := alltrim(I0) endif ENDIF NEXT * xbrowse(aCNPJ) RETURN(aCNPJ)
  15. Boa tarde, alguém pode me ajudar?? Acesso o site, preencho campos e dou o click (via programação, ver abaixo), só que nesta página de retorno não consigo capturar dados. o RETIRA_MASCARA(cCNPJ) apenas retira a pontuação da variável cCNPJ Preciso alguns dados deste retorno para gravar em uma base de dados: [[ msg_retorno ]] [[ documento_pesquisado ]] [[ hora_consulta]] Function PROTESTO() Local hWnd, oOle, cUrl:="http://pesquisaprotesto.com.br/consulta" TRY oOle:= CreateObject("InternetExplorer.Application") oOle:Visible := .t. oOle:ToolBar := .f. oOle:StatusBar := .f. oOle:MenuBar := .f. oOle:Navigate2(cUrl) hWnd:=oOle:hWnd ShowWindow(hWnd, 1 ) BringWindowToTop(hWnd) While oOle:Busy syswait(.5) End CATCH END TRY oOle := oOle:Document() oOle:All:Item("cpf_cnpj",0):Value := RETIRA_MASCARA(cCNPJ) oOle:All:Item("cpf_cnpj",0):Focus() syswait(.5) oOle:All:Item("cpf_cnpj",0):Click() syswait(.5) oOle:All:Item("btEnviarConsulta",0):Focus() oOle:All:Item("btEnviarConsulta",0):Click() While oOle:Busy syswait(.5) End ???? PEGAR DADOS DA PAGINA DE RETORNO DE CONSULTA CATCH END oOle := Nil return(.t.) TRECHO DA PÁGINA DE RETORNO: <div class="row centered retorno" id="msg_retorno" style="display:none"> <div class="column center aligned centered"> <div class="ui large center aligned"> <h2 class="ui header center aligned" v-bind:class="[protestos.length > 0 ? 'red' : 'green']"> [[ msg_retorno ]] </h2> <div class="ui blue button" onclick="$('#actions').modal('show')" v-if="protestos.length > 0 ">Solicitar Certidão</div> </div> </div> </div> <h4 class="ui header row medium centered fluid pesquisa" style="display:none"> <div class="content center aligned"> <div class="sub header huge center aligned"> <b>Documento Pesquisado:</b> [[ documento_pesquisado ]] </div> <div class="sub header huge center aligned"> <b>Data da Pesquisa:</b> [[ data_consulta ]] as [[ hora_consulta]] </div> </div> </h4> GRATO PELA AJUDA
  16. Preciso ir no SEFAZ e fazer download dos xml em que no campo de "transportadora" conste o cnpj da transportadora que trabalho. Baixar as notas que foram destinadas a transporte para nós. Baixar automático usando o certificado A1 da empresa. Existem empresas que prestam este tipo de serviço, a Arquivei por exemplo.
  17. Boa tarde, estou precisando de uma rotina ou gerada em uma lib que me faça o download do xml no sefaz pelo campo da transportadora usando o certificado A1. Preciso baixar as notas que são destinadas a transportadora onde trabalho. Alguém teria algo para fazermos negócio??
  18. SISTEM caiu como uma luva prá mim, ótimo exemplo prá começar a tratar o xml, muito obrigado tb JFAGUIAR
  19. Agradeço muito a ajuda, Deus os abençõem
  20. Boa tarde, tentei um monte de coisa, porém de xml sou crú, preciso de ajuda para pegar informações de um determinado bloco de um xml: ... -<imp> -<ICMS> -<ICMS00> <CST>00</CST> <vBC>50.74</vBC> <pICMS>12.00</pICMS> <vICMS>6.09</vICMS> </ICMS00> </ICMS> <vTotTrib>7.72</vTotTrib> </imp> ... Preciso pegar os valores de vBC, pICMS,vICMS do bloco <imp>, porém há mais blocos que possuem o vBC e cICMS. e tem xml que só possue um valor cd vBC e vICMS. Alguém pode me ajudar?? GRATO teste.xml 35170660157377000180570010005583541105583542-procCTe.xml
  21. Realmente, é o que dá estar em uma rotina e pensar em outra, desculpe aí, rsrs
  22. Ao cadastrar sua senha, adicione alguns dígitos a mais, coloque-os em uma determinada sequência, qdo ler vc pega somente as posiçoes corretas colocando-os na sequência correta.
  23. Márcio, boa tarde. Vc já checou se não é algo 'diferente' que está contido na planilha que está causando o erro? São em todas as planilhas que acontece o erro?
  24. Bom dia Márcio, na rotina de gravação, vc valida o campo, caso ele esteja ok, vc volta a cor original dele. Como o Theotokos disse: oGet:SetColor( CorTexto, CorFundo )
×
×
  • Create New...