Informes: poder elegir cualquier rango de fechas en los parámetros.

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@874 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
David Arranz 2009-01-23 11:10:00 +00:00
parent ae87e09b5b
commit 946b78e958
2 changed files with 40 additions and 22 deletions

View File

@ -286,6 +286,7 @@ inherited frViewPeriodoFechas: TfrViewPeriodoFechas
Properties.ImmediatePost = True
Properties.ImmediateUpdateText = True
Properties.Items.Strings = (
'Todas las fechas'
'Hoy'
'Ayer'
'Esta semana'

View File

@ -58,6 +58,7 @@ type
procedure SetFechaVenInicial(const Value: Variant);
public
procedure CualquierFecha(const ATipoFecha: TTipoFecha);
procedure Hoy(const ATipoFecha: TTipoFecha);
procedure Ayer(const ATipoFecha: TTipoFecha);
procedure EstaSemana(const ATipoFecha: TTipoFecha);
@ -277,16 +278,17 @@ end;
procedure TfrViewPeriodoFechas.cbPeriodo2PropertiesChange(Sender: TObject);
begin
case (Sender as TcxComboBox).ItemIndex of
0 : Hoy(TFechaVencimiento);
1 : Ayer(TFechaVencimiento);
2 : EstaSemana(TFechaVencimiento);
3 : EsteMes(TFechaVencimiento);
4 : EsteAno(TFechaVencimiento);
5 : Ultimos7dias(TFechaVencimiento);
6 : Ultimos30dias(TFechaVencimiento);
7 : Ultimos3meses(TFechaVencimiento);
8 : MesAnterior(TFechaVencimiento);
9 : AnoAnterior(TFechaVencimiento);
0 : CualquierFecha(TFechaVencimiento);
1 : Hoy(TFechaVencimiento);
2 : Ayer(TFechaVencimiento);
3 : EstaSemana(TFechaVencimiento);
4 : EsteMes(TFechaVencimiento);
5 : EsteAno(TFechaVencimiento);
6 : Ultimos7dias(TFechaVencimiento);
7 : Ultimos30dias(TFechaVencimiento);
8 : Ultimos3meses(TFechaVencimiento);
9 : MesAnterior(TFechaVencimiento);
10 : AnoAnterior(TFechaVencimiento);
else
Personalizado(TFechaVencimiento);
end;
@ -295,16 +297,17 @@ end;
procedure TfrViewPeriodoFechas.cbPeriodoPropertiesChange(Sender: TObject);
begin
case (Sender as TcxComboBox).ItemIndex of
0 : Hoy(TFecha);
1 : Ayer(TFecha);
2 : EstaSemana(TFecha);
3 : EsteMes(TFecha);
4 : EsteAno(TFecha);
5 : Ultimos7dias(TFecha);
6 : Ultimos30dias(TFecha);
7 : Ultimos3meses(TFecha);
8 : MesAnterior(TFecha);
9 : AnoAnterior(TFecha);
0 : CualquierFecha(TFecha);
1 : Hoy(TFecha);
2 : Ayer(TFecha);
3 : EstaSemana(TFecha);
4 : EsteMes(TFecha);
5 : EsteAno(TFecha);
6 : Ultimos7dias(TFecha);
7 : Ultimos30dias(TFecha);
8 : Ultimos3meses(TFecha);
9 : MesAnterior(TFecha);
10 : AnoAnterior(TFecha);
else
Personalizado(TFecha);
end;
@ -313,11 +316,25 @@ end;
constructor TfrViewPeriodoFechas.Create(AOwner: TComponent);
begin
inherited;
cbPeriodo.ItemIndex := -1;
cbPeriodo2.ItemIndex := -1;
cbPeriodo.ItemIndex := 0;
cbPeriodo2.ItemIndex := 0;
// EsteMes(TFecha);
end;
procedure TfrViewPeriodoFechas.CualquierFecha(const ATipoFecha: TTipoFecha);
begin
case ATipoFecha of
TFecha: begin
edtFechaIni.Clear;
edtFechaFin.Clear;
end;
TFechaVencimiento: begin
edtFechaVenIni.Clear;
edtFechaVenFin.Clear;
end;
end;
end;
procedure TfrViewPeriodoFechas.edtFechaIni2PropertiesValidate(
Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption;
var Error: Boolean);