{ =============================================================================== Copyright (©) 2007. Rodax Software. =============================================================================== Los contenidos de este fichero son propiedad de Rodax Software titular del copyright. Este fichero sólo podrá ser copiado, distribuido y utilizado, en su totalidad o en parte, con el permiso escrito de Rodax Software, o de acuerdo con los términos y condiciones establecidas en el acuerdo/contrato bajo el que se suministra. ----------------------------------------------------------------------------- Web: www.rodax-software.com =============================================================================== Fecha primera versión: 02-04-2007 Versión actual: 1.0.0 Fecha versión actual: 02-04-2007 =============================================================================== Modificaciones: Fecha Comentarios --------------------------------------------------------------------------- =============================================================================== } unit ListadoPresupuestosProcedencia; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, RdxFrame, RdxBotones, RdxPaneles, RdxBarras, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxButtonEdit, StdCtrls, AdvPanel, ExtCtrls, RdxTitulos, cxDropDownEdit, VistaPrevia, InformeListadoPresupuestosProcedencia, TablaProveedores, Entidades, cxCalendar; type TfrListadoPresupuestosProcedencia = class(TRdxFrame) pnlTitulo: TRdxPanelTituloOperacion; pnlVistaPrevia: TPanel; pnlCuerpo: TPanel; pnlProveedor: TAdvPanel; Label1: TLabel; FechaIni: TcxDateEdit; eFechaFin: TLabel; FechaFin: TcxDateEdit; Label2: TLabel; procedure FechaIniPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); procedure FechaFinPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); private FVistaPrevia : TfrVistaPrevia; FInforme : TdmInformeListadoPresupuestosProcedencia; protected procedure VerModal; override; procedure FreeContenido; override; function CloseFrame : Boolean; override; function CambiarEntidad(EntidadAnterior, Entidad : TRdxEntidad): Boolean; override; public constructor Create(AOwner : TComponent); override; destructor Destroy; override; end; var frListadoPresupuestosProcedencia: TfrListadoPresupuestosProcedencia; implementation {$R *.dfm} { TfrListadoPresupuestosProcedencia } uses Literales, Mensajes, StrFunc, DateUtils, InformeBase, TablaTrimestres, Proveedores, RdxFrameProveedores, Configuracion, cxDateUtils; constructor TfrListadoPresupuestosProcedencia.Create(AOwner: TComponent); begin inherited Create(AOwner); Entidad := entListadoPresupuestosProcedencia; FVistaPrevia := TfrVistaPrevia.Create(Self); FVistaPrevia.Parent := pnlVistaPrevia; FInforme := TdmInformeListadoPresupuestosProcedencia.Create(Self); FInforme.Preview := FVistaPrevia.Preview; FechaIni.Date := dmTablaTrimestres.darFechaIniTrimestre(dmTablaTrimestres.darTrimestreActual); FechaFin.Date := dmTablaTrimestres.darFechaFinTrimestre(dmTablaTrimestres.darTrimestreActual); FInforme.FechaIni := FechaIni.Date; FInforme.FechaFin := FechaFin.Date; FInforme.Previsualizar; end; destructor TfrListadoPresupuestosProcedencia.Destroy; begin FInforme.Free; inherited; end; function TfrListadoPresupuestosProcedencia.CloseFrame: Boolean; begin FInforme.Preview := NIL; (FVistaPrevia as TRdxFrame).CloseFrame; Result := inherited CloseFrame; end; procedure TfrListadoPresupuestosProcedencia.FreeContenido; begin // if (ContenidoModal is TRdxFrameProveedores) then // FCodigoProveedorAux := (ContenidoModal as TRdxFrameProveedores).CodigoProveedor; inherited; end; procedure TfrListadoPresupuestosProcedencia.VerModal; begin // if (ContenidoModal is TRdxFrameProveedores) then // (ContenidoModal as TRdxFrameProveedores).CodigoProveedor := FCodigoProveedorAux; inherited; end; function TfrListadoPresupuestosProcedencia.CambiarEntidad(EntidadAnterior, Entidad: TRdxEntidad): Boolean; begin inherited CambiarEntidad(EntidadAnterior, Entidad); ConfigurarFrame(Self, Self.Entidad); end; procedure TfrListadoPresupuestosProcedencia.FechaIniPropertiesValidate( Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); var ADate : TDateTime; begin try if DisplayValue > FechaFin.Date then begin ErrorText := msgFechasMal; Error := True; Exit; end; TextToDateEx(DisplayValue, ADate); FInforme.FechaIni := ADate; FInforme.Previsualizar; except Error := True; ErrorText := msgFechaNoValida; end; end; procedure TfrListadoPresupuestosProcedencia.FechaFinPropertiesValidate( Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); var ADate : TDateTime; begin try if DisplayValue < FechaIni.Date then begin ErrorText := msgFechasMal; Error := True; Exit; end; TextToDateEx(DisplayValue, ADate); FInforme.FechaFin := ADate; FInforme.Previsualizar except Error := True; ErrorText := msgFechaNoValida; end; end; end.