{ =============================================================================== 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 ListadoFacturacionProcedencia; 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, InformeListadoFacturacionProcedencia, TablaProveedores, Entidades, cxCalendar; type TfrListadoFacturacionProcedencia = 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 : TdmInformeListadoFacturacionProcedencia; 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 frListadoFacturacionProcedencia: TfrListadoFacturacionProcedencia; implementation {$R *.dfm} { TfrListadoFacturacionProcedencia } uses Literales, Mensajes, StrFunc, DateUtils, InformeBase, TablaTrimestres, Proveedores, RdxFrameProveedores, Configuracion, cxDateUtils; constructor TfrListadoFacturacionProcedencia.Create(AOwner: TComponent); begin inherited Create(AOwner); Entidad := entListadoFacturacionProcedencia; FVistaPrevia := TfrVistaPrevia.Create(Self); FVistaPrevia.Parent := pnlVistaPrevia; FInforme := TdmInformeListadoFacturacionProcedencia.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 TfrListadoFacturacionProcedencia.Destroy; begin FInforme.Free; inherited; end; function TfrListadoFacturacionProcedencia.CloseFrame: Boolean; begin FInforme.Preview := NIL; (FVistaPrevia as TRdxFrame).CloseFrame; Result := inherited CloseFrame; end; procedure TfrListadoFacturacionProcedencia.FreeContenido; begin // if (ContenidoModal is TRdxFrameProveedores) then // FCodigoProveedorAux := (ContenidoModal as TRdxFrameProveedores).CodigoProveedor; inherited; end; procedure TfrListadoFacturacionProcedencia.VerModal; begin // if (ContenidoModal is TRdxFrameProveedores) then // (ContenidoModal as TRdxFrameProveedores).CodigoProveedor := FCodigoProveedorAux; inherited; end; function TfrListadoFacturacionProcedencia.CambiarEntidad(EntidadAnterior, Entidad: TRdxEntidad): Boolean; begin inherited CambiarEntidad(EntidadAnterior, Entidad); ConfigurarFrame(Self, Self.Entidad); end; procedure TfrListadoFacturacionProcedencia.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 TfrListadoFacturacionProcedencia.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.