164 lines
5.2 KiB
ObjectPascal
164 lines
5.2 KiB
ObjectPascal
|
|
{
|
|||
|
|
===============================================================================
|
|||
|
|
Copyright (<EFBFBD>) 2002. 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-03-2003
|
|||
|
|
Versi<EFBFBD>n actual: 1.0.0
|
|||
|
|
Fecha versi<EFBFBD>n actual: 01-03-2003
|
|||
|
|
===============================================================================
|
|||
|
|
Modificaciones:
|
|||
|
|
|
|||
|
|
Fecha Comentarios
|
|||
|
|
---------------------------------------------------------------------------
|
|||
|
|
===============================================================================
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
unit InformeDetalleBeneficiosContrato;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, InformeBase, FR_IBXDB, FR_Shape, FR_DSet, FR_DBSet, FR_Class,
|
|||
|
|
DB, IBCustomDataSet, IBQuery;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TdmInformeDetalleBeneficiosContrato = class(TdmInformeBase)
|
|||
|
|
dsTablaFacturasProveedor: TfrDBDataSet;
|
|||
|
|
TablaFacturasProveedor: TIBQuery;
|
|||
|
|
dsTablaFacturasCliente: TfrDBDataSet;
|
|||
|
|
TablaFacturasCliente: TIBQuery;
|
|||
|
|
TablaObrasGastos: TIBQuery;
|
|||
|
|
dsTablaObrasGastos: TfrDBDataSet;
|
|||
|
|
private
|
|||
|
|
FCodigoContrato : Variant;
|
|||
|
|
FNIFCIF : Variant;
|
|||
|
|
FNombre : Variant;
|
|||
|
|
protected
|
|||
|
|
procedure RellenarCabecera(Band: TfrBand); override;
|
|||
|
|
procedure PrepararConsultas; override;
|
|||
|
|
public
|
|||
|
|
constructor Create(AOwner: TComponent); override;
|
|||
|
|
published
|
|||
|
|
property CodigoContrato : variant read FCodigoContrato write FCodigoContrato;
|
|||
|
|
property NIFCIF : variant read FNIFCIF write FNIFCIF;
|
|||
|
|
property Nombre : variant read FNombre write FNombre;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
dmInformeDetalleBeneficiosContrato: TdmInformeDetalleBeneficiosContrato;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Types, StrFunc, BaseDatos, Constantes, mensajes, RdxEmpresaActiva;
|
|||
|
|
|
|||
|
|
{ TdmInformeListadoBeneficiosClientes }
|
|||
|
|
|
|||
|
|
constructor TdmInformeDetalleBeneficiosContrato.Create(AOwner: TComponent);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
FNombreInforme := 'InformeDetalleBeneficiosContrato.frf';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TdmInformeDetalleBeneficiosContrato.PrepararConsultas;
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
|
|||
|
|
with TablaFacturasProveedor do
|
|||
|
|
begin
|
|||
|
|
Database := FBaseDatos;
|
|||
|
|
Transaction := FTransaccion;
|
|||
|
|
with SQL do
|
|||
|
|
begin
|
|||
|
|
Clear;
|
|||
|
|
Add('select det.codigofactura, fac.fechafactura, fac.nifcif, fac.nombre,');
|
|||
|
|
Add('fac.importetotal, det.importe, det.codigocontrato');
|
|||
|
|
Add('from detallesfacturasprovcontratos det, facturasproveedor fac');
|
|||
|
|
Add('where fac.codigoempresa = det.codigoempresa');
|
|||
|
|
Add(' and fac.codigo = det.codigofactura');
|
|||
|
|
Add(' and det.codigocontrato = :CODIGOCONTRATO');
|
|||
|
|
Add(' and fac.codigoempresa = :CODIGOEMPRESA');
|
|||
|
|
end;
|
|||
|
|
ParamByName('CODIGOCONTRATO').AsString := FCodigoContrato;
|
|||
|
|
ParamByName('CODIGOEMPRESA').AsInteger := EmpresaActiva.Codigo;
|
|||
|
|
Prepare;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with TablaObrasGastos do
|
|||
|
|
begin
|
|||
|
|
Database := FBaseDatos;
|
|||
|
|
Transaction := FTransaccion;
|
|||
|
|
with SQL do
|
|||
|
|
begin
|
|||
|
|
Clear;
|
|||
|
|
Add('select CODIGOCONTRATO, CODIGO, FECHAALTA, USUARIO,');
|
|||
|
|
Add('FECHA, DESCRIPCION, IMPORTE ');
|
|||
|
|
Add('from OBRASGASTOS ');
|
|||
|
|
Add('WHERE CODIGOCONTRATO = :CODIGOCONTRATO');
|
|||
|
|
Add('order by FECHA, CODIGO');
|
|||
|
|
end;
|
|||
|
|
ParamByName('CODIGOCONTRATO').AsString := FCodigoContrato;
|
|||
|
|
Prepare;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with TablaFacturasCliente do
|
|||
|
|
begin
|
|||
|
|
Database := FBaseDatos;
|
|||
|
|
Transaction := FTransaccion;
|
|||
|
|
with SQL do
|
|||
|
|
begin
|
|||
|
|
Clear;
|
|||
|
|
Add('select codigo, fechafactura, nifcif, nombre, importetotal, codigocontrato ');
|
|||
|
|
Add('from facturascliente ');
|
|||
|
|
Add('WHERE (CODIGOEMPRESA = :CODIGOEMPRESA) AND ');
|
|||
|
|
Add('(codigocontrato = :CODIGOCONTRATO)');
|
|||
|
|
Add('order by CODIGO');
|
|||
|
|
end;
|
|||
|
|
ParamByName('CODIGOCONTRATO').AsString := FCodigoContrato;
|
|||
|
|
ParamByName('CODIGOEMPRESA').AsInteger := EmpresaActiva.Codigo;
|
|||
|
|
Prepare;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TdmInformeDetalleBeneficiosContrato.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) then
|
|||
|
|
begin
|
|||
|
|
if (Objeto.Name = 'Empresa') then
|
|||
|
|
begin
|
|||
|
|
with (Objeto as TfrMemoView) do
|
|||
|
|
begin
|
|||
|
|
Memo.Clear;
|
|||
|
|
Memo.Add('Empresa: ' + EmpresaActiva.NombreComercial);
|
|||
|
|
Memo.Add('');
|
|||
|
|
Memo.Add('C<>digo contrato: ' + CodigoContrato);
|
|||
|
|
Memo.Add('NIF/CIF: ' + NIFCIF + ' Nombre: ' + Nombre);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|