This repository has been archived on 2024-11-29. You can view files and clone it, but cannot push or open issues or pull requests.
Tecsitel_FactuGES/Informes/InfEstReportFacturasCliPro.pas

285 lines
8.4 KiB
ObjectPascal
Raw Normal View History

{
===============================================================================
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: 11-08-2002
Versi<EFBFBD>n actual: 1.0.3
Fecha versi<EFBFBD>n actual: 30-06-2004
===============================================================================
Modificaciones:
Fecha Comentarios
---------------------------------------------------------------------------
09-03-2003 p253. En el listado de presupuesto de cliente a<EFBFBD>adir la
columna de factura para ver si el presupuesto est<EFBFBD>
facturado o no.
10-03-2003 p259. Informe con la lista de todos los presupuestos
de cliente.
30-06-2004 p272. Adaptaci<EFBFBD>n a multiempresa.
30-06-2004 p274. Migraci<EFBFBD>n a FastReport.
===============================================================================
}
unit InfEstReportFacturasCliPro;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
InformeBase, IBDatabase, Db, FR_IBXDB, FR_Shape, FR_Class, FR_DSet,
FR_DBSet, IBCustomDataSet, IBQuery, Tipos, RxMemDS, DBTables, MemTable;
type
TdmInfEstReportFacturasCliPro = class(TdmInformeBase)
frdsTablaGeneral: TfrDBDataSet;
TMemGeneral: TRxMemoryData;
TMemResumen1: TRxMemoryData;
frdsTablaResumen1: TfrDBDataSet;
TMemResumen2: TRxMemoryData;
frdsTablaResumen2: TfrDBDataSet;
private
FAno1: Variant;
FAno2: Variant;
FA1T1: Variant;
FA2T1: Variant;
FA3T1: Variant;
FFichero: Variant;
FEntidad: TRdxEntidad;
protected
procedure PrepararConsultas; override;
procedure RellenarCabecera(Band: TfrBand); override;
procedure RellenarBanda(Band: TfrBand); override;
public
function setDatosGeneral(const Datos: TRxMemoryData): Boolean;
function setDatosResumen1(const Datos: TRxMemoryData): Boolean;
function setDatosResumen2(const Datos: TRxMemoryData): Boolean;
constructor Create(AOwner: TComponent); override;
published
property Ano1 : Variant read FAno1 write FAno1;
property Ano2 : Variant read FAno2 write FAno2;
property A1T1 : Variant read FA1T1 write FA1T1;
property A2T1 : Variant read FA2T1 write FA2T1;
property A3T1 : Variant read FA3T1 write FA3T1;
property Fichero : Variant read FFichero write FFichero;
property Entidad : TRdxEntidad read FEntidad write FEntidad;
end;
var
dmInfEstReportFacturasCliPro: TdmInfEstReportFacturasCliPro;
implementation
{$R *.DFM}
{ TdmInformeListadoFacturasCli }
uses
RdxEmpresaActiva, Literales;
constructor TdmInfEstReportFacturasCliPro.Create(
AOwner: TComponent);
begin
inherited;
FAno1 := NULL;
FAno2 := NULL;
FNombreInforme := 'ListadoInfEstFacturasCliPro.frf';
FEntidad := entInfEstFacCli;
end;
procedure TdmInfEstReportFacturasCliPro.PrepararConsultas;
begin
//
end;
procedure TdmInfEstReportFacturasCliPro.RellenarBanda(Band: TfrBand);
var
iCont : Integer;
Objeto : TfrView;
begin
inherited;
with Band do
begin
if Name = 'CabeceraGeneral' then
begin
for iCont := 0 to Objects.Count - 1 do
begin
Objeto := Objects[iCont];
if ((Objeto is TfrMemoView) and (Pos('Titulo1', Objeto.Name) > 0)) then
begin
with (Objeto as TfrMemoView) do
begin
Memo.Clear;
Memo.Add('Valores del a<>o ' + Ano1);
end;
end;
if ((Objeto is TfrMemoView) and (Pos('Titulo2', Objeto.Name) > 0)) then
begin
with (Objeto as TfrMemoView) do
begin
Memo.Clear;
if not VarIsNull(Ano2)
then Memo.Add('Valores del a<>o ' + Ano2);
end
end;
if ((Objeto is TfrMemoView) and (Pos('Titulo3', Objeto.Name) > 0)) then
begin
with (Objeto as TfrMemoView) do
begin
Memo.Clear;
if not VarIsNull(Ano2)
then Memo.Add('Comparativa del a<>o ' + Ano1 + ' respecto al a<>o ' + Ano2);
end
end;
end;
end; //'CabeceraGeneral'
if Name = 'PieGeneral' then
begin
for iCont := 0 to Objects.Count - 1 do
begin
Objeto := Objects[iCont];
if ((Objeto is TfrMemoView) and (Pos('A1T1', Objeto.Name) > 0)) then
begin
with (Objeto as TfrMemoView) do
begin
Memo.Clear;
Memo.Add(A1T1);
end
end
else if ((Objeto is TfrMemoView) and (Pos('A2T1', Objeto.Name) > 0)) then
begin
with (Objeto as TfrMemoView) do
begin
Memo.Clear;
Memo.Add(A2T1);
end
end
else if ((Objeto is TfrMemoView) and (Pos('A3T1', Objeto.Name) > 0)) then
begin
with (Objeto as TfrMemoView) do
begin
Memo.Clear;
Memo.Add(A3T1);
end
end;
if ((Objeto is TfrPictureView) and (Pos('Grafico', Objeto.Name) > 0)) then
begin
with (Objeto as TfrPictureView) do
begin
Picture.LoadFromFile(Fichero);
end
end;
end;
end; //'PieGeneral'
if Name = 'CabeceraResumen1' then
begin
for iCont := 0 to Objects.Count - 1 do
begin
Objeto := Objects[iCont];
if ((Objeto is TfrMemoView) and (Pos('eTitResumen1', Objeto.Name) > 0)) then
begin
with (Objeto as TfrMemoView) do
begin
Memo.Clear;
case Entidad of
entInfEstFacCli: Memo.Add('Clientes con mayor capital facturado');
entInfEstFacPro: Memo.Add('Proveedores con mayor capital facturado');
end;
end
end
end;
end; //'CabeceraResumen1'
if Name = 'CabeceraResumen2' then
begin
for iCont := 0 to Objects.Count - 1 do
begin
Objeto := Objects[iCont];
if ((Objeto is TfrMemoView) and (Pos('eTitResumen2', Objeto.Name) > 0)) then
begin
with (Objeto as TfrMemoView) do
begin
Memo.Clear;
case Entidad of
entInfEstFacCli: Memo.Add('Clientes con m<>s descuento aplicado');
entInfEstFacPro: Memo.Add('Proveedores con m<>s descuento aplicado');
end;
end
end
end;
end; //'CabeceraResumen2'
end;
end;
procedure TdmInfEstReportFacturasCliPro.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 (Pos('NombreCliente', Objeto.Name) > 0)) then
with (Objeto as TfrMemoView) do
begin
Memo.Clear;
case Entidad of
entInfEstFacCli: Memo.Add('INFORME ESTAD<41>STICO DE FACTURAS DE CLIENTE');
entInfEstFacPro: Memo.Add('INFORME ESTAD<41>STICO DE FACTURAS DE PROVEEDOR');
end;
end;
end;
end;
end;
function TdmInfEstReportFacturasCliPro.setDatosGeneral(const Datos: TRxMemoryData): Boolean;
begin
TMemGeneral.LoadFromDataSet(Datos, -1, lmCopy);
end;
function TdmInfEstReportFacturasCliPro.setDatosResumen1(const Datos: TRxMemoryData): Boolean;
begin
TMemResumen1.LoadFromDataSet(Datos, -1, lmCopy);
end;
function TdmInfEstReportFacturasCliPro.setDatosResumen2(
const Datos: TRxMemoryData): Boolean;
begin
TMemResumen2.LoadFromDataSet(Datos, -1, lmCopy);
end;
end.