Ola
Estou tentando cancelar uma nfe, mas simplesmente não funciona. Aparece apenas um MessageDlg com mtErro mas sem nenhum texto. O que poide estar causando isso?
Estou usando o seguinte codigo:
Procedure TFNFe.Button6Click(Sender: TObject);
var
idLote,vAux : String;
begin
OpenDialog1.Title := 'Selecione a NFE';
OpenDialog1.DefaultExt := '*-nfe.XML';
OpenDialog1.Filter := 'Arquivos NFE (*-nfe.XML)|*-nfe.XML|Arquivos XML (*.XML)|*.XML|Todos os Arquivos (*.*)|*.*';
if OpenDialog1.Execute then
begin
ACBrNFe1.NotasFiscais.Clear;
ACBrNFe1.NotasFiscais.LoadFromFile(OpenDialog1.FileName);
idLote := '1';
if not(InputQuery('WebServices Eventos: Cancelamento', 'Identificador de controle do Lote de envio do Evento', idLote)) then
exit;
if not(InputQuery('WebServices Eventos: Cancelamento', 'Justificativa', vAux)) then
exit;
ACBrNFe1.EventoNFe.Evento.Clear;
ACBrNFe1.EventoNFe.idLote := StrToInt(idLote) ;
with ACBrNFe1.EventoNFe.Evento.Add do
begin
infEvento.dhEvento := now;
infEvento.tpEvento := teCancelamento;
infEvento.detEvento.xJust := vAux;
end;
ACBrNFe1.EnviarEventoNFe(StrToInt(idLote));
end;
Podem me ajudar?
Ivo