155 lines
5.1 KiB
ObjectPascal
155 lines
5.1 KiB
ObjectPascal
|
|
{
|
|||
|
|
===============================================================================
|
|||
|
|
Copyright (<EFBFBD>) 2001. Rodax Software.
|
|||
|
|
===============================================================================
|
|||
|
|
Los contenidos de este fichero son propiedad de Rodax Software titular del
|
|||
|
|
copyright. Este fichero s<EFBFBD>lo podr<EFBFBD> ser copiado, distribuido y utilizado,
|
|||
|
|
en su totalidad o en parte, con el permiso escrito de Rodax Software, o de
|
|||
|
|
acuerdo con los t<EFBFBD>rminos y condiciones establecidas en el acuerdo/contrato
|
|||
|
|
bajo el que se suministra.
|
|||
|
|
-----------------------------------------------------------------------------
|
|||
|
|
Web: www.rodax-software.com
|
|||
|
|
===============================================================================
|
|||
|
|
Fecha primera versi<EFBFBD>n: 01-10-2001
|
|||
|
|
Versi<EFBFBD>n actual: 1.0.4
|
|||
|
|
Fecha versi<EFBFBD>n actual: 28-06-2004
|
|||
|
|
===============================================================================
|
|||
|
|
Modificaciones:
|
|||
|
|
|
|||
|
|
Fecha Comentarios
|
|||
|
|
---------------------------------------------------------------------------
|
|||
|
|
27-01-2002 El informe de IVA de facturas se realiza por intervalo de
|
|||
|
|
fecha de factura.
|
|||
|
|
|
|||
|
|
05-03-2002 El informe de facturas pendientes se realiza por intervalo de
|
|||
|
|
fecha de factura.
|
|||
|
|
|
|||
|
|
08-03-2003 Se han puesto componentes con calendario.
|
|||
|
|
|
|||
|
|
28-06-2004 p272. Adaptaci<EFBFBD>n a multiempresa.
|
|||
|
|
===============================================================================
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
unit ListadoFacturasCliPenIVA;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
|||
|
|
ListadoBase, ExtCtrls, StdCtrls, RdxTitulos, RdxPaneles, cxControls, Tipos,
|
|||
|
|
cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalendar;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrListadoFacturasCliPenIVA = class(TfrListadoBase)
|
|||
|
|
Label1: TLabel;
|
|||
|
|
FechaIni: TcxDateEdit;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
FechaFin: TcxDateEdit;
|
|||
|
|
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
|
|||
|
|
FFechaIni: Variant;
|
|||
|
|
FFechaFin: Variant;
|
|||
|
|
procedure RefrescarInforme; override;
|
|||
|
|
protected
|
|||
|
|
function CambiarEntidad(EntidadAnterior, Entidad : TRdxEntidad): Boolean; override;
|
|||
|
|
public
|
|||
|
|
constructor Create (AOwner : TComponent); override;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frListadoFacturasCliPenIVA: TfrListadoFacturasCliPenIVA;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
{$R *.DFM}
|
|||
|
|
|
|||
|
|
{ TfrListadoFacturasCliPenIVA }
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Configuracion, Literales, InformeListadoFacturasCliPendientes,
|
|||
|
|
InformeListadoFacturasCliIVA, DateFunc;
|
|||
|
|
|
|||
|
|
function TfrListadoFacturasCliPenIVA.CambiarEntidad(EntidadAnterior,
|
|||
|
|
Entidad: TRdxEntidad): Boolean;
|
|||
|
|
begin
|
|||
|
|
Result := inherited CambiarEntidad(EntidadAnterior, Entidad);
|
|||
|
|
case Entidad of
|
|||
|
|
entListadoFacturasCliPendientes : begin
|
|||
|
|
eInformacion.Caption := msgInfTextoListarFacturasCli;
|
|||
|
|
FInforme := TdmInformeListadoFacturasCliPendientes.Create(Self);
|
|||
|
|
end;
|
|||
|
|
entListadoFacturasCliIVA : begin
|
|||
|
|
eInformacion.Caption := msgInfTextoListarFacturasCliIVA;
|
|||
|
|
FInforme := TdmInformeListadoFacturasCliIVA.Create(Self);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
FInforme.Preview := FVistaPrevia.Preview;
|
|||
|
|
ConfigurarFrame(Self, Self.Entidad);
|
|||
|
|
RefrescarInforme;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
constructor TfrListadoFacturasCliPenIVA.Create(AOwner: TComponent);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
ConfigurarFrame(Self, Self.Entidad);
|
|||
|
|
|
|||
|
|
FFechaIni := DarDiaInicioMesDat;
|
|||
|
|
FFechaFin := DarDiaFinalMesDat;
|
|||
|
|
FechaIni.Date := FFechaIni;
|
|||
|
|
FechaFin.Date := FFechaFin;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrListadoFacturasCliPenIVA.FechaIniPropertiesValidate(
|
|||
|
|
Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption;
|
|||
|
|
var Error: Boolean);
|
|||
|
|
begin
|
|||
|
|
if (StrToDate(DisplayValue) > FechaFin.Date) then
|
|||
|
|
begin
|
|||
|
|
ErrorText := msgFechaIniMayor;
|
|||
|
|
Error := True;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
FFechaIni := StrToDate(DisplayValue);
|
|||
|
|
RefrescarInforme;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrListadoFacturasCliPenIVA.FechaFinPropertiesValidate(
|
|||
|
|
Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption;
|
|||
|
|
var Error: Boolean);
|
|||
|
|
begin
|
|||
|
|
if (StrToDate(DisplayValue) < FechaIni.Date) then
|
|||
|
|
begin
|
|||
|
|
ErrorText := msgFechaIniMayor;
|
|||
|
|
Error := True;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
FFechaFin := StrToDate(DisplayValue);
|
|||
|
|
RefrescarInforme;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrListadoFacturasCliPenIVA.RefrescarInforme;
|
|||
|
|
begin
|
|||
|
|
if Entidad = entListadoFacturasCliPendientes then
|
|||
|
|
begin
|
|||
|
|
(FInforme as TdmInformeListadoFacturasCliPendientes).FechaIni := FFechaIni;
|
|||
|
|
(FInforme as TdmInformeListadoFacturasCliPendientes).FechaFin := FFechaFin;
|
|||
|
|
(FInforme as TdmInformeListadoFacturasCliPendientes).Previsualizar;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Entidad = entListadoFacturasCliIVA then
|
|||
|
|
begin
|
|||
|
|
(FInforme as TdmInformeListadoFacturasCliIVA).FechaIni := FFechaIni;
|
|||
|
|
(FInforme as TdmInformeListadoFacturasCliIVA).FechaFin := FFechaFin;
|
|||
|
|
(FInforme as TdmInformeListadoFacturasCliIVA).Previsualizar;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|