Se para que la pregunta de si desea guardar los cambios (al enviar por email) se haga en el action de enviar por email

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@978 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
roberto 2009-11-25 12:24:10 +00:00
parent 8e34090d13
commit b15b7f6df2
10 changed files with 301 additions and 242 deletions

View File

@ -66,52 +66,58 @@ var
AFilter : String;
AObj : ISeleccionable;
i : Integer;
AID: Integer;
begin
AFilter := '';
AFiltered := False;
if OnlySelectedRows then
begin
if not Supports(ASource, ISeleccionable, aObj) then
raise Exception.Create('El origen de datos no soporta la interfaz ISeleccionable (CopyDataTable)');
{ Si la tabla está abierta, la cerramos antes de aplicar los filtros
porque por cada cambio en el filtro se hacen llamadas internas de TDADataTable. }
if ASource.Active then
ASource.Close;
// Si la tabla origen viene con un filtro, lo guardamos para luego restablecerlo.
if ASource.Filtered then
begin
AFiltered := True;
AFilter := ASource.Filter;
ASource.Filtered := False;
end;
ASource.Filter := '';
//Si no hay elemento seleccionados filtramos para que ATarget se quede vacia
if (AObj.SelectedRecords.Count = 0) then
ASource.Filter := ASource.Filter + '(' + ASource.RecIDField.FieldName + ' = ' + IntToStr(ID_NULO) + ')'
//En caso contrario filtramos por los elementos seleccionados
else
for i := 0 to AObj.SelectedRecords.Count - 1 do
begin
if (i > 0) then
ASource.Filter := ASource.Filter + ' or ';
ASource.Filter := ASource.Filter + '(' + ASource.RecIDField.FieldName + ' = ' + IntToStr(AObj.SelectedRecords.Items[i]) + ')';
end;
ASource.Filtered := True;
end;
DABin := Binary.Create;
DADataStreamer := TDABin2DataStreamer.Create(nil);
ShowHourglassCursor;
ASource.DisableControls;
ATarget.DisableControls;
AID := ASource.GetRowRecIDValue; //Se guarda la posicion de la tabla fuente
try
if OnlySelectedRows then
begin
if not Supports(ASource, ISeleccionable, aObj) then
raise Exception.Create('El origen de datos no soporta la interfaz ISeleccionable (CopyDataTable)');
{ Si la tabla está abierta, la cerramos antes de aplicar los filtros
porque por cada cambio en el filtro se hacen llamadas internas de TDADataTable. }
if ASource.Active then
ASource.Close;
// Si la tabla origen viene con un filtro, lo guardamos para luego restablecerlo.
if ASource.Filtered then
begin
AFiltered := True;
AFilter := ASource.Filter;
ASource.Filtered := False;
end;
ASource.Filter := '';
//Si no hay elemento seleccionados filtramos para que ATarget se quede vacia
if (AObj.SelectedRecords.Count = 0) then
ASource.Filter := ASource.Filter + '(' + ASource.RecIDField.FieldName + ' = ' + IntToStr(ID_NULO) + ')'
//En caso contrario filtramos por los elementos seleccionados
else
for i := 0 to AObj.SelectedRecords.Count - 1 do
begin
if (i > 0) then
ASource.Filter := ASource.Filter + ' or ';
ASource.Filter := ASource.Filter + '(' + ASource.RecIDField.FieldName + ' = ' + IntToStr(AObj.SelectedRecords.Items[i]) + ')';
end;
ASource.Filtered := True;
end;
DABin := Binary.Create;
DADataStreamer := TDABin2DataStreamer.Create(nil);
ATarget.LogicalName := ASource.LogicalName; // We need to specify new dataset LogicalName
ATarget.RemoteFetchEnabled := False; // "Desconectamos" la tabla destino del servidor
@ -135,6 +141,8 @@ begin
ASource.Filtered := True;
end;
ASource.Locate(ASource.RecIDField.FieldName, AID, []); //Se intenta restablecer la posicion inicial de la tabla fuente
finally
FreeAndNil(DABin);
FreeAndNil(DADataStreamer);

View File

@ -127,13 +127,15 @@ inherited fEditorAlbaranCliente: TfEditorAlbaranCliente
inherited lblDesbloquear: TcxLabel
Left = 667
ExplicitLeft = 667
AnchorX = 712
AnchorY = 14
end
end
inherited TBXDock: TTBXDock
Width = 765
ExplicitWidth = 765
inherited tbxMain: TTBXToolbar
ExplicitWidth = 613
ExplicitWidth = 488
inherited TBXItem2: TTBXItem
Visible = False
end
@ -208,13 +210,14 @@ inherited fEditorAlbaranCliente: TfEditorAlbaranCliente
ExplicitLeft = 278
ExplicitTop = 0
end
inherited ToolButton14: TToolButton [4]
inherited ToolButton14: TToolButton
Left = 334
Top = 0
Wrap = False
ExplicitLeft = 334
ExplicitTop = 0
end
inherited FontName: TJvFontComboBox [5]
inherited FontName: TJvFontComboBox
Left = 399
Top = 0
ExplicitLeft = 399
@ -223,18 +226,12 @@ inherited fEditorAlbaranCliente: TfEditorAlbaranCliente
inherited FontSize: TEdit
Left = 544
Top = 0
Width = 90
Width = 106
ExplicitLeft = 544
ExplicitTop = 0
ExplicitWidth = 90
ExplicitWidth = 106
end
inherited UpDown1: TUpDown
Left = 634
Top = 0
ExplicitLeft = 634
ExplicitTop = 0
end
inherited ToolButton13: TToolButton
inherited ToolButton13: TToolButton [7]
Left = 0
Top = 0
Wrap = True
@ -242,47 +239,52 @@ inherited fEditorAlbaranCliente: TfEditorAlbaranCliente
ExplicitTop = 0
ExplicitHeight = 27
end
inherited ToolButton6: TToolButton [9]
inherited UpDown1: TUpDown [8]
Left = 0
Top = 27
ExplicitLeft = 0
ExplicitTop = 27
end
inherited ToolButton7: TToolButton [10]
Left = 66
inherited ToolButton6: TToolButton
Left = 17
Top = 27
ExplicitLeft = 66
ExplicitLeft = 17
ExplicitTop = 27
end
inherited ToolButton8: TToolButton [11]
Left = 133
inherited ToolButton7: TToolButton
Left = 83
Top = 27
ExplicitLeft = 133
ExplicitLeft = 83
ExplicitTop = 27
end
inherited ToolButton12: TToolButton [12]
Left = 216
inherited ToolButton8: TToolButton
Left = 150
Top = 27
ExplicitLeft = 216
ExplicitTop = 27
ExplicitHeight = 22
end
inherited ToolButton9: TToolButton [13]
Left = 224
Top = 27
ExplicitLeft = 224
ExplicitLeft = 150
ExplicitTop = 27
end
inherited ToolButton10: TToolButton [14]
Left = 369
inherited ToolButton12: TToolButton
Left = 233
Top = 27
ExplicitLeft = 369
ExplicitLeft = 233
ExplicitTop = 27
end
inherited ToolButton11: TToolButton [15]
Left = 494
inherited ToolButton9: TToolButton
Left = 241
Top = 27
ExplicitLeft = 494
ExplicitLeft = 241
ExplicitTop = 27
end
inherited ToolButton10: TToolButton
Left = 386
Top = 27
ExplicitLeft = 386
ExplicitTop = 27
end
inherited ToolButton11: TToolButton
Left = 511
Top = 27
ExplicitLeft = 511
ExplicitTop = 27
end
end
@ -665,7 +667,9 @@ inherited fEditorAlbaranCliente: TfEditorAlbaranCliente
object actEnviarEMail: TAction
Category = 'Acciones'
Caption = 'Enviar por e-mail...'
Enabled = False
ImageIndex = 21
Visible = False
OnExecute = actEnviarEMailExecute
OnUpdate = actEnviarEMailUpdate
end

View File

@ -72,7 +72,8 @@ type
procedure PrevisualizarInterno; override;
procedure PonerTitulos(const ATitulo: string = ''); override;
function PuedoImprimir: Boolean; override;
function PuedoImprimir: Boolean; override;
function PuedoEnviar: Boolean; virtual;
public
destructor Destroy; override;
@ -100,14 +101,28 @@ uses
procedure TfEditorFacturaCliente.actEnviarEMailExecute(Sender: TObject);
begin
inherited;
FController.EnviarFacturaPorEMail(Factura);
if actEnviarEMail.Enabled then
begin
if Modified then
begin
if (ShowConfirmMessage('Se han producido cambios', 'Se han producido cambios y no se puede enviar por email hasta que no se guarden.' + #10#13 +
'¿Desea guardarlos ahora?') = IDYES) then
begin
GuardarInterno;
FController.EnviarFacturaPorEMail(Factura);
end
else
ShowInfoMessage('Recuerde guardar los cambios si quiere enviar por email.');
end
else
FController.EnviarFacturaPorEMail(Factura);
end;
end;
procedure TfEditorFacturaCliente.actEnviarEMailUpdate(Sender: TObject);
begin
inherited;
(Sender as TAction).Enabled := HayDatos;
(Sender as TAction).Enabled := HayDatos and PuedoEnviar;
end;
constructor TfEditorFacturaCliente.Create(AOwner: TComponent);
@ -368,6 +383,11 @@ begin
end;
end;
function TfEditorFacturaCliente.PuedoEnviar: Boolean;
begin
Result := not Factura.Cliente.IDIsNull;
end;
function TfEditorFacturaCliente.PuedoImprimir: Boolean;
begin
Result := inherited PuedoImprimir and (not Factura.Cliente.IDIsNull);

View File

@ -5,7 +5,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
ClientHeight = 678
ClientWidth = 879
OnClose = CustomEditorClose
ExplicitTop = -164
ExplicitWidth = 887
ExplicitHeight = 712
PixelsPerInch = 96
@ -85,20 +84,16 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
TabOrder = 1
OnChanging = pgPaginasChanging
ExplicitWidth = 873
ExplicitHeight = 534
ExplicitHeight = 531
inherited pagGeneral: TTabSheet
ExplicitLeft = 4
ExplicitTop = 24
ExplicitWidth = 865
ExplicitHeight = 506
ExplicitHeight = 503
end
object pagContenido: TTabSheet
Caption = 'Contenido'
ImageIndex = 1
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 506
inline frViewDetallesPedidoProveedor1: TfrViewDetallesPedidoProveedor
Left = 0
Top = 0
@ -116,7 +111,7 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
TabOrder = 0
ReadOnly = False
ExplicitWidth = 865
ExplicitHeight = 506
ExplicitHeight = 503
inherited ToolBar1: TToolBar
Width = 865
Height = 46
@ -140,82 +135,84 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
inherited FontName: TJvFontComboBox
Left = 65
Top = 22
ExplicitLeft = 65
ExplicitTop = 22
ExplicitLeft = 399
ExplicitTop = 0
end
inherited FontSize: TEdit
Left = 210
Top = 22
Left = 544
Top = 0
Width = 294
ExplicitLeft = 210
ExplicitTop = 22
ExplicitLeft = 544
ExplicitTop = 0
ExplicitWidth = 294
end
inherited UpDown1: TUpDown
Left = 504
Top = 22
ExplicitLeft = 504
ExplicitTop = 22
Left = 838
Top = 0
ExplicitLeft = 838
ExplicitTop = 0
end
inherited ToolButton13: TToolButton
Left = 521
Top = 22
ExplicitLeft = 521
ExplicitTop = 22
Left = 0
Top = 0
Wrap = True
ExplicitLeft = 0
ExplicitTop = 0
ExplicitHeight = 27
end
inherited ToolButton6: TToolButton
Left = 529
Top = 22
ExplicitLeft = 529
ExplicitTop = 22
Left = 0
Top = 27
ExplicitLeft = 0
ExplicitTop = 27
end
inherited ToolButton7: TToolButton
Left = 595
Top = 22
ExplicitLeft = 595
ExplicitTop = 22
Left = 66
Top = 27
ExplicitLeft = 66
ExplicitTop = 27
end
inherited ToolButton8: TToolButton
Left = 662
Top = 22
ExplicitLeft = 662
ExplicitTop = 22
Left = 133
Top = 27
ExplicitLeft = 133
ExplicitTop = 27
end
inherited ToolButton12: TToolButton
Left = 745
Top = 22
ExplicitLeft = 745
ExplicitTop = 22
Left = 216
Top = 27
ExplicitLeft = 216
ExplicitTop = 27
end
inherited ToolButton9: TToolButton
Left = 753
Top = 22
ExplicitLeft = 753
ExplicitTop = 22
Left = 224
Top = 27
ExplicitLeft = 224
ExplicitTop = 27
end
inherited ToolButton10: TToolButton
Left = 898
Top = 22
ExplicitLeft = 898
ExplicitTop = 22
Left = 369
Top = 27
ExplicitLeft = 369
ExplicitTop = 27
end
inherited ToolButton11: TToolButton
Left = 1023
Top = 22
ExplicitLeft = 1023
ExplicitTop = 22
Left = 494
Top = 27
ExplicitLeft = 494
ExplicitTop = 27
end
end
inherited cxGrid: TcxGrid
Top = 72
Top = 77
Width = 865
Height = 431
Height = 426
ExplicitTop = 77
ExplicitWidth = 865
ExplicitHeight = 429
end
inherited TBXDock1: TTBXDock
Top = 46
Top = 51
Width = 865
ExplicitTop = 51
ExplicitWidth = 865
@ -237,10 +234,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
object pagInicidencias: TTabSheet
Caption = 'Incidencias'
ImageIndex = 2
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 506
inline frViewIncidenciasProv: TfrViewIncidencias
Left = 0
Top = 0
@ -256,7 +249,7 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
TabOrder = 0
ReadOnly = False
ExplicitWidth = 865
ExplicitHeight = 506
ExplicitHeight = 503
inherited pnlSup: TPanel
Width = 865
ExplicitWidth = 865
@ -286,7 +279,7 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
item
Width = 200
end>
ExplicitTop = 672
ExplicitTop = 659
ExplicitWidth = 879
end
inline frViewTotales1: TfrViewTotales [4]
@ -303,7 +296,7 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
ParentFont = False
TabOrder = 4
ReadOnly = False
ExplicitTop = 632
ExplicitTop = 613
ExplicitWidth = 879
ExplicitHeight = 46
inherited dxLayoutControl1: TdxLayoutControl
@ -311,7 +304,7 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
Height = 46
LookAndFeel = dxLayoutOfficeLookAndFeel1
ExplicitWidth = 879
ExplicitHeight = 43
ExplicitHeight = 46
inherited Bevel3: TBevel
Left = 458
Top = 11

View File

@ -61,7 +61,8 @@ type
procedure ImprimirInterno; override;
procedure OnProveedorChanged(Sender : TObject);
function PuedoImprimir: Boolean; override;
function PuedoImprimir: Boolean; override;
function PuedoEnviar: Boolean; virtual;
//Si queremos crear otra vista para el editor heredado solo tendriamos que
//sobreescribir este metodo
@ -93,14 +94,28 @@ uses
procedure TfEditorPedidoProveedor.actEnviarEMailExecute(Sender: TObject);
begin
inherited;
FController.EnviarPedidoPorEMail(Pedido);
if actEnviarEMail.Enabled then
begin
if Modified then
begin
if (ShowConfirmMessage('Se han producido cambios', 'Se han producido cambios y no se puede enviar por email hasta que no se guarden.' + #10#13 +
'¿Desea guardarlos ahora?') = IDYES) then
begin
GuardarInterno;
FController.EnviarPedidoPorEMail(Pedido);
end
else
ShowInfoMessage('Recuerde guardar los cambios si quiere enviar por email.');
end
else
FController.EnviarPedidoPorEMail(Pedido);
end;
end;
procedure TfEditorPedidoProveedor.actEnviarEMailUpdate(Sender: TObject);
begin
inherited;
(Sender as TAction).Enabled := HayDatos;
(Sender as TAction).Enabled := HayDatos and PuedoEnviar;
end;
procedure TfEditorPedidoProveedor.AsignarVista;
@ -230,6 +245,11 @@ begin
FController.Print(FPedido, AllItems, FImprimirPrecios, FImprimirRefProveedor);
end;
function TfEditorPedidoProveedor.PuedoEnviar: Boolean;
begin
Result := not Pedido.Proveedor.IDIsNull;
end;
function TfEditorPedidoProveedor.PuedoImprimir: Boolean;
begin
Result := inherited PuedoImprimir and (not Pedido.Proveedor.IDIsNull);

View File

@ -313,6 +313,7 @@ var
NombreCapitulo : String;
Estilo : OleVariant;
begin
FNumCapitulos := 0;
FContadorCap := 0;
FNumCapOpc := 0;
with FDocumento, tbl_Detalles do
@ -347,16 +348,18 @@ begin
begin
NombreCapitulo := 'Capítulo ' + IntToStr(FContadorCap + 1) + '. ' + FieldByName('CONCEPTO').AsString;
Inc(FContadorCap);
Inc(FNumCapitulos);
end
else begin
NombreCapitulo := 'Capítulo opcional. ' + FieldByName('CONCEPTO').AsString;
Inc(FNumCapOpc);
Inc(FNumCapitulos);
end;
FWordApp.InsertText(NombreCapitulo);
FWordApp.InsertText(#13);
ListaCapitulos[FContadorCap].Tipo := FieldByName('TIPO_DETALLE').AsString;
ListaCapitulos[FContadorCap].Nombre := NombreCapitulo;
ListaCapitulos[FNumCapitulos].Tipo := FieldByName('TIPO_DETALLE').AsString;
ListaCapitulos[FNumCapitulos].Nombre := NombreCapitulo;
{ Pegar una tabla para rellenarla }
FWordApp.Application.Selection.Paste;
Next;
@ -373,7 +376,6 @@ begin
InsertarConceptos(Document.Tables.Item(Document.Tables.Count - 2));
end;
end;
FNumCapitulos := FContadorCap;
end;
Result := True;
end;

View File

@ -177,8 +177,6 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
ExplicitWidth = 758
ExplicitHeight = 366
inherited pagGeneral: TTabSheet
ExplicitLeft = 4
ExplicitTop = 24
ExplicitWidth = 750
ExplicitHeight = 338
end
@ -214,93 +212,89 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
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 = 65
Top = 22
ExplicitTop = 22
Left = 334
Top = 0
ExplicitLeft = 334
ExplicitTop = 0
end
inherited FontSize: TEdit
Top = 22
inherited FontSize: TEdit [5]
Left = 479
Top = 0
Width = 200
ExplicitTop = 22
ExplicitLeft = 479
ExplicitTop = 0
ExplicitWidth = 200
end
inherited ToolButton14: TToolButton [6]
Left = 679
Top = 0
Wrap = True
ExplicitLeft = 679
end
inherited UpDown1: TUpDown
Left = 345
Top = 22
ExplicitLeft = 345
ExplicitTop = 22
Left = 0
ExplicitLeft = 0
end
inherited ToolButton13: TToolButton
Left = 362
Left = 17
ExplicitLeft = 17
end
inherited ToolButton6: TToolButton [9]
Left = 25
Top = 22
ExplicitLeft = 362
ExplicitLeft = 25
ExplicitTop = 22
end
inherited ToolButton6: TToolButton
Left = 370
inherited ToolButton7: TToolButton [10]
Left = 91
Top = 22
ExplicitLeft = 370
Wrap = False
ExplicitLeft = 91
ExplicitTop = 22
end
inherited ToolButton7: TToolButton
Left = 436
inherited ToolButton8: TToolButton [11]
Left = 158
Top = 22
ExplicitLeft = 436
ExplicitLeft = 158
ExplicitTop = 22
end
inherited ToolButton8: TToolButton
Left = 503
inherited ToolButton12: TToolButton [12]
Left = 241
Wrap = False
ExplicitLeft = 241
ExplicitHeight = 22
end
inherited ToolButton9: TToolButton [13]
Left = 249
Top = 22
ExplicitLeft = 503
ExplicitLeft = 249
ExplicitTop = 22
end
inherited ToolButton12: TToolButton
Left = 0
inherited ToolButton10: TToolButton [14]
Left = 394
Top = 22
Wrap = True
ExplicitLeft = 0
ExplicitLeft = 394
ExplicitTop = 22
ExplicitHeight = 27
end
inherited ToolButton9: TToolButton
Left = 0
Top = 49
ExplicitLeft = 0
ExplicitTop = 49
end
inherited ToolButton10: TToolButton
Left = 145
Top = 49
ExplicitLeft = 145
ExplicitTop = 49
end
inherited ToolButton11: TToolButton
Left = 270
Top = 49
ExplicitLeft = 270
ExplicitTop = 49
inherited ToolButton11: TToolButton [15]
Left = 519
ExplicitLeft = 519
end
end
inherited cxGrid: TcxGrid
Top = 99
Top = 72
Width = 750
Height = 239
Height = 266
ExplicitTop = 104
ExplicitWidth = 750
ExplicitHeight = 234
end
inherited TBXDock1: TTBXDock
Top = 73
Top = 46
Width = 750
ExplicitTop = 78
ExplicitWidth = 750
@ -860,36 +854,36 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
ExplicitWidth = 764
ExplicitHeight = 125
inherited Bevel3: TBevel
Left = 429
Left = 385
Top = 80
Height = 75
ExplicitLeft = 429
ExplicitLeft = 385
ExplicitTop = 80
ExplicitHeight = 75
end
inherited Bevel4: TBevel
Left = 541
Left = 497
Top = 122
Width = 192
ExplicitLeft = 541
Width = 147
ExplicitLeft = 497
ExplicitTop = 122
ExplicitWidth = 192
ExplicitWidth = 147
end
inherited Bevel1: TBevel
Left = 541
Left = 497
Top = 238
Width = 73
ExplicitLeft = 541
Width = 147
ExplicitLeft = 497
ExplicitTop = 238
ExplicitWidth = 73
ExplicitWidth = 147
end
inherited Bevel2: TBevel
Left = 130
Top = 240
Width = 368
Width = 158
ExplicitLeft = 130
ExplicitTop = 240
ExplicitWidth = 368
ExplicitWidth = 158
end
inherited ImporteDto: TcxDBCurrencyEdit
Left = 201
@ -905,27 +899,27 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Width = 87
end
inherited ImporteIVA: TcxDBCurrencyEdit
Left = 612
Left = 568
Top = 157
Style.LookAndFeel.SkinName = ''
Style.IsFontAssigned = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 612
ExplicitLeft = 568
ExplicitTop = 157
ExplicitWidth = 20
Width = 20
end
inherited ImporteTotal: TcxDBCurrencyEdit
Left = 542
Left = 498
Top = 211
Style.LookAndFeel.SkinName = ''
Style.IsFontAssigned = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 542
ExplicitLeft = 498
ExplicitTop = 211
ExplicitWidth = 90
Width = 90
@ -942,49 +936,49 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
ExplicitTop = 107
end
inherited edtIVA: TcxDBSpinEdit
Left = 541
Left = 497
Top = 157
Style.LookAndFeel.SkinName = ''
Style.IsFontAssigned = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 541
ExplicitLeft = 497
ExplicitTop = 157
end
inherited ImporteBase: TcxDBCurrencyEdit
Left = 541
Left = 497
Top = 80
Style.LookAndFeel.SkinName = ''
Style.IsFontAssigned = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 541
ExplicitLeft = 497
ExplicitTop = 80
ExplicitWidth = 91
Width = 91
end
inherited edtRE: TcxDBSpinEdit
Left = 541
Left = 497
Top = 184
Style.LookAndFeel.SkinName = ''
Style.IsFontAssigned = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 541
ExplicitLeft = 497
ExplicitTop = 184
end
inherited ImporteRE: TcxDBCurrencyEdit
Left = 612
Left = 568
Top = 184
Style.LookAndFeel.SkinName = ''
Style.IsFontAssigned = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 612
ExplicitLeft = 568
ExplicitTop = 184
ExplicitWidth = 20
Width = 20
@ -1028,9 +1022,9 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Width = 20
end
inherited bTiposIVA: TButton
Left = 281
Left = 237
Top = 161
ExplicitLeft = 281
ExplicitLeft = 237
ExplicitTop = 161
end
inherited cbRecargoEquivalencia: TcxDBCheckBox
@ -1042,32 +1036,32 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 130
ExplicitTop = 188
ExplicitWidth = 221
Width = 221
ExplicitWidth = 158
Width = 158
end
inherited edtRetencion: TcxDBSpinEdit
Left = 541
Left = 497
Top = 258
Style.LookAndFeel.SkinName = ''
Style.IsFontAssigned = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 541
ExplicitLeft = 497
ExplicitTop = 258
end
inherited edtImporteRetencion: TcxDBCurrencyEdit
Left = 612
Left = 568
Top = 258
Style.LookAndFeel.SkinName = ''
Style.IsFontAssigned = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 612
ExplicitLeft = 568
ExplicitTop = 258
ExplicitWidth = 180
Width = 180
ExplicitWidth = 20
Width = 20
end
inherited edtFechaRetencion: TcxDBDateEdit
Left = 130
@ -1078,8 +1072,8 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 130
ExplicitTop = 260
ExplicitWidth = 280
Width = 280
ExplicitWidth = 158
Width = 158
end
inherited cbBonificacion: TcxCheckBox
Left = 21
@ -1102,8 +1096,6 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 367
ExplicitTop = 29
ExplicitWidth = 325
Width = 325
end
inherited eImporteBonificacion: TcxDBCurrencyEdit
Left = 449

View File

@ -93,7 +93,8 @@ type
procedure PonerTitulos(const ATitulo: string = ''); override;
function GetModified: Boolean; override;
procedure SetModified(const Value : Boolean); override;
function PuedoImprimir: Boolean; override;
function PuedoImprimir: Boolean; override;
function PuedoEnviar: Boolean; virtual;
public
property Controller : IPresupuestosClienteController read GetController write SetController;
@ -124,14 +125,28 @@ end;
procedure TfEditorPresupuestoCliente.actEnviarPorEMailExecute(Sender: TObject);
begin
inherited;
FController.EnviarPresupuestoPorEMail(Presupuesto);
if actEnviarPorEMail.Enabled then
begin
if Modified then
begin
if (ShowConfirmMessage('Se han producido cambios', 'Se han producido cambios y no se puede enviar por email hasta que no se guarden.' + #10#13 +
'¿Desea guardarlos ahora?') = IDYES) then
begin
GuardarInterno;
FController.EnviarPresupuestoPorEMail(Presupuesto);
end
else
ShowInfoMessage('Recuerde guardar los cambios si quiere enviar por email.');
end
else
FController.EnviarPresupuestoPorEMail(Presupuesto);
end;
end;
procedure TfEditorPresupuestoCliente.actEnviarPorEMailUpdate(Sender: TObject);
begin
inherited;
(Sender as TAction).Enabled := HayDatos;
(Sender as TAction).Enabled := HayDatos and PuedoEnviar;
end;
procedure TfEditorPresupuestoCliente.actGenerarCertificadoExecute(
@ -337,6 +352,11 @@ begin
FController.Preview(FPresupuesto);
end;
function TfEditorPresupuestoCliente.PuedoEnviar: Boolean;
begin
Result := not Presupuesto.Cliente.IDIsNull;
end;
function TfEditorPresupuestoCliente.PuedoImprimir: Boolean;
begin
Result := inherited PuedoImprimir and (not Presupuesto.Cliente.IDIsNull);

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 12:03\0"
VALUE "CompileDate", "miércoles, 25 de noviembre de 2009 13:14\0"
END
END
BLOCK "VarFileInfo"