Presupuestos de cliente: repaso porque no dejaba cambiar la persona de contacto a la que va el presupuesto ni copiaba la persona de contacto al cambiar de cliente.
git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@797 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
c6af7429c8
commit
8c0c292d03
@ -83,6 +83,7 @@ begin
|
|||||||
FAX := AContacto.FAX;
|
FAX := AContacto.FAX;
|
||||||
MOVIL := AContacto.MOVIL_1;
|
MOVIL := AContacto.MOVIL_1;
|
||||||
EMAIL := AContacto.EMAIL_1;
|
EMAIL := AContacto.EMAIL_1;
|
||||||
|
PERSONA_CONTACTO := AContacto.PERSONA_CONTACTO;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
ADireccion.DataTable.Post;
|
ADireccion.DataTable.Post;
|
||||||
|
|||||||
@ -212,16 +212,17 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
|
|||||||
inherited ToolButton4: TToolButton
|
inherited ToolButton4: TToolButton
|
||||||
Left = 278
|
Left = 278
|
||||||
Top = 0
|
Top = 0
|
||||||
|
Wrap = True
|
||||||
ExplicitLeft = 278
|
ExplicitLeft = 278
|
||||||
ExplicitTop = 0
|
ExplicitTop = 0
|
||||||
end
|
end
|
||||||
inherited ToolButton14: TToolButton
|
inherited ToolButton14: TToolButton
|
||||||
Left = 334
|
Left = 0
|
||||||
Top = 0
|
Wrap = False
|
||||||
ExplicitLeft = 334
|
ExplicitLeft = 0
|
||||||
ExplicitTop = 0
|
|
||||||
end
|
end
|
||||||
inherited FontName: TJvFontComboBox
|
inherited FontName: TJvFontComboBox
|
||||||
|
Left = 65
|
||||||
Top = 22
|
Top = 22
|
||||||
ExplicitTop = 22
|
ExplicitTop = 22
|
||||||
end
|
end
|
||||||
|
|||||||
@ -282,41 +282,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfEditorPresupuestoCliente.OnClienteChanged(Sender: TObject);
|
procedure TfEditorPresupuestoCliente.OnClienteChanged(Sender: TObject);
|
||||||
var
|
|
||||||
AClientesController : IClientesController;
|
|
||||||
ADireccion : IBizDireccionesContacto;
|
|
||||||
begin
|
begin
|
||||||
if Assigned(FPresupuesto) then
|
if Assigned(FPresupuesto) then
|
||||||
begin
|
if (FPresupuesto.Detalles.RecordCount > 0) then
|
||||||
FPresupuesto.Cliente := ViewPresupuesto.ViewClientePresupuesto.Cliente;
|
FController.DetallesController.ActualizarDetalles(FPresupuesto.Detalles, FPresupuesto.Cliente);
|
||||||
|
|
||||||
AClientesController := TClientesController.Create;
|
|
||||||
try
|
|
||||||
{ // Esto podría ser configurable en el programa
|
|
||||||
if not AClientesController.TieneDatosBancarios(FPresupuesto.Cliente) then
|
|
||||||
MessageBox(0, 'Este cliente no tiene datos bancarios en su ficha', 'Atención', MB_ICONWARNING or MB_OK);}
|
|
||||||
|
|
||||||
case FPresupuesto.Cliente.Direcciones.RecordCount of
|
|
||||||
0 : begin
|
|
||||||
FViewClientePresupuesto.RefrescarDireccion;
|
|
||||||
FPresupuesto.Edit;
|
|
||||||
FPresupuesto.IMPORTE_PORTE := 0;
|
|
||||||
end;
|
|
||||||
else begin
|
|
||||||
FViewClientePresupuesto.ElegirDireccionCliente;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// Si el Presupuesto tiene detalles hay que mirar si los descuentos y otros campos
|
|
||||||
// para los artículos hay que cambiarlos.
|
|
||||||
if (FPresupuesto.Detalles.RecordCount > 0) then
|
|
||||||
FController.DetallesController.ActualizarDetalles(FPresupuesto.Detalles, FPresupuesto.Cliente);
|
|
||||||
|
|
||||||
finally
|
|
||||||
ADireccion := NIL;
|
|
||||||
AClientesController := NIL;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfEditorPresupuestoCliente.pgPaginasChanging(Sender: TObject;
|
procedure TfEditorPresupuestoCliente.pgPaginasChanging(Sender: TObject;
|
||||||
|
|||||||
@ -316,6 +316,14 @@ begin
|
|||||||
if not FCliente.DataTable.Active then
|
if not FCliente.DataTable.Active then
|
||||||
FCliente.DataTable.Active := True;
|
FCliente.DataTable.Active := True;
|
||||||
edtPersonaContacto.Enabled := True;
|
edtPersonaContacto.Enabled := True;
|
||||||
|
|
||||||
|
if FCliente.Direcciones.RecordCount > 0 then
|
||||||
|
ElegirDireccionCliente
|
||||||
|
else begin
|
||||||
|
FPresupuesto.Edit;
|
||||||
|
FPresupuesto.PERSONA_CONTACTO := FCliente.PERSONA_CONTACTO;
|
||||||
|
RefrescarDireccion;
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
dsCliente.DataTable := NIL;
|
dsCliente.DataTable := NIL;
|
||||||
@ -376,6 +384,7 @@ begin
|
|||||||
if not FCliente.DataTable.Active then
|
if not FCliente.DataTable.Active then
|
||||||
FCliente.DataTable.Active := True;
|
FCliente.DataTable.Active := True;
|
||||||
|
|
||||||
|
edtPersonaContacto.Enabled := True;
|
||||||
RefrescarDireccion;
|
RefrescarDireccion;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user