Usuários SAC Luiz Carlos de Lima 102 Posted August 12, 2020 Usuários SAC Report Share Posted August 12, 2020 Boa tarde, Estou fazendo o cancelamento de NFe, mas estou tendo dúvida sobre o cStat do Retorno. A nota esta com 48 horas de emissão, então deveria retornar erro, informando que a nota está fora do prazo de cancelamento. ACBrNFe.EventoNFe.Evento.Clear; with ACBrNFe.EventoNFe.Evento.New do begin infEvento.chNFe := dsNotasSaidas.DataSet.FieldByName('ChaveNFe_NotaSaida_Material').AsString; infEvento.detEvento.nProt := dsNotasSaidas.DataSet.FieldByName('ProtocNFe_NotaSaida_Material').AsString; infEvento.CNPJ := vCNPJCertificado; infEvento.dhEvento := LerDataHoraAtual; infEvento.tpEvento := teCancelamento; infEvento.detEvento.xJust := Justificativa; end; Retorno := ACBrNFe.EnviarEvento(1); vCodRetorno := ACBrNFe.WebServices.Consulta.cStat; vRetorno := IntToStr(ACBrNFe.WebServices.EnvEvento.cStat); Retornos: Retorno = true vCodRetorno = 100 vRetorno = 128 (Lote de Evento Processado: o lote foi processado), quando deveria retornar o cStat 135 (Evento registrado e vinculado a NF-e: recebido...) Como saber se o procedimento de cancelamento foi efetivado? Grato pela atenção Link to post Share on other sites
Solution BigWings 3,986 Posted August 12, 2020 Solution Report Share Posted August 12, 2020 3 minutos atrás, Luiz Carlos de Lima disse: Como saber se o procedimento de cancelamento foi efetivado? ACBrNFe1.EnviarEvento(nLote); cStat := ACBrNFe1.WebServices.EnvEvento.EventoRetorno.retEvento.Items[0].RetInfEvento.cStat; nProt := ACBrNFe1.WebServices.EnvEvento.EventoRetorno.retEvento.Items[0].RetInfEvento.nProt; xMotivo := ACBrNFe1.WebServices.EnvEvento.EventoRetorno.retEvento.Items[0].RetInfEvento.xMotivo; 2 BigWingsAjude o Projeto ACBr crescer - Assine o SAC Link to post Share on other sites
Usuários SAC Luiz Carlos de Lima 102 Posted August 12, 2020 Author Usuários SAC Report Share Posted August 12, 2020 Grato, resolvido. 1 Link to post Share on other sites
Italo Giurizzato Junior 9,885 Posted August 12, 2020 Report Share Posted August 12, 2020 Obrigado por reportar. Fechando. Para novas dúvidas, criar um novo tópico. Italo Giurizzato Junior Ajude o Projeto ACBr crescer - Assine o SAC Analista de Sistemas / e-mail: [email protected] / Fone: (16) 9-9701-5030 / Araraquara-SP Link to post Share on other sites
Recommended Posts