git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES/trunk@4 3f40d355-893c-4141-8e64-b1d9be72e7e7
166 lines
5.1 KiB
ObjectPascal
166 lines
5.1 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: 31-12-2002
|
|
Versión actual: 1.0.0
|
|
Fecha versión actual: 31-12-2002
|
|
===============================================================================
|
|
Modificaciones:
|
|
|
|
Fecha Comentarios
|
|
---------------------------------------------------------------------------
|
|
===============================================================================
|
|
}
|
|
|
|
unit ImprimirFacturasCliente;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
|
RDXFRAME, StdCtrls, RdxComboBox, RdxBotones, RdxCampos,
|
|
ExtCtrls, RdxBarras, RdxTitulos, InformeFacturaCliente, Configuracion,
|
|
Grids, DBGrids, RdxPaneles, RdxRadioButton, VistaPrevia, AdvPanel,
|
|
cxDBEdit, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
|
cxButtonEdit;
|
|
|
|
type
|
|
TfrImprimirFacturasCliente = class(TRdxFrame)
|
|
pnlTitulo: TRdxPanelTituloOperacion;
|
|
pnlVistaPrevia: TPanel;
|
|
pnlCuerpo: TPanel;
|
|
pnlProveedor: TAdvPanel;
|
|
eCodigo: TLabel;
|
|
eCodigoCliente: TLabel;
|
|
eNombre: TLabel;
|
|
eFecha: TLabel;
|
|
eNIFCIF: TLabel;
|
|
CodCliente: TcxTextEdit;
|
|
NIFCIF: TcxTextEdit;
|
|
FechaFactura: TcxTextEdit;
|
|
Nombre: TcxTextEdit;
|
|
Codigo: TcxButtonEdit;
|
|
procedure bCancelarClick(Sender: TObject);
|
|
procedure CodFacturaButtonClick(Sender: TObject);
|
|
procedure bImprimirClick(Sender: TObject);
|
|
procedure CodigoPropertiesButtonClick(Sender: TObject;
|
|
AButtonIndex: Integer);
|
|
private
|
|
FCodigoFactura : Variant;
|
|
FInformeFactura : TdmInformeFacturaCliente;
|
|
FVistaPrevia : TfrVistaPrevia;
|
|
procedure SetCodigoFactura (Value : Variant);
|
|
procedure DarDatosFactura;
|
|
protected
|
|
procedure FreeContenido; override;
|
|
function CloseFrame : Boolean; override;
|
|
public
|
|
constructor Create(AOwner : TComponent); override;
|
|
destructor Destroy; override;
|
|
published
|
|
property CodigoFactura : Variant read FCodigoFactura write SetCodigoFactura;
|
|
end;
|
|
|
|
var
|
|
frImprimirFacturasCliente: TfrImprimirFacturasCliente;
|
|
|
|
implementation
|
|
|
|
{$R *.DFM}
|
|
|
|
uses
|
|
Variants, RdxFrameFacturasCliente, Entidades, FacturasClientes,
|
|
Clientes, TablaFacturasCliente, Mensajes, StrFunc, InformeBase, BaseDatos;
|
|
|
|
constructor TfrImprimirFacturasCliente.Create(AOwner : TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FCodigoFactura := NULL;
|
|
FVistaPrevia := TfrVistaPrevia.Create(Self);
|
|
FVistaPrevia.Parent := pnlVistaPrevia;
|
|
FInformeFactura := TdmInformeFacturaCliente.Create(Self);
|
|
FInformeFactura.Preview := FVistaPrevia.Preview;
|
|
end;
|
|
|
|
procedure TfrImprimirFacturasCliente.bCancelarClick(Sender: TObject);
|
|
begin
|
|
CloseFrame;
|
|
end;
|
|
|
|
procedure TfrImprimirFacturasCliente.FreeContenido;
|
|
begin
|
|
if (ContenidoModal is TRdxFrameFacturasCliente) then
|
|
CodigoFactura := (ContenidoModal as TRdxFrameFacturasCliente).CodigoFactura;
|
|
inherited FreeContenido;
|
|
end;
|
|
|
|
procedure TfrImprimirFacturasCliente.CodFacturaButtonClick(Sender: TObject);
|
|
begin
|
|
ContenidoModal := TfrFacturasClientes.Create(Self);
|
|
CodigoFactura := FCodigoFactura;
|
|
end;
|
|
|
|
procedure TfrImprimirFacturasCliente.SetCodigoFactura(Value: Variant);
|
|
begin
|
|
if EsCadenaVacia(Value) then
|
|
Exit;
|
|
if FCodigoFactura <> Value then
|
|
begin
|
|
FCodigoFactura := Value;
|
|
DarDatosFactura;
|
|
FInformeFactura.CodigoFactura := CodigoFactura;
|
|
FInformeFactura.Previsualizar;
|
|
end;
|
|
end;
|
|
|
|
destructor TfrImprimirFacturasCliente.Destroy;
|
|
begin
|
|
FInformeFactura.Free;
|
|
inherited;
|
|
end;
|
|
|
|
procedure TfrImprimirFacturasCliente.bImprimirClick(Sender: TObject);
|
|
begin
|
|
FInformeFactura.Imprimir;
|
|
end;
|
|
|
|
procedure TfrImprimirFacturasCliente.DarDatosFactura;
|
|
var
|
|
DatosFactura : TDatosFacturaCliente;
|
|
begin
|
|
DatosFactura := TDatosFacturaCliente.Create(FCodigoFactura);
|
|
try
|
|
Codigo.Text := DatosFactura.Codigo;
|
|
FechaFactura.Text := DateToStr(DatosFactura.FechaFactura);
|
|
CodCliente.Text := DatosFactura.CodigoCliente;
|
|
NIFCIF.Text := DatosFactura.NIFCIF;
|
|
Nombre.Text := DatosFactura.Nombre;
|
|
finally
|
|
DatosFactura.Free;
|
|
end;
|
|
end;
|
|
|
|
function TfrImprimirFacturasCliente.CloseFrame: Boolean;
|
|
begin
|
|
FInformeFactura.Preview := NIL;
|
|
(FVistaPrevia as TRdxFrame).CloseFrame;
|
|
Result := inherited CloseFrame;
|
|
end;
|
|
|
|
procedure TfrImprimirFacturasCliente.CodigoPropertiesButtonClick(
|
|
Sender: TObject; AButtonIndex: Integer);
|
|
begin
|
|
ContenidoModal := TfrFacturasClientes.Create(Self);
|
|
end;
|
|
|
|
end.
|