Olá, sou iniciante mexendo no acbrboleto, e quando faço a leitura do retorno, após configurar os componentes, a leitura do retorno volta vazia.
me baseei nessas configurações e nessa rotina:
procedure TForm1.Retorno;
var
i : Integer;
begin
if OpenDialog1.Execute then
begin
//Configurar
ConfiguracoesACBr;
//
ACBrBoleto.NomeArqRetorno := OpenDialog1.FileName;
ACBrBoleto.LerRetorno;
for i := 0 to ACBrBoleto.ListadeBoletos.Count-1 do
begin
if ACBrBoleto.ListadeBoletos.Objects[i].ValorRecebido > 0 then
begin
SQLAux.Close;
SQLAux.SQL.Clear;
SQLAux.SQL.Add('update conrec set');
SQLAux.SQL.Add('data_baixa = :pData,');
SQLAux.SQL.Add('valor_pago = :pValor,');
SQLAux.SQL.Add('taxa_cobranca = :pTaxa');
SQLAux.SQL.Add('where nosso_numero = :pNossoNum');
SQLAux.Params.ParamByName('pData').AsDate := ACBrBoleto.ListadeBoletos.Objects[i].DataCredito;
SQLAux.Params.ParamByName('pValor').AsFloat := ACBrBoleto.ListadeBoletos.Objects[i].ValorRecebido;
SQLAux.Params.ParamByName('pNossoNum').AsString:= Copy(ACBrBoleto.ListadeBoletos.Objects[i].NossoNumero,1,ACBrBoleto.Banco.TamanhoMaximoNossoNum); // vir sem o dígito, se quiser
SQLAux.Params.ParamByName('pTaxa').AsFloat := ACBrBoleto.ListadeBoletos.Objects[i].ValorDespesaCobranca;
SQLAux.ExecSQL(False);
end;
end;
SQLAux.Close;
end;
end;
procedure TForm1.ConfiguracoesACBr;
begin
ACBrBoleto.ACBrBoletoFC.DirLogo := sPathLogo;
ACBrBoleto.ACBrBoletoFC.Filtro := fiNenhum;
ACBrBoleto.ACBrBoletoFC.LayOut := lPadrao;
ACBrBoleto.ACBrBoletoFC.MostrarSetup:= true;
ACBrBoleto.ACBrBoletoFC.SoftwareHouse:= 'SUA EMPRESA';
ACBrBoleto.Banco.TipoCobranca := cobSantander; // escolha o seu tipo de cobrança
ACBrBoleto.Banco.Digito := iDigBanco; // 33
ACBrBoleto.Banco.Numero := iBanco; // 7
ACBrBoleto.Banco.Nome := sBanco; // 'Santander';
ACBrBoleto.Banco.TamanhoMaximoNossoNum := iTamNossoNum; // 12
ACBrBoleto.Cedente.CaracTitulo := tcSimples; // simples com registro
ACBrBoleto.Cedente.Nome := sNomCedente;
ACBrBoleto.Cedente.Telefone := sTelefoneCedente;
ACBrBoleto.Cedente.UF := sUFCedente;
ACBrBoleto.Cedente.Bairro := sBairroCedente;
ACBrBoleto.Cedente.CEP := sCepCedente;
ACBrBoleto.Cedente.Cidade := sCidadeCedente;
ACBrBoleto.Cedente.CNPJCPF := sCnpjCedente;
ACBrBoleto.Cedente.Complemento := '';
ACBrBoleto.Cedente.Conta := sContaCorrente;
ACBrBoleto.Cedente.ContaDigito := sContaCorrenteDig;
ACBrBoleto.Cedente.Logradouro := sLogradouroCedente;
ACBrBoleto.Cedente.NumeroRes := '';
ACBrBoleto.Cedente.Convenio := sConvenio; //
ACBrBoleto.Cedente.Modalidade := sModalidade; //
ACBrBoleto.Cedente.CodigoCedente := sCodCedente;
ACBrBoleto.Cedente.CodigoTransmissao:= sCodigoTransmissao; // no santander tem
ACBrBoleto.Cedente.ResponEmissao := Iif(Trim(sBancoEmite)='SIM', tbBancoEmite, tbCliEmite);
ACBrBoleto.Cedente.TipoInscricao := pJuridica;
ACBrBoleto.Cedente.TipoCarteira := Iif(Trim(sRegistrar)='SIM', tctRegistrada, tctSimples);
ACBrBoleto.DataArquivo := Date;
ACBrBoleto.NomeArqRemessa := FormatDateTime('DDMMYYYYHHMMSS',Now)+'.TXT';
ACBrBoleto.DirArqRemessa := sPathRemessa;
ACBrBoleto.DirArqRetorno := sPathRetorno;
ACBrBoleto.ImprimirMensagemPadrao := False;
ACBrBoleto.LayoutRemessa := Iif(Pos(sLayoutArqRet,'400')>0,c400,c240);
ACBrBoleto.LeCedenteRetorno := true;
end;