Arreglo en el recalculo de los detalles, cuando modificamos un artículo (elegimos otro articulo diferente dando al boton de referencia)

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@244 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
roberto 2008-02-05 15:49:19 +00:00
parent 9fad9cefc3
commit 6671f00f1b

View File

@ -155,8 +155,7 @@ begin
end;
end;
procedure TControllerDetallesArticulos.AnadirArticulos(
ADetalles: IDAStronglyTypedDataTable; const ANuevaFila: Boolean);
procedure TControllerDetallesArticulos.AnadirArticulos(ADetalles: IDAStronglyTypedDataTable; const ANuevaFila: Boolean);
var
AArticulos: IBizArticulo;
begin
@ -164,11 +163,17 @@ begin
begin
try
AArticulos := (FArticulosController.BuscarTodos as IBizArticulo);
AArticulos := FArticulosController.ElegirArticulos(AArticulos, 'Elija los artículos que desea añadir', True);
//Si nueva fila es false, quiere decir que se sustituye un determinado artículo, por ello la lista a seleccionar no debe ser multiselect
if ANuevaFila then
begin
AArticulos := FArticulosController.ElegirArticulos(AArticulos, 'Elija los artículos que desea añadir', True);
Add(ADetalles, AArticulos)
end
else
begin
AArticulos := FArticulosController.ElegirArticulos(AArticulos, 'Elija el artículo que desea añadir', False);
RellenarDetalle(ADetalles, AArticulos);
end;
finally
AArticulos := Nil;
end;
@ -307,6 +312,8 @@ procedure TControllerDetallesArticulos.RellenarDetalle(ADetalles: IDAStronglyTyp
begin
if Assigned(ADetalles) then
begin
BeginUpdate(ADetalles);
try
if not ADetalles.DataTable.Editing then
ADetalles.DataTable.Edit;
@ -315,6 +322,9 @@ begin
RellenarOtros(ADetalles, AArticulos);
ADetalles.DataTable.Post;
finally
EndUpdate(ADetalles);
end;
end;
end;