2007-10-26 18:19:55 +00:00
|
|
|
|
unit uViewPresupuestosCliente;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
uViewGrid, cxStyles, cxCustomData, cxGraphics, cxFilter,
|
|
|
|
|
|
cxData, cxDataStorage, cxEdit, DB, cxDBData, dxPSGlbl, dxPSUtl, dxPSEngn,
|
|
|
|
|
|
dxPrnPg, dxBkgnd, dxWrap, dxPrnDev, dxPSCompsProvider, dxPSFillPatterns,
|
|
|
|
|
|
dxPSEdgePatterns, cxImageComboBox, ImgList, Controls, PngImageList,
|
|
|
|
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
|
2008-01-04 11:16:59 +00:00
|
|
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, dxPSCore, dxPScxCommon, dxPScxGrid6Lnk,
|
2007-10-26 18:19:55 +00:00
|
|
|
|
uDADataTable, cxGridLevel, cxClasses, cxControls, cxGridCustomView, Classes,
|
2008-08-27 16:48:20 +00:00
|
|
|
|
cxGrid, uBizPresupuestosCliente, cxCurrencyEdit, Forms, uViewFiltroBase, ActnList, TB2Item,
|
2014-02-18 22:41:52 +00:00
|
|
|
|
TBX, TB2Toolbar, TBXDkPanels, TB2Dock, dxPgsDlg, uDAInterfaces, Windows,
|
|
|
|
|
|
uCustomView, uViewBase;
|
2008-09-23 15:38:22 +00:00
|
|
|
|
|
2007-10-26 18:19:55 +00:00
|
|
|
|
type
|
|
|
|
|
|
IViewPresupuestosCliente = interface(IViewGrid)
|
|
|
|
|
|
['{96821714-55CF-4BC1-A0C1-16E027B2EF16}']
|
2007-11-05 17:49:11 +00:00
|
|
|
|
function GetPresupuestos: IBizPresupuestoCliente;
|
|
|
|
|
|
procedure SetPresupuestos(const Value: IBizPresupuestoCliente);
|
|
|
|
|
|
property Presupuestos: IBizPresupuestoCliente read GetPresupuestos write SetPresupuestos;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
TfrViewPresupuestosCliente = class(TfrViewGrid, IViewPresupuestosCliente)
|
|
|
|
|
|
cxGridDBTableView1: TcxGridDBTableView;
|
|
|
|
|
|
cxGridViewREFERENCIA: TcxGridDBColumn;
|
|
|
|
|
|
cxGridViewINCIDENCIASACTIVAS: TcxGridDBColumn;
|
|
|
|
|
|
cxGridViewNOMBRE: TcxGridDBColumn;
|
|
|
|
|
|
cxGridViewSITUACION: TcxGridDBColumn;
|
2007-11-05 17:49:11 +00:00
|
|
|
|
cxGridViewFECHA_PRESUPUESTO: TcxGridDBColumn;
|
|
|
|
|
|
cxGridViewCLIENTE_FINAL: TcxGridDBColumn;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
cxGridViewIMPORTE_TOTAL: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevelPendientes: TcxGridLevel;
|
2022-06-23 10:11:48 +00:00
|
|
|
|
cxGridLevelAceptados: TcxGridLevel;
|
|
|
|
|
|
cxGridLevelAnulados: TcxGridLevel;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
cxStylePENDIENTES: TcxStyle;
|
2008-05-20 18:50:02 +00:00
|
|
|
|
cxStyleACEPTADO: TcxStyle;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
actCliente: TAction;
|
|
|
|
|
|
actProvincia: TAction;
|
|
|
|
|
|
TBXItem2: TTBXItem;
|
|
|
|
|
|
TBXSeparatorItem1: TTBXSeparatorItem;
|
|
|
|
|
|
TBXSeparatorItem2: TTBXSeparatorItem;
|
|
|
|
|
|
TBXItem3: TTBXItem;
|
2007-11-05 17:49:11 +00:00
|
|
|
|
cxGridViewFECHA_DECISION: TcxGridDBColumn;
|
|
|
|
|
|
cxGridViewNIF_CIF: TcxGridDBColumn;
|
2008-01-04 17:21:05 +00:00
|
|
|
|
cxGridViewINCIDENCIAS: TcxGridDBColumn;
|
2008-05-20 18:50:02 +00:00
|
|
|
|
cxStyleRECHAZADO: TcxStyle;
|
2014-02-18 22:41:52 +00:00
|
|
|
|
cxGridViewCERTIFICADO_ISO: TcxGridDBColumn;
|
2015-02-18 11:09:41 +00:00
|
|
|
|
cxGridViewNUM_FACTURAS: TcxGridDBColumn;
|
2015-06-23 15:52:26 +00:00
|
|
|
|
cxGridViewPRESUPUESTO_WEB: TcxGridDBColumn;
|
2022-06-23 10:11:48 +00:00
|
|
|
|
cxGridViewSIN_PEDIDO: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevelParciales: TcxGridLevel;
|
|
|
|
|
|
cxGridLevelTotales: TcxGridLevel;
|
|
|
|
|
|
cxStyleFACTURADOS: TcxStyle;
|
|
|
|
|
|
cxStylePARCIAL: TcxStyle;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
procedure cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel:
|
|
|
|
|
|
TcxGridLevel);
|
|
|
|
|
|
procedure cxGridViewStylesGetContentStyle(Sender: TcxCustomGridTableView;
|
|
|
|
|
|
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out
|
|
|
|
|
|
AStyle: TcxStyle);
|
|
|
|
|
|
procedure actClienteExecute(Sender: TObject);
|
|
|
|
|
|
procedure actClienteUpdate(Sender: TObject);
|
|
|
|
|
|
procedure actProvinciaExecute(Sender: TObject);
|
|
|
|
|
|
procedure actProvinciaUpdate(Sender: TObject);
|
2008-05-20 18:50:02 +00:00
|
|
|
|
procedure cxGridViewICONOCustomDrawCell(Sender: TcxCustomGridTableView;
|
2007-12-12 18:35:18 +00:00
|
|
|
|
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
|
|
|
|
|
var ADone: Boolean);
|
2008-05-20 18:50:02 +00:00
|
|
|
|
procedure cxGridViewINCIDENCIASACTIVASGetCellHint(
|
|
|
|
|
|
Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
|
|
|
|
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; const AMousePos: TPoint;
|
|
|
|
|
|
var AHintText: TCaption; var AIsHintMultiLine: Boolean;
|
|
|
|
|
|
var AHintTextRect: TRect);
|
2008-06-03 11:15:51 +00:00
|
|
|
|
procedure cxGridViewDataControllerCompare(
|
|
|
|
|
|
ADataController: TcxCustomDataController; ARecordIndex1, ARecordIndex2,
|
|
|
|
|
|
AItemIndex: Integer; const V1, V2: Variant; var Compare: Integer);
|
2008-09-23 15:38:22 +00:00
|
|
|
|
procedure OnFiltroListaPropertiesChange(Sender: TObject);
|
|
|
|
|
|
procedure OnFiltroListaPropertiesInitPopup(Sender: TObject);
|
2014-02-18 22:41:52 +00:00
|
|
|
|
procedure OnFiltroListaISOPropertiesChange(Sender: TObject);
|
|
|
|
|
|
procedure OnFiltroListaISOPropertiesInitPopup(Sender: TObject);
|
|
|
|
|
|
|
2008-09-23 15:38:22 +00:00
|
|
|
|
procedure CustomViewDestroy(Sender: TObject);
|
|
|
|
|
|
procedure CustomViewShow(Sender: TObject);
|
|
|
|
|
|
procedure frViewFiltroBase1actQuitarFiltroExecute(Sender: TObject);
|
2007-10-26 18:19:55 +00:00
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
//Filtros relativos a la vista
|
|
|
|
|
|
procedure AnadirFiltroSituaciones;
|
|
|
|
|
|
procedure AnadirFiltroFechas;
|
2015-02-05 17:51:58 +00:00
|
|
|
|
// procedure AnadirFiltroFacturado;
|
2014-02-18 22:41:52 +00:00
|
|
|
|
procedure AnadirFiltroISO;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
|
|
|
|
|
|
protected
|
2007-11-05 17:49:11 +00:00
|
|
|
|
FPresupuestos: IBizPresupuestoCliente;
|
|
|
|
|
|
function GetPresupuestos: IBizPresupuestoCliente;
|
|
|
|
|
|
procedure SetPresupuestos(const Value: IBizPresupuestoCliente);
|
2007-10-26 18:19:55 +00:00
|
|
|
|
public
|
|
|
|
|
|
procedure AnadirOtrosFiltros; override;
|
2007-11-05 17:49:11 +00:00
|
|
|
|
property Presupuestos: IBizPresupuestoCliente read GetPresupuestos write SetPresupuestos;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
2008-01-04 17:21:05 +00:00
|
|
|
|
uses
|
|
|
|
|
|
SysUtils, variants, uDataModulePresupuestosCliente, schPresupuestosClienteClient_Intf,
|
2015-02-18 11:09:41 +00:00
|
|
|
|
uViewGridBase, uReferenciasUtils, cxVariants, uStringsUtils;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewPresupuestosCliente.actClienteExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if (cxGridViewNOMBRE.GroupIndex < 0) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
cxGridViewNOMBRE.GroupIndex := cxGridView.GroupedColumnCount;
|
|
|
|
|
|
cxGridViewNOMBRE.Visible := False;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
cxGridViewNOMBRE.GroupIndex := -1;
|
|
|
|
|
|
cxGridViewNOMBRE.Visible := True;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewPresupuestosCliente.actClienteUpdate(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
(Sender as TAction).Checked := not (cxGridViewNOMBRE.GroupIndex < 0);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewPresupuestosCliente.actProvinciaExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
2007-11-05 17:49:11 +00:00
|
|
|
|
{
|
2007-10-26 18:19:55 +00:00
|
|
|
|
if (cxGridViewPROVINCIA.GroupIndex < 0) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
cxGridViewPROVINCIA.GroupIndex := cxGridView.GroupedColumnCount;
|
|
|
|
|
|
cxGridViewPROVINCIA.Visible := False;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
cxGridViewPROVINCIA.GroupIndex := -1;
|
|
|
|
|
|
cxGridViewPROVINCIA.Visible := True;
|
|
|
|
|
|
end;
|
2007-11-05 17:49:11 +00:00
|
|
|
|
}
|
2007-10-26 18:19:55 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewPresupuestosCliente.actProvinciaUpdate(Sender: TObject);
|
|
|
|
|
|
begin
|
2007-11-05 17:49:11 +00:00
|
|
|
|
{
|
2007-10-26 18:19:55 +00:00
|
|
|
|
inherited;
|
|
|
|
|
|
(Sender as TAction).Checked := not (cxGridViewPROVINCIA.GroupIndex < 0);
|
2007-11-05 17:49:11 +00:00
|
|
|
|
}
|
2007-10-26 18:19:55 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewPresupuestosCliente.AnadirFiltroFechas;
|
|
|
|
|
|
var
|
|
|
|
|
|
Columna: TcxGridDBColumn;
|
|
|
|
|
|
Fecha1, Fecha2: Variant;
|
|
|
|
|
|
FFiltro : TcxFilterCriteriaItemList;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Fecha1 := frViewFiltroBase1.edtFechaIniFiltro.EditValue;
|
|
|
|
|
|
Fecha2 := frViewFiltroBase1.edtFechaFinFiltro.EditValue;
|
|
|
|
|
|
|
|
|
|
|
|
if not VarIsNull(Fecha1)
|
|
|
|
|
|
and not VarIsNull(Fecha2) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
cxGridView.DataController.Filter.Options := [fcoCaseInsensitive, fcoSoftCompare];
|
|
|
|
|
|
FFiltro := AddFilterGrid(fboAnd);
|
|
|
|
|
|
|
2007-11-05 17:49:11 +00:00
|
|
|
|
Columna := (cxGridView as TcxGridDBTableView).GetColumnByFieldName('FECHA_Presupuesto');
|
2007-10-26 18:19:55 +00:00
|
|
|
|
FFiltro.AddItem(Columna, foBetween, varArrayOf([Fecha1, Fecha2]), VarToStr(Fecha1) + ' and ' + VarToStr(Fecha2));
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2014-02-18 22:41:52 +00:00
|
|
|
|
procedure TfrViewPresupuestosCliente.AnadirFiltroISO;
|
|
|
|
|
|
var
|
|
|
|
|
|
FFiltro : TcxFilterCriteriaItemList;
|
|
|
|
|
|
begin
|
|
|
|
|
|
//Solo se aplica este filtro en el caso de tener activo el panel de detalle de filtro
|
|
|
|
|
|
//y sobre la lista de presupuestos de cliente
|
|
|
|
|
|
if frViewFiltroBase1.Visible then
|
|
|
|
|
|
begin
|
|
|
|
|
|
case frViewFiltroBase1.eLista2.ItemIndex of
|
|
|
|
|
|
//Con ISO
|
|
|
|
|
|
1 : begin
|
|
|
|
|
|
FFiltro := AddFilterGrid(fboAnd);
|
|
|
|
|
|
FFiltro.AddItem(cxGridViewCERTIFICADO_ISO, foEqual, '1', 'ConISO');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
//SIN ISO
|
|
|
|
|
|
2: begin
|
|
|
|
|
|
FFiltro := AddFilterGrid(fboAnd);
|
|
|
|
|
|
FFiltro.AddItem(cxGridViewCERTIFICADO_ISO, foEqual, '0', 'SinISO');
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2015-02-05 17:51:58 +00:00
|
|
|
|
{
|
2008-09-23 15:38:22 +00:00
|
|
|
|
procedure TfrViewPresupuestosCliente.AnadirFiltroFacturado;
|
|
|
|
|
|
var
|
|
|
|
|
|
FFiltro : TcxFilterCriteriaItemList;
|
|
|
|
|
|
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;
|
2015-02-05 17:51:58 +00:00
|
|
|
|
}
|
2008-09-23 15:38:22 +00:00
|
|
|
|
|
2007-10-26 18:19:55 +00:00
|
|
|
|
procedure TfrViewPresupuestosCliente.AnadirFiltroSituaciones;
|
|
|
|
|
|
var
|
|
|
|
|
|
FFiltro : TcxFilterCriteriaItemList;
|
|
|
|
|
|
begin
|
|
|
|
|
|
FFiltro := AddFilterGrid(fboAnd);
|
|
|
|
|
|
|
|
|
|
|
|
case cxGrid.ActiveLevel.Index of
|
2007-11-05 17:49:11 +00:00
|
|
|
|
1 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, SITUACION_PRESUPUESTO_PENDIENTE, SITUACION_PRESUPUESTO_PENDIENTE);
|
|
|
|
|
|
2 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, SITUACION_PRESUPUESTO_ACEPTADO, SITUACION_PRESUPUESTO_ACEPTADO);
|
|
|
|
|
|
3 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, SITUACION_PRESUPUESTO_ANULADO, SITUACION_PRESUPUESTO_ANULADO);
|
2022-06-23 10:11:48 +00:00
|
|
|
|
4 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, SITUACION_PRESUPUESTO_PARCIAL, SITUACION_PRESUPUESTO_PARCIAL);
|
|
|
|
|
|
5 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, SITUACION_PRESUPUESTO_TOTAL, SITUACION_PRESUPUESTO_TOTAL);
|
2007-10-26 18:19:55 +00:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewPresupuestosCliente.AnadirOtrosFiltros;
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
|
|
|
|
|
|
AnadirFiltroSituaciones;
|
|
|
|
|
|
AnadirFiltroFechas;
|
2015-02-05 17:51:58 +00:00
|
|
|
|
// AnadirFiltroFacturado;
|
2014-02-18 22:41:52 +00:00
|
|
|
|
AnadirFiltroISO;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
|
|
|
|
|
|
//Finalmente activamos el filtro si tenemos algo
|
2008-01-13 22:05:03 +00:00
|
|
|
|
if cxGridView.DataController.Filter.IsEmpty then
|
|
|
|
|
|
cxGridView.DataController.Filter.Active := False
|
|
|
|
|
|
else
|
|
|
|
|
|
cxGridView.DataController.Filter.Active := True;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
cxGrid.ActiveLevel.GridView := cxGridView;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2008-09-23 15:38:22 +00:00
|
|
|
|
procedure TfrViewPresupuestosCliente.CustomViewDestroy(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
frViewFiltroBase1.eLista.Properties.OnChange := Nil;
|
2014-02-18 22:41:52 +00:00
|
|
|
|
frViewFiltroBase1.eLista.Properties.OnInitPopup := Nil;
|
|
|
|
|
|
frViewFiltroBase1.eLista2.Properties.OnChange := Nil;
|
|
|
|
|
|
frViewFiltroBase1.eLista2.Properties.OnInitPopup := Nil;
|
|
|
|
|
|
|
2008-09-23 15:38:22 +00:00
|
|
|
|
inherited;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewPresupuestosCliente.CustomViewShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
frViewFiltroBase1.eLista.Properties.OnChange := OnFiltroListaPropertiesChange;
|
|
|
|
|
|
frViewFiltroBase1.eLista.Properties.OnInitPopup := OnFiltroListaPropertiesInitPopup;
|
2014-02-18 22:41:52 +00:00
|
|
|
|
frViewFiltroBase1.eLista2.Properties.OnChange := OnFiltroListaISOPropertiesChange;
|
|
|
|
|
|
frViewFiltroBase1.eLista2.Properties.OnInitPopup := OnFiltroListaISOPropertiesInitPopup;
|
2008-09-23 15:38:22 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
2007-10-26 18:19:55 +00:00
|
|
|
|
procedure TfrViewPresupuestosCliente.cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel: TcxGridLevel);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
RefrescarFiltro;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2008-06-03 11:15:51 +00:00
|
|
|
|
procedure TfrViewPresupuestosCliente.cxGridViewDataControllerCompare(
|
|
|
|
|
|
ADataController: TcxCustomDataController; ARecordIndex1, ARecordIndex2,
|
|
|
|
|
|
AItemIndex: Integer; const V1, V2: Variant; var Compare: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
if (AItemIndex = cxGridViewREFERENCIA.Index) and
|
|
|
|
|
|
(VarType(V1) = VarType(V2)) and (VarType(V1) = varString) then
|
|
|
|
|
|
Compare := CompararReferencias(V1, V2)
|
|
|
|
|
|
else
|
|
|
|
|
|
Compare := VarCompare(V1, V2);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2008-05-20 18:50:02 +00:00
|
|
|
|
procedure TfrViewPresupuestosCliente.cxGridViewICONOCustomDrawCell(
|
2007-12-12 18:35:18 +00:00
|
|
|
|
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
|
|
|
|
|
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
2014-02-18 22:41:52 +00:00
|
|
|
|
var
|
|
|
|
|
|
R : TRect;
|
2007-12-12 18:35:18 +00:00
|
|
|
|
begin
|
2014-02-18 22:41:52 +00:00
|
|
|
|
inherited;
|
|
|
|
|
|
R := AViewInfo.ContentBounds;
|
2007-12-12 18:35:18 +00:00
|
|
|
|
ACanvas.FillRect(R);
|
2008-01-04 17:21:05 +00:00
|
|
|
|
|
|
|
|
|
|
if (cxGridView.DataController.DisplayTexts[AViewInfo.GridRecord.RecordIndex,
|
2014-02-18 22:41:52 +00:00
|
|
|
|
cxGridViewINCIDENCIASACTIVAS.Index] <> 'Sin incidencias') then
|
|
|
|
|
|
ACanvas.DrawImage(GridPNGImageList, R.Left + 2, R.Top + 2, 2)
|
|
|
|
|
|
else if (cxGridView.DataController.DisplayTexts[AViewInfo.GridRecord.RecordIndex,
|
|
|
|
|
|
cxGridViewCERTIFICADO_ISO.Index] = 'ISO') then
|
|
|
|
|
|
ACanvas.DrawImage(GridPNGImageList, R.Left + 2, R.Top + 2, 4)
|
2008-01-04 17:21:05 +00:00
|
|
|
|
else
|
2014-02-18 22:41:52 +00:00
|
|
|
|
ACanvas.DrawImage(GridPNGImageList, R.Left + 2, R.Top + 2, 1);
|
|
|
|
|
|
|
|
|
|
|
|
ADone := True;
|
2007-12-12 18:35:18 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
2008-05-20 18:50:02 +00:00
|
|
|
|
procedure TfrViewPresupuestosCliente.cxGridViewINCIDENCIASACTIVASGetCellHint(
|
2008-01-04 17:21:05 +00:00
|
|
|
|
Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
|
|
|
|
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; const AMousePos: TPoint;
|
|
|
|
|
|
var AHintText: TCaption; var AIsHintMultiLine: Boolean;
|
|
|
|
|
|
var AHintTextRect: TRect);
|
2007-10-26 18:19:55 +00:00
|
|
|
|
begin
|
2008-01-04 17:21:05 +00:00
|
|
|
|
inherited;
|
2008-05-20 18:50:02 +00:00
|
|
|
|
if (ARecord.DisplayTexts[Sender.Index] <> 'Sin incidencias') then
|
2008-01-04 17:21:05 +00:00
|
|
|
|
begin
|
|
|
|
|
|
AIsHintMultiLine := True;
|
2014-02-18 22:41:52 +00:00
|
|
|
|
if not VarIsNull(ARecord.Values[cxGridViewINCIDENCIAS.Index]) then
|
|
|
|
|
|
AHintText := ARecord.Values[cxGridViewINCIDENCIAS.Index];
|
2007-10-26 18:19:55 +00:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewPresupuestosCliente.cxGridViewStylesGetContentStyle(Sender:
|
|
|
|
|
|
TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem:
|
|
|
|
|
|
TcxCustomGridTableItem; out AStyle: TcxStyle);
|
|
|
|
|
|
var
|
|
|
|
|
|
IndiceCol: Integer;
|
|
|
|
|
|
ASituacion: string;
|
2015-02-18 11:09:41 +00:00
|
|
|
|
AFacturas: string;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
if Assigned(ARecord) then
|
|
|
|
|
|
begin
|
2007-11-05 17:49:11 +00:00
|
|
|
|
IndiceCol := (Sender as TcxGridDBTableView).GetColumnByFieldName(fld_PresupuestosClienteSITUACION).Index;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
ASituacion := VarToStr(ARecord.DisplayTexts[IndiceCol]);
|
2007-11-05 17:49:11 +00:00
|
|
|
|
if ASituacion = SITUACION_PRESUPUESTO_PENDIENTE then
|
2008-05-20 18:50:02 +00:00
|
|
|
|
AStyle.TextColor := cxStylePENDIENTES.TextColor
|
2007-11-05 17:49:11 +00:00
|
|
|
|
else if ASituacion = SITUACION_PRESUPUESTO_ACEPTADO then
|
2022-06-23 10:11:48 +00:00
|
|
|
|
AStyle.TextColor := cxStyleACEPTADO.TextColor
|
|
|
|
|
|
else if ASituacion = SITUACION_PRESUPUESTO_TOTAL then
|
|
|
|
|
|
AStyle.TextColor := cxStyleFACTURADOS.TextColor
|
|
|
|
|
|
else if ASituacion = SITUACION_PRESUPUESTO_PARCIAL then
|
|
|
|
|
|
AStyle.TextColor := cxStylePARCIAL.TextColor
|
|
|
|
|
|
else if ASituacion = SITUACION_PRESUPUESTO_ANULADO then
|
|
|
|
|
|
AStyle.TextColor := cxStyleRECHAZADO.TextColor;
|
|
|
|
|
|
|
2015-02-18 11:09:41 +00:00
|
|
|
|
//Si est<73> aceptado y no facturado que resalte
|
2022-06-23 10:11:48 +00:00
|
|
|
|
{ IndiceCol := (Sender as TcxGridDBTableView).GetColumnByFieldName(fld_PresupuestosClienteNUM_FACTURA).Index;
|
2015-02-18 11:09:41 +00:00
|
|
|
|
AFacturas := VarToStr(ARecord.DisplayTexts[IndiceCol]);
|
|
|
|
|
|
if EsCadenaVacia(AFacturas) then
|
|
|
|
|
|
AStyle.TextColor := cxStyleConFacturas.TextColor;
|
2022-06-23 10:11:48 +00:00
|
|
|
|
}
|
2007-10-26 18:19:55 +00:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2008-09-23 15:38:22 +00:00
|
|
|
|
procedure TfrViewPresupuestosCliente.frViewFiltroBase1actQuitarFiltroExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
frViewFiltroBase1.txtFiltroTodo.Clear;
|
|
|
|
|
|
frViewFiltroBase1.eLista.Clear;
|
2014-02-18 22:41:52 +00:00
|
|
|
|
frViewFiltroBase1.eLista2.Clear;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewPresupuestosCliente.OnFiltroListaISOPropertiesChange(
|
|
|
|
|
|
Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
RefrescarFiltro;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewPresupuestosCliente.OnFiltroListaISOPropertiesInitPopup(
|
|
|
|
|
|
Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
|
|
|
|
|
|
with frViewFiltroBase1.eLista2.Properties.Items do
|
|
|
|
|
|
begin
|
|
|
|
|
|
BeginUpdate;
|
|
|
|
|
|
try
|
|
|
|
|
|
Clear;
|
|
|
|
|
|
Add('Todos'); //Case 0
|
|
|
|
|
|
Add('Con ISO'); //Case 1
|
|
|
|
|
|
Add('Sin ISO'); //Case 2
|
|
|
|
|
|
frViewFiltroBase1.eLista2.ItemIndex := 0;
|
|
|
|
|
|
finally
|
|
|
|
|
|
EndUpdate;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
2008-09-23 15:38:22 +00:00
|
|
|
|
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;
|
|
|
|
|
|
|
2007-11-05 17:49:11 +00:00
|
|
|
|
function TfrViewPresupuestosCliente.GetPresupuestos: IBizPresupuestoCliente;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
begin
|
2007-11-05 17:49:11 +00:00
|
|
|
|
Result := FPresupuestos;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
2007-11-05 17:49:11 +00:00
|
|
|
|
procedure TfrViewPresupuestosCliente.SetPresupuestos(const Value: IBizPresupuestoCliente);
|
2007-10-26 18:19:55 +00:00
|
|
|
|
begin
|
2007-11-05 17:49:11 +00:00
|
|
|
|
FPresupuestos := Value;
|
|
|
|
|
|
if Assigned(FPresupuestos) then
|
|
|
|
|
|
dsDataSource.DataTable := FPresupuestos.DataTable;
|
2007-10-26 18:19:55 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|