This repository has been archived on 2024-12-02. You can view files and clone it, but cannot push or open issues or pull requests.
FactuGES/Informes/InformePagoCliente.pas
2007-06-26 08:08:27 +00:00

172 lines
5.2 KiB
ObjectPascal

{
===============================================================================
Copyright (©) 2002. 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: 01-03-2003
Versión actual: 1.0.0
Fecha versión actual: 01-03-2003
===============================================================================
Modificaciones:
Fecha Comentarios
---------------------------------------------------------------------------
===============================================================================
}
unit InformePagoCliente;
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, RdxEmpresaActiva;
type
TdmInformePagoCliente = class(TdmInformeBase)
TablaCab: TfrDBDataSet;
TablaPagosCliente: TIBQuery;
private
FCodigoPago : Variant;
function DarTextoDireccion(Index : Integer) : String;
function DarTextoTelefonos(Index : Integer) : String;
protected
procedure RellenarBanda(Band: TfrBand); override;
procedure PrepararConsultas; override;
public
constructor Create(AOwner: TComponent); override;
published
property CodigoPago : variant read FCodigoPago write FCodigoPago;
end;
var
dmInformePagoCliente: TdmInformePagoCliente;
implementation
{$R *.dfm}
uses
Types, StrFunc, BaseDatos, TablaEmpresas;
{ TdmInformePagoCliente }
constructor TdmInformePagoCliente.Create(AOwner: TComponent);
begin
inherited;
FNombreInforme := 'InformePagoCliente.frf';
end;
function TdmInformePagoCliente.DarTextoDireccion(Index: Integer): String;
var
CadenaAux : String;
begin
with TListaDireccionesEmpresa(EmpresaActiva.Direcciones).Items[Index] do
begin
CadenaAux := Calle;
if (not EsCadenaVacia(Numero)) then
CadenaAux := CadenaAux + ', ' + Numero;
if (not EsCadenaVacia(CodigoPostal)) then
CadenaAux := CadenaAux + ' · ' + CodigoPostal;
if (not EsCadenaVacia(Provincia)) then
CadenaAux := CadenaAux + ' ' + Provincia;
Result := CadenaAux;
end;
end;
function TdmInformePagoCliente.DarTextoTelefonos(Index: Integer): String;
var
CadenaAux : String;
begin
with TListaDireccionesEmpresa(EmpresaActiva.Direcciones).Items[Index] do
begin
CadenaAux := '';
if (not EsCadenaVacia(Telefono)) then
CadenaAux := 'Telf. ' + Telefono;
if (not EsCadenaVacia(Fax)) then
CadenaAux := CadenaAux + ' Fax ' + Fax;
Result := CadenaAux;
end;
end;
procedure TdmInformePagoCliente.PrepararConsultas;
begin
inherited;
with TablaPagosCliente do
begin
Database := FBaseDatos;
Transaction := FTransaccion;
SQL.Clear;
SQL.Add('select * from PAGOSCLIENTE ');
SQL.Add('where CODIGO = :CODIGO');
ParamByName('CODIGO').AsString := FCodigoPago;
Prepare;
end;
end;
procedure TdmInformePagoCliente.RellenarBanda(Band: TfrBand);
var
iCont : Integer;
iDir : Integer;
Objeto : TfrView;
CadenaAux : String;
begin
with Band do
begin
for iCont := 0 to Objects.Count - 1 do
begin
Objeto := Objects[iCont];
if ((Objeto is TfrMemoView) and
((Objeto.Name = 'DatosEmpresa1') or (Objeto.Name = 'DatosEmpresa2'))) then
begin
with (Objeto as TfrMemoView) do
begin
Font.Name := 'Arial';
Prop['LINESPACING'] := 1;
Prop['GAPX'] := 0;
Prop['GAPY'] := 0;
Memo.Clear;
for iDir := 0 to (EmpresaActiva.Direcciones.Count - 1) do
begin
Memo.Add(DarTextoDireccion(iDir));
Memo.Add(DarTextoTelefonos(iDir));
Memo.Add(#151 + #151);
end;
CadenaAux := '';
if not EsCadenaVacia(EmpresaActiva.Web) then
CadenaAux := EmpresaActiva.Web;
if not EsCadenaVacia(EmpresaActiva.Correo) then
begin
if not EsCadenaVacia(CadenaAux) then
CadenaAux := CadenaAux + ' · ';
CadenaAux := CadenaAux + EmpresaActiva.Correo;
end;
CadenaAux := '';
if (not EsCadenaVacia(EmpresaActiva.NifCif)) then
CadenaAux := ' NIF: ' + EmpresaActiva.NifCif;
Memo.Add(EmpresaActiva.Nombre + CadenaAux);
end;
end;
if ((Objeto is TfrPictureView) and (Pos('Logotipo', Objeto.Name) > 0)) then
begin
with (Objeto as TfrPictureView), EmpresaActiva do
Picture.Assign(EmpresaActiva.Logotipo);
end;
end;
end;
end;
end.