Ir para conteúdo
  • Cadastre-se

EduXml

Membros
  • Total de ítens

    21
  • Registro em

  • Última visita

Tudo que EduXml postou

  1. Bom dia existe tantas informações onde se mistura NFe e NFce que ficou uma dúvida: A partir de 1 de outubro somente NFCe(simples ou não) será obrigado a enviar os novos campos(IBS, CBS, etc)? No demo da Acbr ainda continua dando erro de IBS e CBS o problema continua na Sefaz SP ? Desde já agradeço
  2. Opa resolvido, fiz atualização do Acbr funcionou perfeitamente. Muito obrigado a todos
  3. Fiz uma atualização do Acbr no mês 08 , vou fazer novamente e testar.
  4. Boa Tarde tenho essa função para ler os xmls porém sempre quando atinge por volta dos 4000 xmls lidos apresenta error memory allocation failed quando tenta carregar um novo xml. Já tentei colocar o componente AcbrNfce direto na tela também não adiantou. Desde já agradeço qualquer ajuda function TForm2.SomarXmlsNfce(datai, dataf: Tdate; pdv: integer):Boolean; var listadir : TStringList; numeronfc, camxmls : string; i,id : integer; valornfce, valdesconto, acrescimo, valortotal : Currency; ok : Boolean; dataii : Tdate; NFeXml : TACBrNFe; begin try dataii := datai; while dataii <= dataf do begin NFeXml := TACBrNFe.Create(Application); listadir := TStringList.Create; try camxmls := Camexe + '/cfesfisco/' + FormatDateTime('yyyymm', dataii) + '/' + 'sat' + FormatFloat('##000', pdv); try DirList(camxmls + '/*-nfe.xml',listadir); if listadir.Count > 0 then begin valornfce := 0; valdesconto := 0; acrescimo := 0; valortotal := 0; JvSpecialProgress1.Maximum := listadir.Count; for i := 0 to listadir.Count - 1 do begin try JvSpecialProgress1.Position := JvSpecialProgress1.Position + 1; ok := true; try NFeXml.NotasFiscais.Clear; NFeXml.NotasFiscais.LoadFromFile(camxmls + '/' + listadir[i]); except ok := false; end; if ok then begin if ok then begin JvSpecialProgress1.Caption := 'PDV' + FormatFloat('##000', pdv) + ' ' + FormatDateTime('dd/MM/YYYY', dataii) + ' - ' + listadir.Strings[i]; valornfce := NFeXml.NotasFiscais.Items[0].NFe.Total.ICMSTot.vNF; valortotal := valortotal + valornfce; for id := 0 to NFeXml.NotasFiscais.Items[0].NFe.Det.Count - 1 do begin ValDesconto := ValDesconto + NFeXml.NotasFiscais.Items[0].NFe.Det.Items[id].Prod.vDesc; Acrescimo := Acrescimo + NFeXml.NotasFiscais.Items[0].NFe.Total.ICMSTot.vOutro; end; end; end; finally end; end; end; except on E: Exception do ShowMessage('Erro: ' + E.Message ); end; finally FreeAndNil(listadir); FreeAndNil(NFeXml); JvSpecialProgress1.Position := 0; JvSpecialProgress1.Caption := ''; dataii := dataii + 1; end; end; finally end; end;
  5. A solução para a consulta do status do serviço para NFCe foi trocando o certificado para um A1. O outro certificado era um A1 na nuvem para NFe a consulta do status do serviço funciona.
  6. Agora acertei o ncm mas continua o erro, testei no validador do RS 35230656046576000144650010000000011431293461-nfe.xml
  7. Acabei de consultar consta como credenciada
  8. Desde já agradeço. Emissor não habilitado para NFC-e estranho ontem entrei no https://www.nfce.fazenda.sp.gov.br/NFCeSiteContribuinte/Secure/CredenciamentoVoluntario.aspx e fiz o credenciamento. A empresa pode se cadastrar como emissor de Nfe e Nfce ?
  9. 35230656046576000144650010000000011749146431-nfe.xml Sim anexo mas apresenta erro
  10. Boa Tarde Estou tentando emitir uma Nfce em homologação pelo AcbrNfe_Exemplo mas apresenta erro tanto na consulta status como envio, o certificado que estou usando é o que fica em nuvem, para Nfe funciona perfeitamente. Segue abaixo telas dos erros.
  11. Resolvido através do HTTP Segue código abaixo function ObterToken():integer; var HTTPClient: TIdHTTP; SSLIOHandler: TIdSSLIOHandlerSocketOpenSSL; url,json: string; JsonStreamRetorno, JsonStreamEnvio: TStringStream; retorno : integer; begin url := 'https://mtls-mp.hml.flagship.maas.link/auth/realms/Matera/protocol/openid-connect/token'; HTTPClient := TIdHTTP.Create(nil); HTTPClient.Request.CharSet := 'utf-8'; HTTPClient.Request.Accept := '*/*'; HTTPClient.Request.AcceptEncoding := 'gzip, deflate, br'; HTTPClient.Request.CustomHeaders.Values['Content-Type'] := 'application/x-www-form-urlencoded'; HTTPClient.HTTPOptions := [hoKeepOrigProtocol, hoInProcessAuth]; HTTPClient.HandleRedirects := True; json:= 'grant_type=client_credentials&client_id=teste&client_secret=123456789'; //aqui era o maior problema JsonStreamEnvio := TStringStream.Create(utf8Encode(json)); JsonStreamRetorno := TStringStream.Create(''); SSLIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); try SSLIOHandler.SSLOptions.Mode := sslmUnassigned; SSLIOHandler.SSLOptions.CertFile := 'd:\matera\novo\certificate.pem'; SSLIOHandler.SSLOptions.KeyFile := 'd:\matera\novo\certificate.key'; SSLIOHandler.SSLOptions.SSLVersions := [sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2]; HTTPClient.IOHandler := SSLIOHandler; try HTTPClient.Post(url, JsonStreamEnvio, JsonStreamRetorno); except retorno := HTTPClient.ResponseCode; end; retorno := HTTPClient.ResponseCode; if retorno = 200 then begin JsonStreamRetorno.SaveToFile('d:\token.json'); end; finally HTTPClient.Free; SSLIOHandler.Free; end; end; Obrigado Pessoal.
  12. Resolvido Segue código abaixo function ObterToken():integer; var HTTPClient: TIdHTTP; SSLIOHandler: TIdSSLIOHandlerSocketOpenSSL; url,json: string; JsonStreamRetorno, JsonStreamEnvio: TStringStream; retorno : integer; begin url := 'https://mtls-mp.hml.flagship.maas.link/auth/realms/Matera/protocol/openid-connect/token'; HTTPClient := TIdHTTP.Create(nil); HTTPClient.Request.CharSet := 'utf-8'; HTTPClient.Request.Accept := '*/*'; HTTPClient.Request.AcceptEncoding := 'gzip, deflate, br'; HTTPClient.Request.CustomHeaders.Values['Content-Type'] := 'application/x-www-form-urlencoded'; HTTPClient.HTTPOptions := [hoKeepOrigProtocol, hoInProcessAuth]; HTTPClient.HandleRedirects := True; json:= 'grant_type=client_credentials&client_id=teste&client_secret=123456789'; //aqui era o maior problema JsonStreamEnvio := TStringStream.Create(utf8Encode(json)); JsonStreamRetorno := TStringStream.Create(''); SSLIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); try SSLIOHandler.SSLOptions.Mode := sslmUnassigned; SSLIOHandler.SSLOptions.CertFile := 'd:\matera\novo\certificate.pem'; SSLIOHandler.SSLOptions.KeyFile := 'd:\matera\novo\certificate.key'; SSLIOHandler.SSLOptions.SSLVersions := [sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2]; HTTPClient.IOHandler := SSLIOHandler; try HTTPClient.Post(url, JsonStreamEnvio, JsonStreamRetorno); except retorno := HTTPClient.ResponseCode; end; retorno := HTTPClient.ResponseCode; if retorno = 200 then begin JsonStreamRetorno.SaveToFile('d:\token.json'); end; finally HTTPClient.Free; SSLIOHandler.Free; end; end; Obrigado Pessoal.
  13. Olá pessoal Executo no Rest Debugger um post para geração de um token na Api ele pede a confirmação do certificado e funciona, porém quando passo os componentes para o Form não funciona(procedimento efetuado através do Copy Components). Quando ResTRequest1.execute não aparece a tela pedindo o certificado e apresenta erro. Desde já agradeço. Segue abaixo as telas :
  14. Opa segue o link completo da Api Desde já agradeço http://doc-api.matera.com/mp_server.html
  15. Opa segue p link da api no Postman https://ipflagship.freshdesk.com/support/solutions/articles/67000719185
  16. Olá Pessoal Estou tentando obter token de uma Api mas não obtive resultado , já tentei via Http e via Synapse Segue os códigos abaixo , desde já agradeço. ///// via synapse sempre apresenta Bad Request var HTTPSend:THTTPSend; data : string; lParamList := TStringList; begin url := 'https://mtls-mp.hml.flagship.maas.link/auth/realms/Matera/protocol/openid-connect/token'; HTTPSend:= THTTPSend.Create; lParamList := TStringList.Create; lParamList.Add('grant_type=client_credentials'); lParamList.Add('client_id=teste); lParamList.Add('client_secret=123456789'); Data := UTF8Encode(lParamList.Text); HTTPSend.Document.Write(Pointer(Data)^, Length(Data)); try HTTPSend.Protocol:='1.2'; HTTPSend.KeepAlive:=True; HTTPSend.MimeType := 'application/x-www-form-urlencoded'; with HTTPSend.Sock.SSL do begin SSLType:=LT_all; CertificateFile:='d:\cert.pem'; PrivateKeyFile:='d:\cert.key'; CertCAFile:='d:\cert.pem'; end; if HTTPSend.HTTPMethod('Post',url) then begin ShowMessage(HTTPSend.ResultString); end else begin ShowMessage('error'); end; ShowMessage(IntToStr(HTTPSend.Sock.LastError)+' - '+HTTPSend.Sock.LastErrorDesc); finally HTTPSend.Free; end; ///////////////////////////////////////////////////////// //////////////////////////////////////////////////////// via HTTP sempre apresenta erro 400 var HTTP : TidHTTP; SSL: TIdSSLIOHandlerSocketOpenSSL; JsonStreamRetorno : TStringStream; Params: TMemoryStream; begin http := TIdHTTP.Create(Nil); http.Request.ContentType := 'application/x-www-form-urlencoded'; http.Request.Charset := 'UTF-8'; SSL := TIdSSLIOHandlerSocketOpenSSL.Create(HTTP); SSL.SSLOptions.Create; SSL.SSLOptions.CertFile := 'd:\cert.pem'; SSL.SSLOptions.KeyFile := 'd:\cert.key'; SSL.SSLOptions.RootCertFile := 'd:\cert.pem'; SSL.SSLOptions.Mode := sslmUnassigned; SSL.SSLOptions.VerifyMode := []; SSL.SSLOptions.VerifyDepth := 0; SSL.sslOptions.SSLVersions := [sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2]; HTTP.IOHandler := SSL; JsonStreamRetorno := TStringStream.Create(''); Params:= TMemoryStream.Create; WriteStringToStream(Params, 'grant_type,client_credentials',IndyTextEncoding_UTF8); WriteStringToStream(Params, 'client_id,teste',IndyTextEncoding_UTF8); WriteStringToStream(Params, 'client_secret,12345678',IndyTextEncoding_UTF8); Params.Position := 0; try http.Post(url, Params, JsonStreamRetorno); except retorno := http.ResponseCode; end; retorno := http.ResponseCode; if retorno = 200 then begin end;
  17. Boa Tarde . Tenho este código abaixo para conexão Rest para gerar um token , porém necessito através do Rest enviar o certificado na requisição, não achei nenhum exemplo. No Rest Debugger funciona ele pede o certificado. Segue abaixo o código: Desde já agradeço. function teste(): WideString; var restClient: TRESTClient; restRequest: TRESTRequest; restResponse: TRESTResponse; begin restClient := TRESTClient.Create(''); restRequest := TRESTRequest.Create(restClient); restResponse := TRESTResponse.Create(restClient); try try restClient.Accept := 'application/json, text/plain; q=0.9, text/html;q=0.8,'; restClient.AcceptCharset := 'UTF-8, *;q=0.8'; restClient.AutoCreateParams := true; restClient.AllowCookies := True; restClient.BaseURL := 'https://mtls-mp.hml.flagship.maas.link/auth/realms/Matera/protocol/openid-connect/token'; restClient.ContentType := 'application/x-www-form-urlencoded'; restClient.FallbackCharsetEncoding := 'UTF-8'; restClient.HandleRedirects := True; restResponse.ContentType := 'text/xml'; restRequest.Accept := 'application/json, text/plain; q=0.9, text/html;q=0.8,'; restRequest.AcceptCharset := 'UTF-8, *;q=0.8'; restRequest.AcceptEncoding := ''; restRequest.Client := restClient; restRequest.Method := rmPOST; restRequest.SynchronizedEvents := False; restRequest.Response := restResponse; restRequest.Params.Add; RESTRequest.Params.Items[0].name := 'grant_type'; RESTRequest.Params.Items[0].Value := 'client_credentials'; restRequest.Params[0].Kind := pkGETorPOST; restRequest.Params[0].ContentType := ctNone; restRequest.Params.Add; RESTRequest.Params.Items[1].name := 'client_id'; RESTRequest.Params.Items[1].Value := 'teste-hml'; restRequest.Params[1].Kind := pkGETorPOST; restRequest.Params[1].ContentType := ctNone; restRequest.Params.Add; RESTRequest.Params.Items[2].name := 'client_secret'; RESTRequest.Params.Items[2].Value := '12345678'; restRequest.Params[2].Kind := pkGETorPOST; restRequest.Params[2].ContentType := ctNone; restRequest.Execute; result := restResponse.Content; except on e: Exception do begin result := 'Erro: ' + e.Message + ' XML: ' + restResponse.Content; end end; finally restClient.Free; end; end;
  18. Boa Tarde Diego Também estou querendo . Li o os links enviados pelo EMBarbosa mas a coisa é complexa, e o pior será que vai funcionar..
  19. Boa tarde EMBarbosa Agradeço, vou ler o artigo
  20. Bom Dia Daniel Desde já agradeço Segue abaixo resposta da Pagseguro "Hoje temos a biblioteca PlugPag disponível na plataforma Windows para as linguagens C e Java e vale lembrar que os terminais suportados são as Moderninhas WiFi e PRO. O suporte a minizinha está em desenvolvimento. Não temos previsão para adicionarmos o suporte à linguagem Pascal. O link que você mandou é para geração do tlb a partir do Visual Studio e linguagem C#. A lib PlugPag foi desenvolvida em C puro. Existe a possibilidade de importar um .dll desenvolvido em C em Delphi, mas infelizmente não temos como ajuda-lo nesse processo, pois não temos especialistas na linguem Pascal(Delphi)."
  21. Boa Tarde Tenho que fazer uma integração com Pos da PagSeguro, porém ao carregar a dll com loadlibrary não apresenta erros más não carrega as funções. Se tentar chamar por função dá erro ao iniciar o programa. Alguém poderia me dar alguma dica. Desde já agradeço, fico no aguardo Segue as dlls plugpag-master.rar
×
×
  • Criar Novo...

Informação Importante

Colocamos cookies em seu dispositivo para ajudar a tornar este site melhor. Você pode ajustar suas configurações de cookies, caso contrário, assumiremos que você está bem para continuar.