Arreglada la generación de presupuestos en Word para el caso de que haya un capítulo general (no salía la parte del resumen) y para un capítulo normal + un capítulo opcional (en el resumen, el importe del opcional salía en el capítulo normal).

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@980 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
David Arranz 2009-11-27 14:55:57 +00:00
parent b15b7f6df2
commit 1f23f8860f

View File

@ -194,11 +194,13 @@ begin
Inc (iContador); Inc (iContador);
end; end;
ListaCapitulos[FContadorCap].Total := TotalConceptos; ListaCapitulos[FContadorCap].Total := TotalConceptos;
// Borrar la fila vacía que sobra // Borrar la fila vacía que sobra
Rows.Item(iContador).Cells.Delete(shiftCells); Rows.Item(iContador).Cells.Delete(shiftCells);
if FImportes if FImportes then
then Cell(iContador, 1).Range.Text := 'Total: ' + FormatFloat(DISPLAY_EUROS2, TotalConceptos) Cell(iContador, 1).Range.Text := 'Total: ' + FormatFloat(DISPLAY_EUROS2, TotalConceptos)
else Cell(iContador, 1).Range.Text := ''; else
Cell(iContador, 1).Range.Text := '';
AutoFitBehavior(wdAutoFitWindow); AutoFitBehavior(wdAutoFitWindow);
end; end;
@ -352,6 +354,7 @@ begin
end end
else begin else begin
NombreCapitulo := 'Capítulo opcional. ' + FieldByName('CONCEPTO').AsString; NombreCapitulo := 'Capítulo opcional. ' + FieldByName('CONCEPTO').AsString;
Inc(FContadorCap);
Inc(FNumCapOpc); Inc(FNumCapOpc);
Inc(FNumCapitulos); Inc(FNumCapitulos);
end; end;
@ -368,6 +371,7 @@ begin
if FContadorCap = 0 then if FContadorCap = 0 then
begin begin
Inc(FContadorCap); // Se considera el conjunto de conceptos sueltos como un capítulo. Inc(FContadorCap); // Se considera el conjunto de conceptos sueltos como un capítulo.
Inc(FNumCapitulos);
{ Pegar una tabla para rellenarla } { Pegar una tabla para rellenarla }
FWordApp.Application.Selection.Paste; FWordApp.Application.Selection.Paste;
InsertarConceptos(Document.Tables.Item(Document.Tables.Count - 2)); InsertarConceptos(Document.Tables.Item(Document.Tables.Count - 2));
@ -463,9 +467,10 @@ begin
Cell(iContador, 1).Range.Text := 'General' Cell(iContador, 1).Range.Text := 'General'
else else
Cell(iContador, 1).Range.Text := ListaCapitulos[iAux].Nombre; Cell(iContador, 1).Range.Text := ListaCapitulos[iAux].Nombre;
if FImportes if FImportes then
then Cell(iContador, 2).Range.Text := FormatFloat(DISPLAY_EUROS2, ListaCapitulos[iAux].Total) Cell(iContador, 2).Range.Text := FormatFloat(DISPLAY_EUROS2, ListaCapitulos[iAux].Total)
else Cell(iContador, 2).Range.Text := ''; else
Cell(iContador, 2).Range.Text := '';
TotalConceptos := TotalConceptos + ListaCapitulos[iAux].Total; TotalConceptos := TotalConceptos + ListaCapitulos[iAux].Total;
Inc (iContador); Inc (iContador);
end; end;