git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES/trunk@4 3f40d355-893c-4141-8e64-b1d9be72e7e7
133 lines
4.8 KiB
ObjectPascal
133 lines
4.8 KiB
ObjectPascal
{
|
|
===============================================================================
|
|
Copyright (©) 2003. 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: 29-03-2003
|
|
Versión actual: 1.0.2
|
|
Fecha versión actual: 04-02-2005
|
|
===============================================================================
|
|
Modificaciones:
|
|
|
|
Fecha Comentarios
|
|
---------------------------------------------------------------------------
|
|
30-03-2004 Se ha eliminado el atributo SERIE (P8 MULTIEMPRESA)
|
|
04-02-2005 Se elimnina la separación entre el informe resumen facturas e historial
|
|
facturas quedando un único informe desde el que acceder a ambos.
|
|
===============================================================================
|
|
}
|
|
|
|
unit InformeResumenFacturacionProveedores;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, InformeBase, FR_IBXDB, FR_Shape, FR_Class, DB, IBCustomDataSet,
|
|
IBQuery, FR_DSet, FR_DBSet, RdxEmpresaActiva;
|
|
|
|
type
|
|
TdmInformeResumenFacturacionProveedores = class(TdmInformeBase)
|
|
dsFacturacionProveedores: TfrDBDataSet;
|
|
TablaFacturacionProveedores: TIBQuery;
|
|
private
|
|
FImporteMinimo: Variant;
|
|
FNombreIni: String;
|
|
FNombreFin: String;
|
|
FFechaFacFin: TDateTime;
|
|
FFechaFacIni: TDateTime;
|
|
protected
|
|
procedure RellenarCabecera(Band: TfrBand); override;
|
|
procedure PrepararConsultas; override;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
published
|
|
property ImporteMinimo : Variant read FImporteMinimo write FImporteMinimo;
|
|
property NombreIni : String read FNombreIni write FNombreIni;
|
|
property NombreFin : String read FNombreFin write FNombreFin;
|
|
property FechaFacIni : TDateTime read FFechaFacIni write FFechaFacIni;
|
|
property FechaFacFin : TDateTime read FFechaFacFin write FFechaFacFin;
|
|
end;
|
|
|
|
var
|
|
dmInformeResumenFacturacionProveedores: TdmInformeResumenFacturacionProveedores;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
{ TdmInformeResumenFacturacionProveedores }
|
|
|
|
uses
|
|
BaseDatos, StrFunc, TablaEmpresas;
|
|
|
|
constructor TdmInformeResumenFacturacionProveedores.Create(AOwner: TComponent);
|
|
begin
|
|
inherited;
|
|
FNombreInforme := 'ResumenFacturacionProveedores.frf';
|
|
end;
|
|
|
|
procedure TdmInformeResumenFacturacionProveedores.PrepararConsultas;
|
|
begin
|
|
inherited;
|
|
with TablaFacturacionProveedores do
|
|
begin
|
|
Database := FBaseDatos;
|
|
Transaction := FTransaccion;
|
|
SQL.Clear;
|
|
SQL.Add('select NOMBRE, BASEIMPONIBLE, IMPORTEIVA, IMPORTETOTAL ');
|
|
SQL.Add('from FACTURASPROVEEDOR ');
|
|
SQL.Add('where CODIGOEMPRESA = :CODIGOEMPRESA');
|
|
SQL.Add('and upper(NOMBRE) between upper(:NOMBREINI) and upper(:NOMBREFIN) ');
|
|
SQL.Add('and FECHAFACTURA between :FECHAFACINI and :FECHAFACFIN ');
|
|
if not VarIsNull(FImporteMinimo) then
|
|
SQL.Add('and BASEIMPONIBLE >= :BASEIMPONIBLE ');
|
|
SQL.Add('order by NOMBRE');
|
|
ParamByName('CODIGOEMPRESA').AsInteger := EmpresaActiva.Codigo;
|
|
ParamByName('NOMBREINI').AsString := FNombreIni;
|
|
ParamByName('NOMBREFIN').AsString := FNombreFin;
|
|
ParamByName('FECHAFACINI').AsDateTime := FFechaFacIni;
|
|
ParamByName('FECHAFACFIN').AsDateTime := FFechaFacFin;
|
|
if not VarIsNull(FImporteMinimo) then
|
|
ParamByName('BASEIMPONIBLE').AsFloat := FImporteMinimo;
|
|
Prepare;
|
|
end;
|
|
end;
|
|
|
|
procedure TdmInformeResumenFacturacionProveedores.RellenarCabecera(
|
|
Band: TfrBand);
|
|
var
|
|
iCont : Integer;
|
|
Objeto : TfrView;
|
|
begin
|
|
inherited;
|
|
with Band do
|
|
begin
|
|
for iCont := 0 to Objects.Count - 1 do
|
|
begin
|
|
Objeto := Objects[iCont];
|
|
if ((Objeto is TfrMemoView) and (Objeto.Name = 'CabParametros')) then
|
|
begin
|
|
with (Objeto as TfrMemoView) do
|
|
begin
|
|
Memo.Clear;
|
|
Memo.Add('Empresa: ' + EmpresaActiva.NombreComercial);
|
|
Memo.Add('Rango de fechas: ' + DateToStr(FFechaFacIni) + ' - ' + DateToStr(FFechaFacFin));
|
|
Memo.Add('Rango de proveedores: ' + FNombreIni + ' - ' + FNombreFin);
|
|
if not VarIsNull(FImporteMinimo) then
|
|
Memo.Add('Importe de facturas mínimo: ' + FormatFloat('#,##0.00', FImporteMinimo) + ' €');
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
end.
|