You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
908 lines
34 KiB
908 lines
34 KiB
unit urelPrestacaoAnaSin;
|
|
|
|
interface
|
|
|
|
uses
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
|
|
System.Classes, Vcl.Graphics, System.DateUtils,
|
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, ZAbstractRODataset, ZDataset,
|
|
RLReport, RLFilters, RLPDFFilter;
|
|
|
|
type
|
|
TrelPrestacaoAnaSin = class(TForm)
|
|
relPrestacao: TRLReport;
|
|
frbnd_header: TRLBand;
|
|
frpnl_logo: TRLPanel;
|
|
frdbimg_logo: TRLDBImage;
|
|
frpnl_headertop: TRLPanel;
|
|
frlbl_headertop: TRLLabel;
|
|
RLMemo1: TRLMemo;
|
|
dtsCredores: TDataSource;
|
|
RLGroup1: TRLGroup;
|
|
RLBand2: TRLBand;
|
|
RLDBText2: TRLDBText;
|
|
RLSubDetail1: TRLSubDetail;
|
|
frbnd_clmheader: TRLBand;
|
|
RLLabel2: TRLLabel;
|
|
RLLabel3: TRLLabel;
|
|
RLLabel4: TRLLabel;
|
|
RLLabel5: TRLLabel;
|
|
RLLabel6: TRLLabel;
|
|
RLLabel7: TRLLabel;
|
|
RLLabel8: TRLLabel;
|
|
RLLabel9: TRLLabel;
|
|
RLLabel10: TRLLabel;
|
|
RLLabel11: TRLLabel;
|
|
RLLabel12: TRLLabel;
|
|
RLLabel1: TRLLabel;
|
|
frbnd_detail: TRLBand;
|
|
RLDBText3: TRLDBText;
|
|
RLDBText4: TRLDBText;
|
|
RLDBText5: TRLDBText;
|
|
RLDBText6: TRLDBText;
|
|
RLDBText7: TRLDBText;
|
|
RLDBText8: TRLDBText;
|
|
RLDBText9: TRLDBText;
|
|
RLDBText10: TRLDBText;
|
|
RLDBText11: TRLDBText;
|
|
RLDBText1: TRLDBText;
|
|
RLDBText12: TRLDBText;
|
|
RLDBText18: TRLDBText;
|
|
frbnd_clmfooter: TRLBand;
|
|
RLDBResult1: TRLDBResult;
|
|
RLDBResult2: TRLDBResult;
|
|
RLDBResult3: TRLDBResult;
|
|
RLDBResult4: TRLDBResult;
|
|
RLDBResult5: TRLDBResult;
|
|
RLDBResult6: TRLDBResult;
|
|
RLDBResult7: TRLDBResult;
|
|
RLLabel13: TRLLabel;
|
|
RLLabel15: TRLLabel;
|
|
RLLabel16: TRLLabel;
|
|
RLLabel17: TRLLabel;
|
|
RLLabel18: TRLLabel;
|
|
RLLabel19: TRLLabel;
|
|
RLLabel20: TRLLabel;
|
|
RLLabel21: TRLLabel;
|
|
RLLabel22: TRLLabel;
|
|
RLDBResult8: TRLDBResult;
|
|
zroqryCredores: TZReadOnlyQuery;
|
|
zroqryCredoresID_EMPRESA: TIntegerField;
|
|
zroqryCredoresTX_NOME: TWideStringField;
|
|
zroqryCredoresTX_FANTASIA: TWideStringField;
|
|
zroqryCredoresTX_CNPJ: TWideStringField;
|
|
zroqryCredoresTX_IE: TWideStringField;
|
|
zroqryCredoresTX_ENDERECO: TWideStringField;
|
|
zroqryCredoresTX_COMPLEMENTO: TWideStringField;
|
|
zroqryCredoresID_CIDADE: TIntegerField;
|
|
zroqryCredoresTX_BAIRRO: TWideStringField;
|
|
zroqryCredoresID_ESTADO: TIntegerField;
|
|
zroqryCredoresTX_CEP: TWideStringField;
|
|
zroqryCredoresTX_TELEFONE: TWideStringField;
|
|
zroqryCredoresTX_EMAIL: TWideStringField;
|
|
zroqryCredoresTX_WEBSITE: TWideStringField;
|
|
zroqryCredoresNR_NUMERO: TIntegerField;
|
|
zroqryCredoresTX_IM: TWideStringField;
|
|
zroqryCredoresTL_OBSERVACOES: TWideMemoField;
|
|
zroqryCredoresID_REPASSE: TIntegerField;
|
|
zroqryCredoresTP_ENTRADA: TWideStringField;
|
|
zroqryCredoresPR_MULTA: TFloatField;
|
|
zroqryCredoresPR_JUROS: TFloatField;
|
|
zroqryCredoresNR_PARCELAS: TIntegerField;
|
|
zroqryCredoresPR_DESC_QUIT_PRIN: TFloatField;
|
|
zroqryCredoresPR_DESC_QUIT_JUROS: TFloatField;
|
|
zroqryCredoresPR_DESC_QUIT_MULTA: TFloatField;
|
|
zroqryCredoresPR_DESC_QUIT_IND_FIN: TFloatField;
|
|
zroqryCredoresPR_DESC_QUIT_COR: TFloatField;
|
|
zroqryCredoresPR_DESC_FINAN_PRIN: TFloatField;
|
|
zroqryCredoresPR_DESC_FINAN_JUROS: TFloatField;
|
|
zroqryCredoresPR_DESC_FINAN_MULTA: TFloatField;
|
|
zroqryCredoresPR_DESC_FINAN_IND_FIN: TFloatField;
|
|
zroqryCredoresPR_DESC_FINAN_COR: TFloatField;
|
|
zroqryCredoresPR_INDICADOR_FINANCEIRO: TFloatField;
|
|
zroqryCredoresPR_JUROS_PARCELAR: TFloatField;
|
|
zroqryCredoresPR_ENTRADA_MIN: TFloatField;
|
|
zroqryCredoresPR_ENTRADA_MAX: TFloatField;
|
|
zroqryCredoresTP_CHEQUE: TWideStringField;
|
|
zroqryCredoresTP_CRED: TWideStringField;
|
|
zroqryCredoresTP_DIN: TWideStringField;
|
|
zroqryCredoresID_ULTIMO_USUARIO: TIntegerField;
|
|
zroqryCredoresDT_HORA_ULTIMA_ATT: TDateTimeField;
|
|
dtsTitulos: TDataSource;
|
|
zroqryTitulos: TZReadOnlyQuery;
|
|
zroqryTitulosTX_NOME: TWideStringField;
|
|
zroqryTitulosTX_PRODUTO: TWideStringField;
|
|
zroqryTitulosDT_VENCIMENTO: TDateTimeField;
|
|
zroqryTitulosDT_PAGAMENTO: TDateTimeField;
|
|
zroqryTitulosVL_JUROS: TFloatField;
|
|
zroqryTitulosVL_MULTA: TFloatField;
|
|
zroqryTitulosVL_ENCARGOS: TFloatField;
|
|
zroqryTitulosVL_CORRIGIDO: TFloatField;
|
|
zroqryTitulosVL_DESC_PRINCIPAL: TFloatField;
|
|
zroqryTitulosID_TITULO: TIntegerField;
|
|
zroqryTitulosID_EMPRESA: TIntegerField;
|
|
zroqryTitulosATRASO: TIntegerField;
|
|
zroqryTitulosVL_RETIDO: TCurrencyField;
|
|
zroqryTitulosVL_REPASSE: TCurrencyField;
|
|
fr_filterpdf: TRLPDFFilter;
|
|
zroqryTitulosVL_TITULO: TCurrencyField;
|
|
frlbl_dep: TRLLabel;
|
|
zroqryTitulosID_DEVEDOR: TIntegerField;
|
|
RLBand1: TRLBand;
|
|
RLLabel14: TRLLabel;
|
|
RLLabel23: TRLLabel;
|
|
RLSystemInfo1: TRLSystemInfo;
|
|
fr_date: TRLSystemInfo;
|
|
RLLabel24: TRLLabel;
|
|
RLLabel25: TRLLabel;
|
|
RLLabel26: TRLLabel;
|
|
RLLabel27: TRLLabel;
|
|
RLLabel28: TRLLabel;
|
|
RLLabel29: TRLLabel;
|
|
RLLabel30: TRLLabel;
|
|
rotblRepasseFase: TZReadOnlyQuery;
|
|
rotblRepasseFaseID_FASE: TIntegerField;
|
|
rotblRepasseFasePR_PRINCIPAL: TFloatField;
|
|
rotblRepasseFasePR_JUROS: TFloatField;
|
|
rotblRepasseFasePR_MULTA: TFloatField;
|
|
rotblRepasseFasePR_ENCARGOS: TFloatField;
|
|
rotblRepasseFasePR_CORRIGIDO: TFloatField;
|
|
rotblRepasseFaseMIN_ATRASO: TIntegerField;
|
|
rotblRepasseFaseMAX_ATRASO: TIntegerField;
|
|
rotblRepasseFaseID_REPASSE: TIntegerField;
|
|
rotblRepasseFaseID_ULTIMO_USUARIO: TIntegerField;
|
|
rotblRepasseFaseDT_HORA_ULTIMA_ATT: TDateTimeField;
|
|
zroqryTitulosVL_REPASSE_PRIN: TFloatField;
|
|
zroqryTitulosVL_DESC_JUROS: TFloatField;
|
|
zroqryTitulosVL_REPASSE_JUROS: TFloatField;
|
|
zroqryTitulosVL_DESC_MULTA: TFloatField;
|
|
zroqryTitulosVL_REPASSE_MULTA: TFloatField;
|
|
zroqryTitulosVL_INDICADOR: TFloatField;
|
|
zroqryTitulosVL_DESC_INDICADOR: TFloatField;
|
|
zroqryTitulosVL_REPASSE_CORRIGIDO: TFloatField;
|
|
zroqryTitulosTP_PRESTACAO: TWideStringField;
|
|
zroqryTitulosVL_REPASSE_ENCARGOS: TFloatField;
|
|
procedure zroqryTitulosCalcFields(DataSet: TDataSet);
|
|
procedure dtsCredoresDataChange(Sender: TObject; Field: TField);
|
|
procedure frbnd_detailAfterPrint(Sender: TObject);
|
|
procedure FormCreate(Sender: TObject);
|
|
procedure relPrestacaoAfterPrint(Sender: TObject);
|
|
procedure relPrestacaoBeforePrint(Sender: TObject; var PrintIt: Boolean);
|
|
procedure RLDBResult1AfterPrint(Sender: TObject);
|
|
procedure RLLabel14BeforePrint(Sender: TObject; var AText: string;
|
|
var PrintIt: Boolean);
|
|
procedure RLBand1BeforePrint(Sender: TObject; var PrintIt: Boolean);
|
|
procedure RLDBResult2AfterPrint(Sender: TObject);
|
|
procedure RLDBResult3AfterPrint(Sender: TObject);
|
|
procedure RLDBResult4AfterPrint(Sender: TObject);
|
|
procedure RLDBResult8AfterPrint(Sender: TObject);
|
|
procedure RLDBResult5AfterPrint(Sender: TObject);
|
|
procedure RLDBResult6AfterPrint(Sender: TObject);
|
|
procedure RLDBResult7AfterPrint(Sender: TObject);
|
|
procedure relPrestacaoDataRecord(Sender: TObject; RecNo, CopyNo: Integer;
|
|
var Eof: Boolean; var RecordAction: TRLRecordAction);
|
|
procedure relPrestacaoDataCount(Sender: TObject; var DataCount: Integer);
|
|
procedure RLDBText4AfterPrint(Sender: TObject);
|
|
private
|
|
sql: string;
|
|
sqlt: string;
|
|
procedure SalvarReciboPDF;
|
|
{ Private declarations }
|
|
public
|
|
total: currency;
|
|
id_titulo: Integer;
|
|
sum_nominal, sum_juros, sum_multa, sum_enc, sum_desc, sum_total, sum_retido,
|
|
sum_repassado: currency;
|
|
{ Public declarations }
|
|
end;
|
|
|
|
var
|
|
relPrestacaoAnaSin: TrelPrestacaoAnaSin;
|
|
meses: array [1 .. 12] of string = (
|
|
'JANEIRO',
|
|
'FEVEREIRO',
|
|
'MARCO',
|
|
'ABRIL',
|
|
'MAIO',
|
|
'JUNHO',
|
|
'JULHO',
|
|
'AGOSTO',
|
|
'SETEMBRO',
|
|
'OUTUBRO',
|
|
'NOVEMBRO',
|
|
'DEZEMBRO'
|
|
);
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
uses udtmSystem;
|
|
|
|
procedure TrelPrestacaoAnaSin.dtsCredoresDataChange(Sender: TObject;
|
|
Field: TField);
|
|
begin
|
|
dtmSystem.tblRepasse.Locate('ID_REPASSE',
|
|
zroqryCredoresID_REPASSE.AsString, []);
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.FormCreate(Sender: TObject);
|
|
begin
|
|
total := 0;
|
|
id_titulo := -1;
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.frbnd_detailAfterPrint(Sender: TObject);
|
|
begin
|
|
total := total + RLDBText10.Field.Value;
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.relPrestacaoAfterPrint(Sender: TObject);
|
|
begin
|
|
SalvarReciboPDF;
|
|
dtmSystem.tblAcordos.sql.Text := sql;
|
|
dtmSystem.tblDevedores.Open;
|
|
dtmSystem.tblTitulos.Open;
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.relPrestacaoBeforePrint(Sender: TObject;
|
|
var PrintIt: Boolean);
|
|
begin
|
|
dtmSystem.tblDevedores.Close;
|
|
dtmSystem.tblTitulos.Close;
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.relPrestacaoDataCount(Sender: TObject;
|
|
var DataCount: Integer);
|
|
begin
|
|
// if zroqryTitulosID_TITULO.AsInteger <> id_titulo then
|
|
// begin
|
|
// id_titulo := zroqryTitulosID_TITULO.AsInteger;
|
|
// sum_nominal := sum_nominal + zroqryTitulosVL_TITULO.AsCurrency;
|
|
// sum_juros := sum_juros + zroqryTitulosVL_JUROS.AsCurrency;
|
|
// sum_multa := sum_multa + zroqryTitulosVL_MULTA.AsCurrency;
|
|
// sum_enc := sum_enc + zroqryTitulosVL_ENCARGOS.AsCurrency;
|
|
// sum_desc := sum_desc + zroqryTitulosVL_DESC_PRINCIPAL.AsCurrency;
|
|
// sum_total := sum_total + zroqryTitulosVL_CORRIGIDO.AsCurrency;
|
|
// sum_retido := sum_retido + zroqryTitulosVL_RETIDO.AsCurrency;
|
|
// sum_repassado := sum_repassado + zroqryTitulosVL_REPASSE.AsCurrency;
|
|
// end;
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.relPrestacaoDataRecord(Sender: TObject;
|
|
RecNo, CopyNo: Integer; var Eof: Boolean; var RecordAction: TRLRecordAction);
|
|
begin
|
|
// if zroqryTitulosID_TITULO.AsInteger <> id_titulo then
|
|
// begin
|
|
// id_titulo := zroqryTitulosID_TITULO.AsInteger;
|
|
// sum_nominal := sum_nominal + zroqryTitulosVL_TITULO.AsCurrency;
|
|
// sum_juros := sum_juros + zroqryTitulosVL_JUROS.AsCurrency;
|
|
// sum_multa := sum_multa + zroqryTitulosVL_MULTA.AsCurrency;
|
|
// sum_enc := sum_enc + zroqryTitulosVL_ENCARGOS.AsCurrency;
|
|
// sum_desc := sum_desc + zroqryTitulosVL_DESC_PRINCIPAL.AsCurrency;
|
|
// sum_total := sum_total + zroqryTitulosVL_CORRIGIDO.AsCurrency;
|
|
// sum_retido := sum_retido + zroqryTitulosVL_RETIDO.AsCurrency;
|
|
// sum_repassado := sum_repassado + zroqryTitulosVL_REPASSE.AsCurrency;
|
|
// end;
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.RLBand1BeforePrint(Sender: TObject;
|
|
var PrintIt: Boolean);
|
|
begin
|
|
RLLabel23.Caption := 'Nom:' + CurrToStrF(sum_nominal, ffCurrency, 2,
|
|
dtmSystem.CusFmt);
|
|
RLLabel24.Caption := 'Jur:' + CurrToStrF(sum_juros, ffCurrency, 2,
|
|
dtmSystem.CusFmt);
|
|
RLLabel25.Caption := 'Mul:' + CurrToStrF(sum_multa, ffCurrency, 2,
|
|
dtmSystem.CusFmt);
|
|
RLLabel30.Caption := 'Enc:' + CurrToStrF(sum_enc, ffCurrency, 2,
|
|
dtmSystem.CusFmt);
|
|
RLLabel29.Caption := 'Desc:' + CurrToStrF(sum_desc, ffCurrency, 2,
|
|
dtmSystem.CusFmt);
|
|
RLLabel28.Caption := 'Cor:' + CurrToStrF(sum_total, ffCurrency, 2,
|
|
dtmSystem.CusFmt);
|
|
RLLabel27.Caption := 'Ret:' + CurrToStrF(sum_retido, ffCurrency, 2,
|
|
dtmSystem.CusFmt);
|
|
RLLabel26.Caption := 'Rep:' + CurrToStrF(sum_repassado, ffCurrency, 2,
|
|
dtmSystem.CusFmt);
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.RLDBResult1AfterPrint(Sender: TObject);
|
|
begin
|
|
// sum_nominal := sum_nominal + RLDBResult1.Value;
|
|
// RLLabel23.Caption := CurrToStr(sum_nominal);
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.RLDBResult2AfterPrint(Sender: TObject);
|
|
begin
|
|
// sum_juros := sum_juros + RLDBResult2.Value;
|
|
// RLLabel24.Caption := CurrToStr(sum_juros);
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.RLDBResult3AfterPrint(Sender: TObject);
|
|
begin
|
|
// sum_multa := sum_multa + RLDBResult3.Value;
|
|
// RLLabel25.Caption := CurrToStr(sum_multa);
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.RLDBResult4AfterPrint(Sender: TObject);
|
|
begin
|
|
// sum_enc := sum_enc + RLDBResult4.Value;
|
|
// RLLabel30.Caption := CurrToStr(sum_enc);
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.RLDBResult5AfterPrint(Sender: TObject);
|
|
begin
|
|
// sum_total := sum_total + RLDBResult5.Value;
|
|
// RLLabel28.Caption := CurrToStr(sum_total);
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.RLDBResult6AfterPrint(Sender: TObject);
|
|
begin
|
|
// sum_retido := sum_retido + RLDBResult6.Value;
|
|
// RLLabel27.Caption := CurrToStr(sum_retido);
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.RLDBResult7AfterPrint(Sender: TObject);
|
|
begin
|
|
// sum_repassado := sum_repassado + RLDBResult7.Value;
|
|
// RLLabel26.Caption := CurrToStr(sum_repassado);
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.RLDBResult8AfterPrint(Sender: TObject);
|
|
begin
|
|
// sum_desc := sum_desc + RLDBResult8.Value;
|
|
// RLLabel29.Caption := CurrToStr(sum_desc);
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.RLDBText4AfterPrint(Sender: TObject);
|
|
begin
|
|
if zroqryTitulosID_TITULO.AsInteger <> id_titulo then
|
|
begin
|
|
id_titulo := zroqryTitulosID_TITULO.AsInteger;
|
|
sum_nominal := sum_nominal + zroqryTitulosVL_TITULO.AsCurrency;
|
|
sum_juros := sum_juros + zroqryTitulosVL_JUROS.AsCurrency;
|
|
sum_multa := sum_multa + zroqryTitulosVL_MULTA.AsCurrency;
|
|
sum_enc := sum_enc + zroqryTitulosVL_ENCARGOS.AsCurrency;
|
|
sum_desc := sum_desc + zroqryTitulosVL_DESC_PRINCIPAL.AsCurrency;
|
|
sum_total := sum_total + zroqryTitulosVL_CORRIGIDO.AsCurrency;
|
|
sum_retido := sum_retido + zroqryTitulosVL_RETIDO.AsCurrency;
|
|
sum_repassado := sum_repassado + zroqryTitulosVL_REPASSE.AsCurrency;
|
|
end;
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.RLLabel14BeforePrint(Sender: TObject;
|
|
var AText: string; var PrintIt: Boolean);
|
|
begin
|
|
RLLabel14.Caption := 'Totais: ' + CurrToStr(sum_nominal);
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.SalvarReciboPDF;
|
|
var
|
|
path, file_name: string;
|
|
Fmt: TFormatSettings;
|
|
i: Integer;
|
|
begin
|
|
Fmt := TFormatSettings.Create;
|
|
for i := 0 to High(meses) do
|
|
begin
|
|
Fmt.LongMonthNames[i] := meses[i];
|
|
end;
|
|
// path := ExtractFilePath(Application.ExeName) + 'RELATORIOS';
|
|
path := dtmSystem.path_executavel + '\RELATORIOS';
|
|
if not DirectoryExists(path) then
|
|
begin
|
|
CreateDir(path);
|
|
end;
|
|
path := path + '\PRESTACAO_CONTAS';
|
|
if not DirectoryExists(path) then
|
|
begin
|
|
CreateDir(path);
|
|
end;
|
|
path := path + '\ANALITICO';
|
|
if not DirectoryExists(path) then
|
|
begin
|
|
CreateDir(path);
|
|
end;
|
|
path := TrimRight(path);
|
|
path := path + '\' + FormatDateTime('YYYY', Date);
|
|
if not DirectoryExists(path) then
|
|
begin
|
|
CreateDir(path);
|
|
end;
|
|
path := path + '\' + FormatDateTime('mmmm', Date, Fmt);
|
|
if not DirectoryExists(path) then
|
|
begin
|
|
CreateDir(path);
|
|
end;
|
|
path := path + '\' + FormatDateTime('dd', Date);
|
|
if not DirectoryExists(path) then
|
|
begin
|
|
CreateDir(path);
|
|
end;
|
|
file_name := path + '\RELATORIO_PRESTACAO_CONTAS-ANALITICO' +
|
|
FormatDateTime('HH-mm', Time) + '.pdf';
|
|
fr_filterpdf.FileName := file_name;
|
|
relPrestacao.SaveToFile(file_name);
|
|
end;
|
|
|
|
procedure TrelPrestacaoAnaSin.zroqryTitulosCalcFields(DataSet: TDataSet);
|
|
var
|
|
pt_principal, pt_juros, pt_multa, pt_encargos, pt_corrigido: currency;
|
|
atraso, index: Integer;
|
|
ac_pr, ac_j, ac_m, ac_enc, ac_cor: array of currency;
|
|
vl_pr, vl_j, vl_m, vl_enc, vl_cor, pr_pr, pr_j, pr_m, pr_enc, pr_cor, help_pr,
|
|
help_j, help_m, help_enc, help_cor: currency;
|
|
mes, ano: string;
|
|
begin
|
|
with dtmSystem do
|
|
begin
|
|
if not tblDevedores.Active then
|
|
begin
|
|
tblDevedores.Open;
|
|
end;
|
|
if not tblTitulos.Active then
|
|
begin
|
|
tblTitulos.Open;
|
|
end;
|
|
if not tblAcordos.Active then
|
|
begin
|
|
tblAcordos.Open;
|
|
end;
|
|
if not tblCHGEmpresa.Active then
|
|
begin
|
|
tblCHGEmpresa.Open;
|
|
end;
|
|
if not tblEmpresaRepasse.Active then
|
|
begin
|
|
tblEmpresaRepasse.Open;
|
|
end;
|
|
if not tblRepasse.Active then
|
|
begin
|
|
tblRepasse.Open;
|
|
end;
|
|
if not tblRepasseFase.Active then
|
|
begin
|
|
tblRepasseFase.Open;
|
|
end;
|
|
if zroqryTitulosID_TITULO.AsString <> '' then
|
|
begin
|
|
if zroqryTitulosTP_PRESTACAO.AsString = 'N' then
|
|
begin
|
|
sql := tblAcordos.sql.Text;
|
|
sqlt := tblTitulos.sql.Text;
|
|
tblAcordos.sql.Text := 'select * from sys_acordos';
|
|
tblAcordos.Filtered := false;
|
|
tblAcordos.Filter := 'ID_PARCELA = ' + zroqryTitulosID_TITULO.AsString;
|
|
tblAcordos.Filtered := true;
|
|
tblTitulos.sql.Text := 'select * from chg_titulos';
|
|
tblTitulos.Open;
|
|
tblAcordos.Open;
|
|
// pt_principal := 0;
|
|
// pt_juros := 0;
|
|
// pt_multa := 0;
|
|
// pt_encargos := 0;
|
|
// pt_corrigido := 0;
|
|
if not tblAcordos.IsEmpty then
|
|
begin
|
|
tblAcordos.First;
|
|
vl_pr := 0;
|
|
vl_j := 0;
|
|
vl_m := 0;
|
|
vl_enc := 0;
|
|
vl_cor := 0;
|
|
setlength(ac_pr, 0);
|
|
setlength(ac_j, 0);
|
|
setlength(ac_m, 0);
|
|
setlength(ac_enc, 0);
|
|
setlength(ac_cor, 0);
|
|
setlength(ac_pr, tblAcordos.RecordCount);
|
|
setlength(ac_j, tblAcordos.RecordCount);
|
|
setlength(ac_m, tblAcordos.RecordCount);
|
|
setlength(ac_enc, tblAcordos.RecordCount);
|
|
setlength(ac_cor, tblAcordos.RecordCount);
|
|
pr_pr := 0;
|
|
pr_j := 0;
|
|
pr_m := 0;
|
|
pr_enc := 0;
|
|
pr_cor := 0;
|
|
index := 0;
|
|
while not tblAcordos.Eof do
|
|
begin
|
|
tblDevedores.Locate('ID_DEVEDOR',
|
|
tblAcordosID_DEVEDOR.AsInteger, []);
|
|
tblTitulos.Locate('ID_TITULO', tblAcordosID_ORIGINAL.AsInteger, []);
|
|
|
|
if not(tblTitulosTP_PRESTACAO.AsString = 'N') then
|
|
begin
|
|
vl_pr := vl_pr + tblTitulosVL_TITULO.AsCurrency;
|
|
vl_j := vl_j + tblTitulosVL_JUROS.AsCurrency;
|
|
vl_m := vl_m + tblTitulosVL_MULTA.AsCurrency;
|
|
vl_enc := vl_enc + tblTitulosVL_ENCARGOS.AsCurrency;
|
|
vl_cor := vl_cor + tblTitulosVL_CORRIGIDO.AsCurrency;
|
|
end;
|
|
// else
|
|
// begin
|
|
// pt_principal := pt_principal +
|
|
// tblTitulosVL_REPASSE_PRIN.AsCurrency;
|
|
// pt_juros := pt_juros + tblTitulosVL_REPASSE_JUROS.AsCurrency;
|
|
// pt_multa := pt_multa + tblTitulosVL_REPASSE_MULTA.AsCurrency;
|
|
// pt_encargos := pt_encargos + tblTitulosVL_REPASSE_ENCARGOS.
|
|
// AsCurrency;
|
|
// pt_corrigido := pt_corrigido +
|
|
// tblTitulosVL_REPASSE_CORRIGIDO.AsCurrency;
|
|
// end;
|
|
|
|
tblAcordos.Next;
|
|
end;
|
|
tblAcordos.First;
|
|
while not tblAcordos.Eof do
|
|
begin
|
|
tblDevedores.Locate('ID_DEVEDOR',
|
|
tblAcordosID_DEVEDOR.AsInteger, []);
|
|
tblTitulos.Locate('ID_TITULO', tblAcordosID_ORIGINAL.AsInteger, []);
|
|
if not(tblTitulosTP_PRESTACAO.AsString = 'N') then
|
|
begin
|
|
atraso := DaysBetween(tblTitulosDT_PAGAMENTO.AsDateTime,
|
|
tblTitulosDT_VENCIMENTO.AsDateTime);
|
|
tblCHGEmpresa.Locate('ID_EMPRESA',
|
|
tblTitulosID_EMPRESA.AsInteger, []);
|
|
|
|
mes := inttostr
|
|
(strtoint(copy(FormatDateTime('yyyy-mm-dd',
|
|
tblTitulosDT_PAGAMENTO.AsDateTime), 6, 2)));
|
|
ano := copy(FormatDateTime('yyyy-mm-dd',
|
|
tblTitulosDT_PAGAMENTO.AsDateTime), 1, 4);
|
|
tblTitulos.Locate('ID_TITULO',
|
|
tblAcordosID_PARCELA.AsInteger, []);
|
|
tblCHGEmpresa.Locate('ID_EMPRESA',
|
|
tblTitulosID_EMPRESA.AsInteger, []);
|
|
|
|
tblEmpresaRepasse.Filtered := false;
|
|
tblEmpresaRepasse.Locate('ID_MES;ID_ANO',
|
|
VarArrayOf([mes, ano]), []);
|
|
rotblRepasseFase.Close;
|
|
rotblRepasseFase.sql.Text :=
|
|
'select * from sys_repasses_fases where id_repasse = ' +
|
|
QuotedStr(tblEmpresaRepasseID_ITEM.AsString) +
|
|
' and min_atraso <= ' + inttostr(atraso) + ' and ' +
|
|
inttostr(atraso) + ' <= max_atraso';
|
|
rotblRepasseFase.Open;
|
|
|
|
if not rotblRepasseFase.IsEmpty then
|
|
begin
|
|
help_pr := (rotblRepasseFasePR_PRINCIPAL.AsCurrency / 100);
|
|
help_j := (rotblRepasseFasePR_JUROS.AsCurrency / 100);
|
|
help_m := (rotblRepasseFasePR_MULTA.AsCurrency / 100);
|
|
help_enc := (rotblRepasseFasePR_ENCARGOS.AsCurrency / 100);
|
|
help_cor := (rotblRepasseFasePR_CORRIGIDO.AsCurrency / 100);
|
|
end
|
|
else
|
|
begin
|
|
help_pr :=
|
|
(dtmSystem.tblEmpresaRepassePR_PRINCIPAL.AsCurrency / 100);
|
|
help_j := (dtmSystem.tblEmpresaRepassePR_JUROS.
|
|
AsCurrency / 100);
|
|
help_m := (dtmSystem.tblEmpresaRepassePR_MULTA.
|
|
AsCurrency / 100);
|
|
help_enc :=
|
|
(dtmSystem.tblEmpresaRepassePR_ENCARGOS.AsCurrency / 100);
|
|
help_cor :=
|
|
(dtmSystem.tblEmpresaRepassePR_CORRIGIDO.AsCurrency / 100);
|
|
end;
|
|
|
|
tblTitulos.Locate('ID_TITULO',
|
|
tblAcordosID_ORIGINAL.AsInteger, []);
|
|
|
|
ac_pr[index] := tblTitulosVL_TITULO.AsCurrency * help_pr;
|
|
ac_j[index] := tblTitulosVL_JUROS.AsCurrency * help_j;
|
|
ac_m[index] := tblTitulosVL_MULTA.AsCurrency * help_m;
|
|
ac_enc[index] := tblTitulosVL_ENCARGOS.AsCurrency * help_enc;
|
|
ac_cor[index] := tblTitulosVL_CORRIGIDO.AsCurrency * help_cor;
|
|
|
|
if vl_pr <> 0 then
|
|
begin
|
|
pr_pr := pr_pr + ((ac_pr[index] * 100) / vl_pr);
|
|
end;
|
|
if vl_j <> 0 then
|
|
begin
|
|
pr_j := pr_j + ((ac_j[index] * 100) / vl_j);
|
|
end;
|
|
if vl_m <> 0 then
|
|
begin
|
|
pr_m := pr_m + ((ac_m[index] * 100) / vl_m);
|
|
end;
|
|
if vl_enc <> 0 then
|
|
begin
|
|
pr_enc := pr_enc + ((ac_enc[index] * 100) / vl_enc);
|
|
end;
|
|
if vl_cor <> 0 then
|
|
begin
|
|
pr_cor := pr_cor + ((ac_cor[index] * 100) / vl_cor);
|
|
end;
|
|
end;
|
|
Inc(index, 1);
|
|
tblAcordos.Next;
|
|
end;
|
|
if pr_pr = 0 then
|
|
begin
|
|
pt_principal := zroqryTitulosVL_REPASSE_PRIN.AsCurrency;
|
|
end
|
|
else
|
|
begin
|
|
pt_principal := (zroqryTitulosVL_TITULO.AsCurrency * pr_pr) / 100;
|
|
end;
|
|
if pr_j = 0 then
|
|
begin
|
|
pt_juros := zroqryTitulosVL_REPASSE_JUROS.AsCurrency;
|
|
end
|
|
else
|
|
begin
|
|
pt_juros := (zroqryTitulosVL_JUROS.AsCurrency * pr_j) / 100;
|
|
end;
|
|
if pr_m = 0 then
|
|
begin
|
|
pt_multa := zroqryTitulosVL_REPASSE_MULTA.AsCurrency;
|
|
end
|
|
else
|
|
begin
|
|
pt_multa := (zroqryTitulosVL_MULTA.AsCurrency * pr_m) / 100;
|
|
end;
|
|
if pr_enc = 0 then
|
|
begin
|
|
pt_encargos := zroqryTitulosVL_REPASSE_ENCARGOS.AsCurrency;
|
|
end
|
|
else
|
|
begin
|
|
pt_encargos := (zroqryTitulosVL_ENCARGOS.AsCurrency * pr_enc) / 100;
|
|
end;
|
|
if pr_cor = 0 then
|
|
begin
|
|
pt_corrigido := zroqryTitulosVL_REPASSE_CORRIGIDO.AsCurrency;
|
|
end
|
|
else
|
|
begin
|
|
pt_corrigido := (zroqryTitulosVL_CORRIGIDO.AsCurrency * pr_cor) / 100;
|
|
end;
|
|
end
|
|
else
|
|
begin
|
|
pt_principal := zroqryTitulosVL_REPASSE_PRIN.AsCurrency;
|
|
pt_juros := zroqryTitulosVL_REPASSE_JUROS.AsCurrency;
|
|
pt_multa := zroqryTitulosVL_REPASSE_MULTA.AsCurrency;
|
|
pt_encargos := zroqryTitulosVL_REPASSE_ENCARGOS.AsCurrency;
|
|
pt_corrigido := zroqryTitulosVL_REPASSE_CORRIGIDO.AsCurrency;
|
|
end;
|
|
end
|
|
else
|
|
begin
|
|
sql := tblAcordos.sql.Text;
|
|
tblAcordos.sql.Text := 'select * from sys_acordos';
|
|
tblAcordos.Filtered := false;
|
|
tblAcordos.Filter := 'ID_PARCELA = ' + zroqryTitulosID_TITULO.AsString;
|
|
tblAcordos.Filtered := true;
|
|
tblAcordos.Open;
|
|
tblTitulos.sql.Text := 'select * from chg_titulos';
|
|
tblTitulos.Open;
|
|
if not tblAcordos.IsEmpty then
|
|
begin
|
|
tblAcordos.First;
|
|
setlength(ac_pr, 0);
|
|
setlength(ac_j, 0);
|
|
setlength(ac_m, 0);
|
|
setlength(ac_enc, 0);
|
|
setlength(ac_cor, 0);
|
|
setlength(ac_pr, tblAcordos.RecordCount);
|
|
setlength(ac_j, tblAcordos.RecordCount);
|
|
setlength(ac_m, tblAcordos.RecordCount);
|
|
setlength(ac_enc, tblAcordos.RecordCount);
|
|
setlength(ac_cor, tblAcordos.RecordCount);
|
|
vl_pr := 0;
|
|
vl_j := 0;
|
|
vl_m := 0;
|
|
vl_enc := 0;
|
|
vl_cor := 0;
|
|
pr_pr := 0;
|
|
pr_j := 0;
|
|
pr_m := 0;
|
|
pr_enc := 0;
|
|
pr_cor := 0;
|
|
index := 0;
|
|
while not tblAcordos.Eof do
|
|
begin
|
|
tblDevedores.Locate('ID_DEVEDOR',
|
|
tblAcordosID_DEVEDOR.AsInteger, []);
|
|
tblTitulos.Locate('ID_TITULO', tblAcordosID_ORIGINAL.AsInteger, []);
|
|
vl_pr := vl_pr + tblTitulosVL_TITULO.AsCurrency;
|
|
vl_j := vl_j + tblTitulosVL_JUROS.AsCurrency;
|
|
vl_m := vl_m + tblTitulosVL_MULTA.AsCurrency;
|
|
vl_enc := vl_enc + tblTitulosVL_ENCARGOS.AsCurrency;
|
|
vl_cor := vl_cor + tblTitulosVL_CORRIGIDO.AsCurrency;
|
|
tblAcordos.Next;
|
|
end;
|
|
tblAcordos.First;
|
|
while not tblAcordos.Eof do
|
|
begin
|
|
tblDevedores.Locate('ID_DEVEDOR',
|
|
tblAcordosID_DEVEDOR.AsInteger, []);
|
|
tblTitulos.Locate('ID_TITULO', tblAcordosID_ORIGINAL.AsInteger, []);
|
|
atraso := DaysBetween(tblTitulosDT_PAGAMENTO.AsDateTime,
|
|
tblTitulosDT_VENCIMENTO.AsDateTime);
|
|
tblCHGEmpresa.Locate('ID_EMPRESA',
|
|
tblTitulosID_EMPRESA.AsInteger, []);
|
|
|
|
mes := inttostr(strtoint(copy(FormatDateTime('yyyy-mm-dd',
|
|
tblTitulosDT_PAGAMENTO.AsDateTime), 6, 2)));
|
|
ano := copy(FormatDateTime('yyyy-mm-dd',
|
|
tblTitulosDT_PAGAMENTO.AsDateTime), 1, 4);
|
|
|
|
tblTitulos.Locate('ID_TITULO', tblAcordosID_PARCELA.AsInteger, []);
|
|
tblCHGEmpresa.Locate('ID_EMPRESA',
|
|
tblTitulosID_EMPRESA.AsInteger, []);
|
|
|
|
tblEmpresaRepasse.Locate('ID_MES;ID_ANO',
|
|
VarArrayOf([mes, ano]), []);
|
|
|
|
rotblRepasseFase.Close;
|
|
rotblRepasseFase.sql.Text :=
|
|
'select * from sys_repasses_fases where id_repasse = ' +
|
|
QuotedStr(tblEmpresaRepasseID_ITEM.AsString) +
|
|
' and min_atraso <= ' + inttostr(atraso) + ' and ' +
|
|
inttostr(atraso) + ' <= max_atraso';
|
|
rotblRepasseFase.Open;
|
|
|
|
if not rotblRepasseFase.IsEmpty then
|
|
begin
|
|
help_pr := (rotblRepasseFasePR_PRINCIPAL.AsCurrency / 100);
|
|
help_j := (rotblRepasseFasePR_JUROS.AsCurrency / 100);
|
|
help_m := (rotblRepasseFasePR_MULTA.AsCurrency / 100);
|
|
help_enc := (rotblRepasseFasePR_ENCARGOS.AsCurrency / 100);
|
|
help_cor := (rotblRepasseFasePR_CORRIGIDO.AsCurrency / 100);
|
|
end
|
|
else
|
|
begin
|
|
help_pr :=
|
|
(dtmSystem.tblEmpresaRepassePR_PRINCIPAL.AsCurrency / 100);
|
|
help_j := (dtmSystem.tblEmpresaRepassePR_JUROS.AsCurrency / 100);
|
|
help_m := (dtmSystem.tblEmpresaRepassePR_MULTA.AsCurrency / 100);
|
|
help_enc :=
|
|
(dtmSystem.tblEmpresaRepassePR_ENCARGOS.AsCurrency / 100);
|
|
help_cor :=
|
|
(dtmSystem.tblEmpresaRepassePR_CORRIGIDO.AsCurrency / 100);
|
|
end;
|
|
|
|
tblTitulos.Locate('ID_TITULO', tblAcordosID_ORIGINAL.AsInteger, []);
|
|
|
|
ac_pr[index] := tblTitulosVL_TITULO.AsCurrency * help_pr;
|
|
ac_j[index] := tblTitulosVL_JUROS.AsCurrency * help_j;
|
|
ac_m[index] := tblTitulosVL_MULTA.AsCurrency * help_m;
|
|
ac_enc[index] := tblTitulosVL_ENCARGOS.AsCurrency * help_enc;
|
|
ac_cor[index] := tblTitulosVL_CORRIGIDO.AsCurrency * help_cor;
|
|
|
|
{ if not tblRepasseFase.IsEmpty then
|
|
begin
|
|
ac_pr[index] := tblTitulosVL_TITULO.AsCurrency *
|
|
(dtmSystem.tblRepasseFasePR_PRINCIPAL.AsCurrency / 100);
|
|
ac_j[index] := tblTitulosVL_JUROS.AsCurrency *
|
|
(dtmSystem.tblRepasseFasePR_JUROS.AsCurrency / 100);
|
|
ac_m[index] := tblTitulosVL_MULTA.AsCurrency *
|
|
(dtmSystem.tblRepasseFasePR_MULTA.AsCurrency / 100);
|
|
ac_enc[index] := tblTitulosVL_ENCARGOS.AsCurrency *
|
|
(dtmSystem.tblRepasseFasePR_ENCARGOS.AsCurrency / 100);
|
|
ac_cor[index] := tblTitulosVL_CORRIGIDO.AsCurrency *
|
|
(dtmSystem.tblRepasseFasePR_CORRIGIDO.AsCurrency / 100);
|
|
end
|
|
else
|
|
begin
|
|
// ac_pr[index] := tblTitulosVL_TITULO.AsCurrency *
|
|
// (dtmSystem.tblRepassePR_PRINCIPAL.AsCurrency / 100);
|
|
// ac_j[index] := tblTitulosVL_JUROS.AsCurrency *
|
|
// (dtmSystem.tblRepassePR_JUROS.AsCurrency / 100);
|
|
// ac_m[index] := tblTitulosVL_MULTA.AsCurrency *
|
|
// (dtmSystem.tblRepassePR_MULTA.AsCurrency / 100);
|
|
// ac_enc[index] := tblTitulosVL_ENCARGOS.AsCurrency *
|
|
// (dtmSystem.tblRepassePR_ENCARGOS.AsCurrency / 100);
|
|
// ac_cor[index] := tblTitulosVL_CORRIGIDO.AsCurrency *
|
|
// (dtmSystem.tblRepassePR_CORRIGIDO.AsCurrency / 100);
|
|
ac_pr[index] := tblTitulosVL_TITULO.AsCurrency *
|
|
(dtmSystem.tblEmpresaRepassePR_PRINCIPAL.AsCurrency / 100);
|
|
ac_j[index] := tblTitulosVL_JUROS.AsCurrency *
|
|
(dtmSystem.tblEmpresaRepassePR_JUROS.AsCurrency / 100);
|
|
ac_m[index] := tblTitulosVL_MULTA.AsCurrency *
|
|
(dtmSystem.tblEmpresaRepassePR_MULTA.AsCurrency / 100);
|
|
ac_enc[index] := tblTitulosVL_ENCARGOS.AsCurrency *
|
|
(dtmSystem.tblEmpresaRepassePR_ENCARGOS.AsCurrency / 100);
|
|
ac_cor[index] := tblTitulosVL_CORRIGIDO.AsCurrency *
|
|
(dtmSystem.tblEmpresaRepassePR_CORRIGIDO.AsCurrency / 100);
|
|
end; }
|
|
if vl_pr <> 0 then
|
|
begin
|
|
pr_pr := pr_pr + ((ac_pr[index] * 100) / vl_pr);
|
|
end;
|
|
if vl_j <> 0 then
|
|
begin
|
|
pr_j := pr_j + ((ac_j[index] * 100) / vl_j);
|
|
end;
|
|
if vl_m <> 0 then
|
|
begin
|
|
pr_m := pr_m + ((ac_m[index] * 100) / vl_m);
|
|
end;
|
|
if vl_enc <> 0 then
|
|
begin
|
|
pr_enc := pr_enc + ((ac_enc[index] * 100) / vl_enc);
|
|
end;
|
|
if vl_cor <> 0 then
|
|
begin
|
|
pr_cor := pr_cor + ((ac_cor[index] * 100) / vl_cor);
|
|
end;
|
|
tblRepasseFase.Filtered := true;
|
|
Inc(index, 1);
|
|
tblAcordos.Next;
|
|
end;
|
|
|
|
pt_principal := (zroqryTitulosVL_TITULO.AsCurrency * pr_pr) / 100;
|
|
pt_juros := (zroqryTitulosVL_JUROS.AsCurrency * pr_j) / 100;
|
|
pt_multa := (zroqryTitulosVL_MULTA.AsCurrency * pr_m) / 100;
|
|
pt_encargos := (zroqryTitulosVL_ENCARGOS.AsCurrency * pr_enc) / 100;
|
|
pt_corrigido := (zroqryTitulosVL_CORRIGIDO.AsCurrency * pr_cor) / 100;
|
|
end
|
|
else
|
|
begin
|
|
tblDevedores.Locate('ID_DEVEDOR',
|
|
zroqryTitulosID_DEVEDOR.AsInteger, []);
|
|
tblTitulos.Locate('ID_TITULO', zroqryTitulosID_TITULO.AsInteger, []);
|
|
tblCHGEmpresa.Locate('ID_EMPRESA',
|
|
zroqryTitulosID_EMPRESA.AsInteger, []);
|
|
atraso := DaysBetween(tblTitulosDT_PAGAMENTO.AsDateTime,
|
|
tblTitulosDT_VENCIMENTO.AsDateTime);
|
|
mes := inttostr(strtoint(copy(FormatDateTime('yyyy-mm-dd',
|
|
tblTitulosDT_PAGAMENTO.AsDateTime), 6, 2)));
|
|
ano := copy(FormatDateTime('yyyy-mm-dd',
|
|
tblTitulosDT_PAGAMENTO.AsDateTime), 1, 4);
|
|
tblEmpresaRepasse.Locate('ID_MES;ID_ANO', VarArrayOf([mes, ano]), []);
|
|
rotblRepasseFase.Close;
|
|
rotblRepasseFase.sql.Text :=
|
|
'select * from sys_repasses_fases where id_repasse = ' +
|
|
QuotedStr(tblEmpresaRepasseID_ITEM.AsString) +
|
|
' and min_atraso <= ' + inttostr(atraso) + ' and ' +
|
|
inttostr(atraso) + ' <= max_atraso';
|
|
rotblRepasseFase.Open;
|
|
if not rotblRepasseFase.IsEmpty then
|
|
begin
|
|
pt_principal := zroqryTitulosVL_TITULO.AsCurrency *
|
|
(rotblRepasseFasePR_PRINCIPAL.AsCurrency / 100);
|
|
pt_juros := zroqryTitulosVL_JUROS.AsCurrency *
|
|
(rotblRepasseFasePR_JUROS.AsCurrency / 100);
|
|
pt_multa := zroqryTitulosVL_MULTA.AsCurrency *
|
|
(rotblRepasseFasePR_MULTA.AsCurrency / 100);
|
|
pt_encargos := zroqryTitulosVL_ENCARGOS.AsCurrency *
|
|
(rotblRepasseFasePR_ENCARGOS.AsCurrency / 100);
|
|
pt_corrigido := zroqryTitulosVL_CORRIGIDO.AsCurrency *
|
|
(rotblRepasseFasePR_CORRIGIDO.AsCurrency / 100);
|
|
end
|
|
else
|
|
begin
|
|
pt_principal := zroqryTitulosVL_TITULO.AsCurrency *
|
|
(dtmSystem.tblEmpresaRepassePR_PRINCIPAL.AsCurrency / 100);
|
|
pt_juros := zroqryTitulosVL_JUROS.AsCurrency *
|
|
(dtmSystem.tblEmpresaRepassePR_JUROS.AsCurrency / 100);
|
|
pt_multa := zroqryTitulosVL_MULTA.AsCurrency *
|
|
(dtmSystem.tblEmpresaRepassePR_MULTA.AsCurrency / 100);
|
|
pt_encargos := zroqryTitulosVL_ENCARGOS.AsCurrency *
|
|
(dtmSystem.tblEmpresaRepassePR_ENCARGOS.AsCurrency / 100);
|
|
pt_corrigido := zroqryTitulosVL_CORRIGIDO.AsCurrency *
|
|
(dtmSystem.tblEmpresaRepassePR_CORRIGIDO.AsCurrency / 100);
|
|
end;
|
|
end;
|
|
end;
|
|
zroqryTitulosVL_RETIDO.AsCurrency := pt_principal + pt_juros + pt_multa +
|
|
pt_encargos + pt_corrigido;
|
|
zroqryTitulosVL_REPASSE.AsCurrency := zroqryTitulosVL_CORRIGIDO.AsCurrency
|
|
- zroqryTitulosVL_RETIDO.AsCurrency;
|
|
end;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
end.
|