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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -93,6 +93,7 @@ type
procedure PonerTitulos(const ATitulo: string = ''); override; procedure PonerTitulos(const ATitulo: string = ''); override;
function GetModified: Boolean; override; function GetModified: Boolean; override;
procedure SetModified(const Value : Boolean); override; procedure SetModified(const Value : Boolean); override;
function PuedoImprimir: Boolean; override;
public public
property Controller : IPresupuestosClienteController read GetController write SetController; property Controller : IPresupuestosClienteController read GetController write SetController;
@ -336,6 +337,11 @@ begin
FController.Preview(FPresupuesto); FController.Preview(FPresupuesto);
end; end;
function TfEditorPresupuestoCliente.PuedoImprimir: Boolean;
begin
Result := inherited PuedoImprimir and (not Presupuesto.Cliente.IDIsNull);
end;
procedure TfEditorPresupuestoCliente.RecalcularPortePorUnidad; procedure TfEditorPresupuestoCliente.RecalcularPortePorUnidad;
begin begin
//Esta lógica se llamará en el editor porque es para facilitar el rellenado de información del documento //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 ClientWidth = 676
Scaled = False Scaled = False
OnClose = CustomEditorClose OnClose = CustomEditorClose
ExplicitTop = -69
ExplicitWidth = 684 ExplicitWidth = 684
ExplicitHeight = 617 ExplicitHeight = 617
PixelsPerInch = 96 PixelsPerInch = 96
@ -48,6 +47,8 @@ inherited fEditorRemesaCliente: TfEditorRemesaCliente
inherited lblDesbloquear: TcxLabel inherited lblDesbloquear: TcxLabel
Left = 578 Left = 578
ExplicitLeft = 578 ExplicitLeft = 578
AnchorX = 623
AnchorY = 14
end end
end end
inherited TBXDock: TTBXDock inherited TBXDock: TTBXDock
@ -258,7 +259,7 @@ inherited fEditorRemesaCliente: TfEditorRemesaCliente
item item
Width = 200 Width = 200
end> end>
ExplicitTop = 574 ExplicitTop = 564
ExplicitWidth = 676 ExplicitWidth = 676
end end
inline frViewTotales1: TfrViewTotales [4] inline frViewTotales1: TfrViewTotales [4]
@ -275,7 +276,7 @@ inherited fEditorRemesaCliente: TfEditorRemesaCliente
ParentFont = False ParentFont = False
TabOrder = 4 TabOrder = 4
ReadOnly = False ReadOnly = False
ExplicitTop = 537 ExplicitTop = 518
ExplicitWidth = 676 ExplicitWidth = 676
ExplicitHeight = 46 ExplicitHeight = 46
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl

View File

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

View File

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

Binary file not shown.

View File

@ -14,7 +14,7 @@ BEGIN
BEGIN BEGIN
VALUE "FileVersion", "1.7.8.0\0" VALUE "FileVersion", "1.7.8.0\0"
VALUE "ProductVersion", "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
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"