Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DataSourceDados.DataSet.First;
- while not DataSourceDados.DataSet.EOF do
- begin
- auxSelecionado := DataSourceDados.DataSet.FieldByName('SELECIONADO').AsBoolean;
- auxID_Parcela := DataSourceDados.DataSet.FieldByName('ID').AsInteger;
- auxJuros := DataSourceDados.DataSet.FieldByName('JUROS').AsCurrency;
- auxValor := DataSourceDados.DataSet.FieldByName('RESTANTE').AsCurrency;
- if (auxSelecionado) then
- begin
- auxValorPago -= (auxValor + auxJuros);
- if (auxValorPago < 0) then
- begin
- //auxProporcaoJuros e auxProporcaoValor do tipo Float para maior precisão
- auxProporcaoJuros := auxJuros / (auxValor + auxJuros);
- auxProporcaoValor := auxValor / (auxValor + auxJuros);
- auxJuros += Riba.Arredonda(auxValorPago * auxProporcaoJuros);
- auxValor += Riba.Arredonda(auxValorPago * auxProporcaoValor);
- end;
- if (auxValor < 0) then
- Break;
- auxPag.Iserir(integer(auxTipoPag), ID_Servico, auxID_Parcela, auxValor, auxJuros);
- end;
- DataSourceDados.DataSet.Next;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement