178 lines
5.9 KiB
ObjectPascal
178 lines
5.9 KiB
ObjectPascal
|
|
{
|
|||
|
|
===============================================================================
|
|||
|
|
Copyright (<EFBFBD>) 2003. 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: 14-06-2003
|
|||
|
|
Versi<EFBFBD>n actual: 1.0.0
|
|||
|
|
Fecha versi<EFBFBD>n actual: 14-06-2003
|
|||
|
|
===============================================================================
|
|||
|
|
Modificaciones:
|
|||
|
|
|
|||
|
|
Fecha Comentarios
|
|||
|
|
---------------------------------------------------------------------------
|
|||
|
|
===============================================================================
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
unit ImprimirPresupuestosCliente;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
|||
|
|
RDXFRAME, StdCtrls, RdxComboBox, RdxBotones, RdxCampos,
|
|||
|
|
ExtCtrls, RdxBarras, RdxTitulos, Configuracion, InformePresupuestoCliente,
|
|||
|
|
Grids, DBGrids, RdxPaneles, RdxRadioButton, VistaPrevia, AdvPanel,
|
|||
|
|
cxDBEdit, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
|||
|
|
cxButtonEdit, cxDropDownEdit, cxCalendar;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrImprimirPresupuestosCliente = class(TRdxFrame)
|
|||
|
|
pnlTitulo: TRdxPanelTituloOperacion;
|
|||
|
|
pnlVistaPrevia: TPanel;
|
|||
|
|
pnlCuerpo: TPanel;
|
|||
|
|
pnlProveedor: TAdvPanel;
|
|||
|
|
eCodigo: TLabel;
|
|||
|
|
eCodigoCliente: TLabel;
|
|||
|
|
eNombre: TLabel;
|
|||
|
|
eFecha: TLabel;
|
|||
|
|
eNIFCIF: TLabel;
|
|||
|
|
CodCliente: TcxTextEdit;
|
|||
|
|
NIFCIF: TcxTextEdit;
|
|||
|
|
Nombre: TcxTextEdit;
|
|||
|
|
Codigo: TcxButtonEdit;
|
|||
|
|
FechaPresupuesto: TcxDateEdit;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Documento: TcxTextEdit;
|
|||
|
|
procedure bCancelarClick(Sender: TObject);
|
|||
|
|
procedure CodFacturaButtonClick(Sender: TObject);
|
|||
|
|
procedure CodigoPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
procedure OnBeforePrint(Sender: TObject);
|
|||
|
|
procedure OnAfterPrint(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
FCodigoPresupuesto : Variant;
|
|||
|
|
FInformePresupuesto : TdmInformePresupuestoCliente;
|
|||
|
|
FVistaPrevia : TfrVistaPrevia;
|
|||
|
|
FImprimirFinanciacion : Boolean;
|
|||
|
|
procedure SetCodigoPresupuesto (Value : Variant);
|
|||
|
|
procedure DarDatosPresupuesto;
|
|||
|
|
protected
|
|||
|
|
procedure FreeContenido; override;
|
|||
|
|
function CloseFrame : Boolean; override;
|
|||
|
|
public
|
|||
|
|
constructor Create(AOwner : TComponent); override;
|
|||
|
|
destructor Destroy; override;
|
|||
|
|
published
|
|||
|
|
property CodigoPresupuesto : Variant read FCodigoPresupuesto write SetCodigoPresupuesto;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frImprimirPresupuestosCliente: TfrImprimirPresupuestosCliente;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
{$R *.DFM}
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Variants, RdxFramePresupuestos, Entidades, PresupuestosClientes,
|
|||
|
|
Clientes, TablaPresupuestos, Mensajes, StrFunc, InformeBase,
|
|||
|
|
BaseDatos, TablaDocumentos;
|
|||
|
|
|
|||
|
|
constructor TfrImprimirPresupuestosCliente.Create(AOwner : TComponent);
|
|||
|
|
begin
|
|||
|
|
inherited Create(AOwner);
|
|||
|
|
FCodigoPresupuesto := NULL;
|
|||
|
|
FVistaPrevia := TfrVistaPrevia.Create(Self);
|
|||
|
|
FVistaPrevia.Parent := pnlVistaPrevia;
|
|||
|
|
FVistaPrevia.OnBeforePrint := OnBeforePrint;
|
|||
|
|
FVistaPrevia.OnAfterPrint := OnAfterPrint;
|
|||
|
|
FInformePresupuesto := TdmInformePresupuestoCliente.Create(Self);
|
|||
|
|
FInformePresupuesto.Preview := FVistaPrevia.Preview;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrImprimirPresupuestosCliente.bCancelarClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
CloseFrame;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrImprimirPresupuestosCliente.FreeContenido;
|
|||
|
|
begin
|
|||
|
|
if (ContenidoModal is TRdxFramePresupuestos) then
|
|||
|
|
CodigoPresupuesto := (ContenidoModal as TRdxFramePresupuestos).CodigoPresupuesto;
|
|||
|
|
inherited FreeContenido;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrImprimirPresupuestosCliente.CodFacturaButtonClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ContenidoModal := TfrPresupuestosClientes.Create(Self);
|
|||
|
|
CodigoPresupuesto := FCodigoPresupuesto;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrImprimirPresupuestosCliente.SetCodigoPresupuesto(Value: Variant);
|
|||
|
|
begin
|
|||
|
|
if EsCadenaVacia(Value) then
|
|||
|
|
Exit;
|
|||
|
|
FCodigoPresupuesto := Value;
|
|||
|
|
DarDatosPresupuesto;
|
|||
|
|
FInformePresupuesto.CodigoPresupuesto := CodigoPresupuesto;
|
|||
|
|
FInformePresupuesto.Entidad := dmTablaDocumentos.DarEntidadDocumento(entPresupuestoCliente, Documento.Text);
|
|||
|
|
FInformePresupuesto.Previsualizar;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
destructor TfrImprimirPresupuestosCliente.Destroy;
|
|||
|
|
begin
|
|||
|
|
FInformePresupuesto.Free;
|
|||
|
|
inherited;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrImprimirPresupuestosCliente.DarDatosPresupuesto;
|
|||
|
|
var
|
|||
|
|
DatosPresupuesto : TDatosPresupuesto;
|
|||
|
|
begin
|
|||
|
|
DatosPresupuesto := TDatosPresupuesto.Create(FCodigoPresupuesto);
|
|||
|
|
try
|
|||
|
|
Codigo.Text := DatosPresupuesto.Codigo;
|
|||
|
|
FechaPresupuesto.Date := DatosPresupuesto.FechaPresupuesto;
|
|||
|
|
CodCliente.Text := DatosPresupuesto.CodigoCliente;
|
|||
|
|
NIFCIF.Text := DatosPresupuesto.NIFCIF;
|
|||
|
|
Nombre.Text := DatosPresupuesto.Nombre;
|
|||
|
|
Documento.Text := DatosPresupuesto.CodigoDocumento;
|
|||
|
|
finally
|
|||
|
|
DatosPresupuesto.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrImprimirPresupuestosCliente.CloseFrame: Boolean;
|
|||
|
|
begin
|
|||
|
|
FInformePresupuesto.Preview := NIL;
|
|||
|
|
(FVistaPrevia as TRdxFrame).CloseFrame;
|
|||
|
|
Result := inherited CloseFrame;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrImprimirPresupuestosCliente.CodigoPropertiesButtonClick(
|
|||
|
|
Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
ContenidoModal := TfrPresupuestosClientes.Create(Self);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrImprimirPresupuestosCliente.OnBeforePrint(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
FImprimirFinanciacion := (VerMensajePregunta('Desea imprimir la hoja de financiaci<63>n?') = mrYES);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrImprimirPresupuestosCliente.OnAfterPrint(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if FImprimirFinanciacion then
|
|||
|
|
FInformePresupuesto.ImprimirFinanciacion;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|