Ir para conteúdo
  • Cadastre-se

haroldo.dias

Membros
  • Total de ítens

    3
  • Registro em

  • Última visita

Últimos Visitantes

240 visualizações

haroldo.dias's Achievements

Rookie

Rookie (2/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputação

  1. Está tudo normal.
  2. haroldo.dias

    Erro no envio da CC-e

    Bom dia O seguinte erro acontece quando envio a CC-e. Já estou enviando como evento e esse erro não acontece sempre. Outra coisa curiosa é que na Sefaz, a CC-e foi aceita, mas como dá esse erro, o XML com o protocolo da CC-e não é gerado. O que devo fazer? Segue meu codigo de geração e envio: NFe.EnvEvento.EnvEventoNFe.Evento.Clear; NFe.EnvEvento.EnvEventoNFe.idLote := StrToInt(idLote) ; with NFe.EnvEvento.EnvEventoNFe.Evento.Add do begin infEvento.chNFe := StrChaveAcesso; infEvento.cOrgao := StrToInt(codOrgao); infEvento.CNPJ := CNPJ; infEvento.dhEvento := vNow; infEvento.tpEvento := teCCe; infEvento.nSeqEvento:= StrToInt(nSeqEvento); infEvento.detEvento.xCorrecao := FormConsulta.mOcorrencia.Lines.Text; end; NFe.EnviarEventoNFe(StrToInt(idLote)); Msg := UTF8Encode(NFE.WebServices.EnvEvento.RetWS); O erro que dá é: O identificador não está no estado correto para a operação solicitada URL:https://nfe.sefaz.ce.gov.br/nfe2/services/RecepcaoEvento - SOAPAction:http://www.portalfiscal.inf.br/nfe/wsdl/RecepcaoEvento
  3. Oi pessoal Já pesquisei muito mesmo sobre esse "simples" probleminha, mas não consegui resolvê-lo. É o seguinte, ao enviar a carta de correção, eventualmente ocorre da Sefaz não retornar positivamente a resposta da transmissão, no entanto, se eu consultar no site da Sefaz ou Receita Federal, o evento da correção foi efetivada. Observando os exemplos do Acbr, implementei no meu sistema uma rotina para capturar o protocolo de autorizaçao da CC-e para poder imprimí-la, só que o arquivo xml [chave de acesso-ProcEventoNFe.xml] não foi gerado por causa do timeout da sefaz, e não consegui fazer gerar na rotina onde capturo as informações dos eventos. Estou fazendo assim para pegar as informações dos eventos gerados da nf-e: NFe.WebServices.Consulta.NFeChave := CHAVE_ACESSO; NFe.WebServices.Consulta.Executar; Log.Lines.Text := UTF8Encode(NFe.WebServices.Consulta.RetWS); //Aqui carrega o xml da nf-e Log.Lines.Add('cStat '+IntToStr(NFe.WebServices.Consulta.cStat)); Log.Lines.Add('Motivo '+String(NFe.WebServices.Consulta.Msg)); Log.Lines.Add('Protocolo '+NFe.WebServices.Consulta.protNFe.nProt); Log.Lines.Add('Dt.Hr.Recto. '+FormatDateTime('dd/mm/yyyy hh:nn:ss',NFe.WebServices.Consulta.protNFe.dhRecbto)); Log.Lines.Add('Prot.Canc.'+NFe.WebServices.Consulta.retCancNFe.nProt); Log.Lines.Add('Dt.Hr.Rec.Canc.'+FormatDateTime('dd/mm/yyyy hh:nn:ss',NFe.WebServices.Consulta.retCancNFe.dhRecbto)); for I := 0 to NFe.WebServices.Consulta.procEventoNFe.Count-1 do begin if NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.InfEvento.tpEvento = teCancelamento then begin if NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Count > 0 then begin Log.Lines.Add('Prot.Evento '+NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Items[0].RetInfEvento.nProt); Log.Lines.Add('Dt.Hr.Evento '+FormatDateTime('dd/mm/yyyy hh:nn:ss', NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Items[0].RetInfEvento.dhRegEvento)); end; end; if NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.InfEvento.tpEvento = teCCe then begin if NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Count > 0 then begin Log.Lines.Add('cSta '+IntToStr(NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Items[0].RetInfEvento.cStat)); Log.Lines.Add('Seq. '+IntToStr(NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Items[0].RetInfEvento.nSeqEvento)); Log.Lines.Add('Prot.CCe '+NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Items[0].RetInfEvento.nProt); Log.Lines.Add('Dt.Hr.CCe '+FormatDateTime('dd/mm/yyyy hh:nn:ss', NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Items[0].RetInfEvento.dhRegEvento)); if (NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Items[0].RetInfEvento.cStat) = 135 then Begin Log.Lines.Add('Gravando protocolo...'); Dm.IbqM.SQL.Clear; Dm.IbqM.SQL.Add('UPDATE TBNF_CORRECAO SET'); Dm.IbqM.SQL.Add('DataHora_Fim = ' + QuotedStr(FormatDateTime('mm/dd/yyyy hh:nn:ss', NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Items[0].RetInfEvento.dhRegEvento))); Dm.IbqM.SQL.Add(',Protocolo = ' + QuotedStr(NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Items[0].RetInfEvento.nProt)); Dm.IbqM.SQL.Add('Where Estabelecimento_Id = ' +QrNfsESTABELECIMENTO_CODIGO.AsString); Dm.IbqM.SQL.Add(' and Nfs_Id = ' + QrNfsCONTROLE.AsString); Dm.IbqM.SQL.Add(' and Sequencial = ' + IntToStr(NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Items[0].RetInfEvento.nSeqEvento)); ExecutarSql; End; end; end; end; Mas não sei como "re"gerar o xml da cc-e. Meu componente já está atualizado. Tentei assim, mas não funcionou: NFe.WebServices.Consulta.procEventoNFe.Items.RetEventoNFe.retEvento.Items[0].RetInfEvento.Xml));
×
×
  • 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.