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.
73 lines
2.0 KiB
73 lines
2.0 KiB
unit uconfFichaHistorico;
|
|
|
|
interface
|
|
|
|
uses
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
|
|
System.Classes, Vcl.Graphics,
|
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, umstMaster, Vcl.ComCtrls, Vcl.StdCtrls;
|
|
|
|
type
|
|
TconfFichaHistorico = class(TmstMaster)
|
|
gb_data: TGroupBox;
|
|
Label1: TLabel;
|
|
dtp_inicio: TDateTimePicker;
|
|
dtp_fim: TDateTimePicker;
|
|
btn_viewreport: TButton;
|
|
Button1: TButton;
|
|
procedure FormCreate(Sender: TObject);
|
|
procedure btn_viewreportClick(Sender: TObject);
|
|
private
|
|
{ Private declarations }
|
|
public
|
|
id_devedor: string;
|
|
{ Public declarations }
|
|
end;
|
|
|
|
var
|
|
confFichaHistorico: TconfFichaHistorico;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
uses udtmSystem, urelHistorico;
|
|
|
|
procedure TconfFichaHistorico.btn_viewreportClick(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
with TrelHistorico.Create(self) do
|
|
begin
|
|
if dtmSystem.tblDevedoresTP_CLIENTE.AsString = 'F' then
|
|
begin
|
|
frlbl_documento.DataField := 'CD_CPF';
|
|
end;
|
|
if dtmSystem.tblDevedoresTP_CLIENTE.AsString = 'J' then
|
|
begin
|
|
frlbl_documento.DataField := 'CD_CNPJ';
|
|
end;
|
|
zroqryHistorico.SQL.Clear;
|
|
zroqryHistorico.SQL.Add('select * from chg_historico');
|
|
zroqryHistorico.SQL.Add(' where id_devedor = ' + id_devedor);
|
|
zroqryHistorico.SQL.Add('and');
|
|
zroqryHistorico.SQL.Add('CAST(dt_contato AS DATE) >= ' +
|
|
QuotedStr(FormatDateTime('mm/dd/yyyy', dtp_inicio.Date)));
|
|
zroqryHistorico.SQL.Add('and');
|
|
zroqryHistorico.SQL.Add('CAST(dt_contato AS DATE) <= ' +
|
|
QuotedStr(FormatDateTime('mm/dd/yyyy', dtp_fim.Date)));
|
|
zroqryHistorico.SQL.Add('order by dt_contato desc');
|
|
zroqryHistorico.Open;
|
|
frlbl_referente.Caption := frlbl_referente.Caption + FormatDateTime('dd/mm/yyyy',
|
|
dtp_inicio.Date) + ' a ' + FormatDateTime('dd/mm/yyyy', dtp_fim.Date);
|
|
relHistorico.Preview();
|
|
end;
|
|
end;
|
|
|
|
procedure TconfFichaHistorico.FormCreate(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
dtp_inicio.Date := Date;
|
|
dtp_fim.Date := Date;
|
|
end;
|
|
|
|
end.
|