Estou setando pra produção diretamente na linha de código:
procedure TFrmNFe.BitBtn2Click(Sender: TObject);
var Chave, idLote, CNPJ, nSeqEvento, Correcao : string;
NumeroLote : Integer;
begin
if Application.MessageBox('Deseja Enivar uma Carta de Correção?','ATENÇÃO - CONSYST Sistemas Empresariais',MB_ICONQUESTION + MB_YESNO)=mryes then
begin
idLote := FormatDateTime('yyddmmhhmm', Now);
nSeqEvento := '1';
NumeroLote := 1;
ACBrNFe1.EventoNFe.Evento.Clear;
with ACBrNFe1.EventoNFe.Evento.Add do
begin
InfEvento.tpAmb := taProducao;
infEvento.chNFe := ed_chave.Text;
InfEvento.CNPJ := dm1.TB_EMPRESACNPJ.Value;
infEvento.dhEvento := now;
infEvento.tpEvento := teCCe;
infEvento.nSeqEvento := StrToInt(ed_cceSqc.Text);
infEvento.detEvento.descEvento := 'Carta de Correção';
infEvento.detEvento.xCorrecao := ed_jusficativa.Text;
end;
ACBrNFe1.EnviarEvento(StrToInt(idLote));
MemoResp.Lines.Text := ACBrNFe1.WebServices.EnvEvento.RetWS;
LoadXML(MemoResp, WBResposta);
ShowMessage('Carta de Correção Registrada com Sucesso!');
end;
end;
Eu percebi que a opção taProdução (0) e Homologação é taHomologação (1), pq mp XML aparece 2?