Se añade la posiblidad de filtrar los presupuestos entre facturados y no facturados

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@609 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
roberto 2008-09-23 15:38:22 +00:00
parent 33bb03ed57
commit 02017c27da
2 changed files with 123 additions and 3 deletions

View File

@ -1,6 +1,8 @@
inherited frViewPresupuestosCliente: TfrViewPresupuestosCliente inherited frViewPresupuestosCliente: TfrViewPresupuestosCliente
Width = 903 Width = 903
Height = 525 Height = 525
OnDestroy = CustomViewDestroy
OnShow = CustomViewShow
ExplicitWidth = 903 ExplicitWidth = 903
ExplicitHeight = 525 ExplicitHeight = 525
inherited cxGrid: TcxGrid inherited cxGrid: TcxGrid
@ -152,19 +154,55 @@ inherited frViewPresupuestosCliente: TfrViewPresupuestosCliente
Width = 903 Width = 903
ExplicitWidth = 903 ExplicitWidth = 903
inherited txtFiltroTodo: TcxTextEdit inherited txtFiltroTodo: TcxTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 806 ExplicitWidth = 806
Width = 806 Width = 806
end end
inherited edtFechaIniFiltro: TcxDateEdit inherited edtFechaIniFiltro: TcxDateEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 285 ExplicitWidth = 285
Width = 285 Width = 285
end end
inherited edtFechaFinFiltro: TcxDateEdit inherited edtFechaFinFiltro: TcxDateEdit
Left = 389 Left = 308
ExplicitLeft = 389 Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 308
ExplicitWidth = 504 ExplicitWidth = 504
Width = 504 Width = 504
end end
inherited eLista: TcxComboBox
Left = 733
Properties.OnChange = nil
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 733
ExplicitWidth = 215
Width = 215
end
inherited dxLayoutControl1Group_Root: TdxLayoutGroup
inherited dxLayoutControl1Group1: TdxLayoutGroup
inherited dxLayoutControl1Item2: TdxLayoutItem
AlignHorz = ahClient
end
inherited dxLayoutControl1Item3: TdxLayoutItem
AlignHorz = ahClient
end
inherited dxLayoutControl1Item4: TdxLayoutItem
Visible = True
end
end
end
end end
inherited TBXAlignmentPanel1: TTBXAlignmentPanel inherited TBXAlignmentPanel1: TTBXAlignmentPanel
Width = 903 Width = 903
@ -178,6 +216,11 @@ inherited frViewPresupuestosCliente: TfrViewPresupuestosCliente
inherited dxLayoutLookAndFeelList1: TdxLayoutLookAndFeelList inherited dxLayoutLookAndFeelList1: TdxLayoutLookAndFeelList
Left = 56 Left = 56
end end
inherited ActionList1: TActionList
inherited actQuitarFiltro: TAction
OnExecute = frViewFiltroBase1actQuitarFiltroExecute
end
end
end end
inherited pnlAgrupaciones: TTBXDockablePanel inherited pnlAgrupaciones: TTBXDockablePanel
Top = 499 Top = 499

View File

@ -12,7 +12,7 @@ uses
uDADataTable, cxGridLevel, cxClasses, cxControls, cxGridCustomView, Classes, uDADataTable, cxGridLevel, cxClasses, cxControls, cxGridCustomView, Classes,
cxGrid, uBizPresupuestosCliente, cxCurrencyEdit, Forms, uViewFiltroBase, ActnList, TB2Item, cxGrid, uBizPresupuestosCliente, cxCurrencyEdit, Forms, uViewFiltroBase, ActnList, TB2Item,
TBX, TB2Toolbar, TBXDkPanels, TB2Dock, dxPgsDlg, uDAInterfaces, Windows; TBX, TB2Toolbar, TBXDkPanels, TB2Dock, dxPgsDlg, uDAInterfaces, Windows;
type type
IViewPresupuestosCliente = interface(IViewGrid) IViewPresupuestosCliente = interface(IViewGrid)
['{96821714-55CF-4BC1-A0C1-16E027B2EF16}'] ['{96821714-55CF-4BC1-A0C1-16E027B2EF16}']
@ -66,11 +66,17 @@ type
procedure cxGridViewDataControllerCompare( procedure cxGridViewDataControllerCompare(
ADataController: TcxCustomDataController; ARecordIndex1, ARecordIndex2, ADataController: TcxCustomDataController; ARecordIndex1, ARecordIndex2,
AItemIndex: Integer; const V1, V2: Variant; var Compare: Integer); AItemIndex: Integer; const V1, V2: Variant; var Compare: Integer);
procedure OnFiltroListaPropertiesChange(Sender: TObject);
procedure OnFiltroListaPropertiesInitPopup(Sender: TObject);
procedure CustomViewDestroy(Sender: TObject);
procedure CustomViewShow(Sender: TObject);
procedure frViewFiltroBase1actQuitarFiltroExecute(Sender: TObject);
private private
//Filtros relativos a la vista //Filtros relativos a la vista
procedure AnadirFiltroSituaciones; procedure AnadirFiltroSituaciones;
procedure AnadirFiltroFechas; procedure AnadirFiltroFechas;
procedure AnadirFiltroFacturado;
protected protected
FPresupuestos: IBizPresupuestoCliente; FPresupuestos: IBizPresupuestoCliente;
@ -153,6 +159,31 @@ begin
end; end;
end; end;
procedure TfrViewPresupuestosCliente.AnadirFiltroFacturado;
var
FFiltro : TcxFilterCriteriaItemList;
Index: Integer;
begin
//Solo se aplica este filtro en el caso de tener activo el panel de detalle de filtro
//y sobre la lista de articulos detallada por proveedor
if frViewFiltroBase1.Visible then
begin
case frViewFiltroBase1.eLista.ItemIndex of
//Sin facturar
1 : begin
FFiltro := AddFilterGrid(fboAnd);
FFiltro.AddItem(cxGridViewFACTURA, foEqual, NULL, 'NoFacturado');
end;
//Facturados
2: begin
FFiltro := AddFilterGrid(fboAnd);
FFiltro.AddItem(cxGridViewFACTURA, foNotEqual, NULL, 'Facturado');
end;
end;
end;
end;
procedure TfrViewPresupuestosCliente.AnadirFiltroSituaciones; procedure TfrViewPresupuestosCliente.AnadirFiltroSituaciones;
var var
FFiltro : TcxFilterCriteriaItemList; FFiltro : TcxFilterCriteriaItemList;
@ -172,6 +203,7 @@ begin
AnadirFiltroSituaciones; AnadirFiltroSituaciones;
AnadirFiltroFechas; AnadirFiltroFechas;
AnadirFiltroFacturado;
//Finalmente activamos el filtro si tenemos algo //Finalmente activamos el filtro si tenemos algo
if cxGridView.DataController.Filter.IsEmpty then if cxGridView.DataController.Filter.IsEmpty then
@ -181,6 +213,20 @@ begin
cxGrid.ActiveLevel.GridView := cxGridView; cxGrid.ActiveLevel.GridView := cxGridView;
end; end;
procedure TfrViewPresupuestosCliente.CustomViewDestroy(Sender: TObject);
begin
frViewFiltroBase1.eLista.Properties.OnChange := Nil;
frViewFiltroBase1.eLista.Properties.OnInitPopup := Nil;
inherited;
end;
procedure TfrViewPresupuestosCliente.CustomViewShow(Sender: TObject);
begin
inherited;
frViewFiltroBase1.eLista.Properties.OnChange := OnFiltroListaPropertiesChange;
frViewFiltroBase1.eLista.Properties.OnInitPopup := OnFiltroListaPropertiesInitPopup;
end;
procedure TfrViewPresupuestosCliente.cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel: TcxGridLevel); procedure TfrViewPresupuestosCliente.cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel: TcxGridLevel);
begin begin
inherited; inherited;
@ -252,6 +298,37 @@ begin
end; end;
end; end;
procedure TfrViewPresupuestosCliente.frViewFiltroBase1actQuitarFiltroExecute(Sender: TObject);
begin
frViewFiltroBase1.txtFiltroTodo.Clear;
frViewFiltroBase1.eLista.Clear;
end;
procedure TfrViewPresupuestosCliente.OnFiltroListaPropertiesChange(Sender: TObject);
begin
inherited;
RefrescarFiltro;
end;
procedure TfrViewPresupuestosCliente.OnFiltroListaPropertiesInitPopup(Sender: TObject);
begin
inherited;
with frViewFiltroBase1.eLista.Properties.Items do
begin
BeginUpdate;
try
Clear;
Add('Todos'); //Case 0
Add('Sin facturar'); //Case 1
Add('Facturados'); //Case 2
frViewFiltroBase1.eLista.ItemIndex := 0;
finally
EndUpdate;
end;
end;
end;
function TfrViewPresupuestosCliente.GetPresupuestos: IBizPresupuestoCliente; function TfrViewPresupuestosCliente.GetPresupuestos: IBizPresupuestoCliente;
begin begin
Result := FPresupuestos; Result := FPresupuestos;