git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES/trunk@4 3f40d355-893c-4141-8e64-b1d9be72e7e7
159 lines
4.7 KiB
ObjectPascal
159 lines
4.7 KiB
ObjectPascal
{
|
|
===============================================================================
|
|
Copyright (©) 2005. 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: 30-09-2005
|
|
Versión actual: 1.0.0
|
|
Fecha versión actual: 30-09-2005
|
|
===============================================================================
|
|
Modificaciones:
|
|
|
|
Fecha Comentarios
|
|
---------------------------------------------------------------------------
|
|
===============================================================================
|
|
}
|
|
|
|
unit ImprimirAlbaranCliente;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
|
RDXFRAME, StdCtrls, RdxComboBox, RdxBotones, RdxCampos,
|
|
ExtCtrls, RdxBarras, RdxTitulos, InformeAlbarancliente, Configuracion,
|
|
Grids, DBGrids, RdxPaneles, RdxRadioButton, VistaPrevia, AdvPanel,
|
|
cxDBEdit, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
|
cxButtonEdit;
|
|
|
|
type
|
|
TfrImprimirAlbaranCliente = class(TRdxFrame)
|
|
pnlTitulo: TRdxPanelTituloOperacion;
|
|
pnlVistaPrevia: TPanel;
|
|
pnlCuerpo: TPanel;
|
|
pnlAlbaran: TAdvPanel;
|
|
eCodigo: TLabel;
|
|
eCodigoCliente: TLabel;
|
|
eNombre: TLabel;
|
|
eFecha: TLabel;
|
|
eNIFCIF: TLabel;
|
|
CodCliente: TcxTextEdit;
|
|
NIFCIF: TcxTextEdit;
|
|
FechaAlbaran: TcxTextEdit;
|
|
Nombre: TcxTextEdit;
|
|
CodigoAlb: TcxButtonEdit;
|
|
procedure bCancelarClick(Sender: TObject);
|
|
procedure bImprimirClick(Sender: TObject);
|
|
procedure CodigoPropertiesButtonClick(Sender: TObject;
|
|
AButtonIndex: Integer);
|
|
private
|
|
FCodigo : Variant;
|
|
FInforme : TdmInformeAlbaranCliente;
|
|
FVistaPrevia : TfrVistaPrevia;
|
|
procedure SetCodigo (Value : Variant);
|
|
procedure DarDatos;
|
|
protected
|
|
procedure FreeContenido; override;
|
|
function CloseFrame : Boolean; override;
|
|
public
|
|
constructor Create(AOwner : TComponent); override;
|
|
destructor Destroy; override;
|
|
published
|
|
property Codigo : Variant read FCodigo write SetCodigo;
|
|
end;
|
|
|
|
var
|
|
frImprimirAlbaranCliente: TfrImprimirAlbaranCliente;
|
|
|
|
implementation
|
|
|
|
{$R *.DFM}
|
|
|
|
uses
|
|
Variants, RdxFrameAlbaranesCliente, Entidades, AlbaranesClientes,
|
|
Clientes, Mensajes, StrFunc, InformeBase, BaseDatos, TablaAlbaranesCliente;
|
|
|
|
constructor TfrImprimirAlbaranCliente.Create(AOwner : TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FCodigo := NULL;
|
|
FVistaPrevia := TfrVistaPrevia.Create(Self);
|
|
FVistaPrevia.Parent := pnlVistaPrevia;
|
|
FInforme := TdmInformeAlbaranCliente.Create(Self);
|
|
FInforme.Preview := FVistaPrevia.Preview;
|
|
end;
|
|
|
|
procedure TfrImprimirAlbaranCliente.bCancelarClick(Sender: TObject);
|
|
begin
|
|
CloseFrame;
|
|
end;
|
|
|
|
procedure TfrImprimirAlbaranCliente.FreeContenido;
|
|
begin
|
|
if (ContenidoModal is TRdxFrameAlbaranesCliente) then
|
|
Codigo := (ContenidoModal as TRdxFrameAlbaranesCliente).CodigoAlbaran;
|
|
inherited FreeContenido;
|
|
end;
|
|
|
|
procedure TfrImprimirAlbaranCliente.SetCodigo(Value: Variant);
|
|
begin
|
|
if EsCadenaVacia(Value) then
|
|
Exit;
|
|
if FCodigo <> Value then
|
|
begin
|
|
FCodigo := Value;
|
|
DarDatos;
|
|
FInforme.Codigo := Codigo;
|
|
FInforme.Previsualizar;
|
|
end;
|
|
end;
|
|
|
|
destructor TfrImprimirAlbaranCliente.Destroy;
|
|
begin
|
|
FInforme.Free;
|
|
inherited;
|
|
end;
|
|
|
|
procedure TfrImprimirAlbaranCliente.bImprimirClick(Sender: TObject);
|
|
begin
|
|
FInforme.Imprimir;
|
|
end;
|
|
|
|
procedure TfrImprimirAlbaranCliente.DarDatos;
|
|
var
|
|
Datos : TDatosAlbaranCliente;
|
|
begin
|
|
Datos := TDatosAlbaranCliente.Create(FCodigo);
|
|
try
|
|
CodigoAlb.Text := Datos.Codigo;
|
|
FechaAlbaran.Text := DateToStr(Datos.FechaAlbaran);
|
|
CodCliente.Text := Datos.CodigoCliente;
|
|
NIFCIF.Text := Datos.NIFCIF;
|
|
Nombre.Text := Datos.Nombre;
|
|
finally
|
|
Datos.Free;
|
|
end;
|
|
end;
|
|
|
|
function TfrImprimirAlbaranCliente.CloseFrame: Boolean;
|
|
begin
|
|
FInforme.Preview := NIL;
|
|
(FVistaPrevia as TRdxFrame).CloseFrame;
|
|
Result := inherited CloseFrame;
|
|
end;
|
|
|
|
procedure TfrImprimirAlbaranCliente.CodigoPropertiesButtonClick(
|
|
Sender: TObject; AButtonIndex: Integer);
|
|
begin
|
|
ContenidoModal := TfrAlbaranesClientes.Create(Self);
|
|
end;
|
|
|
|
end.
|