Se adaptan los editores para que no se habiliten las opciones de imprimir y previsualizar hasta que no haya cambios en el documento nuevo

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@977 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
roberto 2009-11-24 11:10:50 +00:00
parent 6b80bf9238
commit 8e34090d13
12 changed files with 76 additions and 17 deletions

View File

@ -34,6 +34,7 @@ type
procedure dsDataTableDataChange(Sender: TObject; Field: TField);
protected
function HayDatos: Boolean;
function PuedoImprimir: Boolean; virtual;
function GetModified: Boolean; override;
procedure RefrescarInterno; override;
procedure CancelarCambiosInterno; override;
@ -181,6 +182,11 @@ begin
and (not dsDataTable.DataTable.IsEmpty);
end;
function TfEditorDBBase.PuedoImprimir: Boolean;
begin
Result := True;
end;
procedure TfEditorDBBase.RefrescarInterno;
var
AID: Integer;
@ -249,13 +255,13 @@ end;
procedure TfEditorDBBase.actPrevisualizarUpdate(Sender: TObject);
begin
inherited;
(Sender as TAction).Enabled := HayDatos;
(Sender as TAction).Enabled := HayDatos and PuedoImprimir;
end;
procedure TfEditorDBBase.actImprimirUpdate(Sender: TObject);
begin
inherited;
(Sender as TAction).Enabled := HayDatos;
(Sender as TAction).Enabled := HayDatos and PuedoImprimir;
end;
initialization

View File

@ -71,6 +71,7 @@ type
//Si queremos crear otra vista para el editor heredado solo tendriamos que
//sobreescribir este metodo
procedure AsignarVista; virtual;
function PuedoImprimir: Boolean; override;
public
procedure PonerTitulos(const ATitulo: string = ''); override;
@ -142,6 +143,11 @@ begin
inherited;
end;
function TfEditorAlbaranCliente.PuedoImprimir: Boolean;
begin
Result := inherited PuedoImprimir and (not Albaran.Cliente.IDIsNull);
end;
procedure TfEditorAlbaranCliente.EliminarInterno;
begin
if (ShowConfirmMessage('¿Desea borrar este albarán de cliente?', '') = IDYES) then

View File

@ -59,6 +59,8 @@ type
procedure EliminarInterno; override;
procedure PrevisualizarInterno; override;
procedure ImprimirInterno; override;
function PuedoImprimir: Boolean; override;
property ViewAlbaran: IViewAlbaranProveedor read GetViewAlbaran write SetViewAlbaran;
@ -215,6 +217,11 @@ begin
Modified := False;
end;
function TfEditorAlbaranProveedor.PuedoImprimir: Boolean;
begin
Result := inherited PuedoImprimir and (not Albaran.Proveedor.IDIsNull);
end;
procedure TfEditorAlbaranProveedor.ImprimirInterno;
var
AllItems: Boolean;

View File

@ -72,6 +72,8 @@ type
procedure PrevisualizarInterno; override;
procedure PonerTitulos(const ATitulo: string = ''); override;
function PuedoImprimir: Boolean; override;
public
destructor Destroy; override;
property Controller : IFacturasClienteController read GetController write SetController;
@ -366,6 +368,11 @@ begin
end;
end;
function TfEditorFacturaCliente.PuedoImprimir: Boolean;
begin
Result := inherited PuedoImprimir and (not Factura.Cliente.IDIsNull);
end;
procedure TfEditorFacturaCliente.PonerTitulos(const ATitulo: string);
var
FTitulo : String;

View File

@ -61,13 +61,14 @@ type
procedure ImprimirInterno; override;
procedure OnProveedorChanged(Sender : TObject);
function PuedoImprimir: Boolean; override;
//Si queremos crear otra vista para el editor heredado solo tendriamos que
//sobreescribir este metodo
procedure AsignarVista; virtual;
property ViewPedido: IViewPedidoProveedor read GetViewPedido write SetViewPedido;
public
procedure PonerTitulos(const ATitulo: string = ''); override;
property Controller : IPedidosProveedorController read GetController write SetController;
@ -229,6 +230,11 @@ begin
FController.Print(FPedido, AllItems, FImprimirPrecios, FImprimirRefProveedor);
end;
function TfEditorPedidoProveedor.PuedoImprimir: Boolean;
begin
Result := inherited PuedoImprimir and (not Pedido.Proveedor.IDIsNull);
end;
procedure TfEditorPedidoProveedor.OnProveedorChanged(Sender: TObject);
begin
if Assigned(FPedido) then

View File

@ -205,22 +205,32 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
ExplicitHeight = 338
inherited ToolBar1: TToolBar
Width = 750
Height = 73
Height = 46
ExplicitWidth = 750
inherited ToolButton14: TToolButton
ExplicitHeight = 46
inherited ToolButton3: TToolButton
Wrap = False
end
inherited ToolButton4: TToolButton
Left = 278
Top = 0
Wrap = True
ExplicitLeft = 278
ExplicitTop = 0
end
inherited ToolButton14: TToolButton
Left = 0
Wrap = False
ExplicitLeft = 0
end
inherited FontName: TJvFontComboBox
Left = 0
Left = 65
Top = 22
ExplicitLeft = 0
ExplicitTop = 22
end
inherited FontSize: TEdit
Left = 145
Top = 22
Width = 200
ExplicitLeft = 145
ExplicitTop = 22
ExplicitWidth = 200
end
@ -233,10 +243,8 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
inherited ToolButton13: TToolButton
Left = 362
Top = 22
Wrap = False
ExplicitLeft = 362
ExplicitTop = 22
ExplicitHeight = 22
end
inherited ToolButton6: TToolButton
Left = 370

View File

@ -93,6 +93,7 @@ type
procedure PonerTitulos(const ATitulo: string = ''); override;
function GetModified: Boolean; override;
procedure SetModified(const Value : Boolean); override;
function PuedoImprimir: Boolean; override;
public
property Controller : IPresupuestosClienteController read GetController write SetController;
@ -336,6 +337,11 @@ begin
FController.Preview(FPresupuesto);
end;
function TfEditorPresupuestoCliente.PuedoImprimir: Boolean;
begin
Result := inherited PuedoImprimir and (not Presupuesto.Cliente.IDIsNull);
end;
procedure TfEditorPresupuestoCliente.RecalcularPortePorUnidad;
begin
//Esta lógica se llamará en el editor porque es para facilitar el rellenado de información del documento

View File

@ -8,7 +8,6 @@ inherited fEditorRemesaCliente: TfEditorRemesaCliente
ClientWidth = 676
Scaled = False
OnClose = CustomEditorClose
ExplicitTop = -69
ExplicitWidth = 684
ExplicitHeight = 617
PixelsPerInch = 96
@ -48,6 +47,8 @@ inherited fEditorRemesaCliente: TfEditorRemesaCliente
inherited lblDesbloquear: TcxLabel
Left = 578
ExplicitLeft = 578
AnchorX = 623
AnchorY = 14
end
end
inherited TBXDock: TTBXDock
@ -258,7 +259,7 @@ inherited fEditorRemesaCliente: TfEditorRemesaCliente
item
Width = 200
end>
ExplicitTop = 574
ExplicitTop = 564
ExplicitWidth = 676
end
inline frViewTotales1: TfrViewTotales [4]
@ -275,7 +276,7 @@ inherited fEditorRemesaCliente: TfEditorRemesaCliente
ParentFont = False
TabOrder = 4
ReadOnly = False
ExplicitTop = 537
ExplicitTop = 518
ExplicitWidth = 676
ExplicitHeight = 46
inherited dxLayoutControl1: TdxLayoutControl

View File

@ -63,6 +63,7 @@ type
procedure PonerTitulos(const ATitulo: string = ''); override;
function GetModified: Boolean; override;
function PuedoImprimir: Boolean; override;
public
property RemesaCliente: IBizRemesaCliente read GetRemesaCliente write SetRemesaCliente;
@ -183,6 +184,11 @@ begin
FController.Preview(FRemesaCliente);
end;
function TfEditorRemesaCliente.PuedoImprimir: Boolean;
begin
Result := inherited PuedoImprimir and (not RemesaCliente.Recibos.IDIsNull);
end;
procedure TfEditorRemesaCliente.SetRemesaCliente(const Value: IBizRemesaCliente);
begin
FRemesaCliente := Value;

View File

@ -63,6 +63,7 @@ type
procedure PonerTitulos(const ATitulo: string = ''); override;
function GetModified: Boolean; override;
function PuedoImprimir: Boolean; override;
public
property RemesaProveedor: IBizRemesaProveedor read GetRemesaProveedor write SetRemesaProveedor;
@ -104,6 +105,11 @@ begin
Result := bCambiado;
end;
function TfEditorRemesaProveedor.PuedoImprimir: Boolean;
begin
Result := inherited PuedoImprimir and (not RemesaProveedor.Recibos.IDIsNull);
end;
function TfEditorRemesaProveedor.GetViewRemesaProveedor: IViewRemesaProveedor;
begin
Result := FViewRemesaProveedor;
@ -340,4 +346,4 @@ end;
end.

Binary file not shown.

View File

@ -14,7 +14,7 @@ BEGIN
BEGIN
VALUE "FileVersion", "1.7.8.0\0"
VALUE "ProductVersion", "1.7.8.0\0"
VALUE "CompileDate", "martes, 24 de noviembre de 2009 11:06\0"
VALUE "CompileDate", "martes, 24 de noviembre de 2009 12:03\0"
END
END
BLOCK "VarFileInfo"