diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index 0964990c..34524641 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -3519,6 +3519,7 @@ begin end ^ + ALTER PROCEDURE PRO_PRES_CAPITULOS ( AID INTEGER) RETURNS ( @@ -3576,6 +3577,10 @@ begin do begin contador = contador + 1; + + if ((visible <> 0) and (tipo_detalle = 'Concepto')) then + total_acumulado = total_acumulado + importe_total; + if ((tipo_detalle <> 'Concepto') or (contador = num_filas)) then begin importe_total = total_acumulado; @@ -3587,10 +3592,6 @@ begin suspend; break; end - else begin - if (visible <> 0) then - total_acumulado = total_acumulado + importe_total; - end end end @@ -3607,6 +3608,7 @@ begin end ^ + ALTER PROCEDURE PRO_PRES_CAPITULOS_CONCEPTOS ( AID INTEGER) RETURNS ( @@ -3656,6 +3658,7 @@ do end ^ + ALTER PROCEDURE PRO_PRES_RESUMEN ( AID INTEGER) RETURNS ( @@ -3720,23 +3723,24 @@ begin do begin contador = contador + 1; - num_capitulos = num_capitulos + 1; + + if ((visible <> 0) and (tipo_detalle = 'Concepto')) then + total_acumulado = total_acumulado + importe_total; + if ((tipo_detalle <> 'Concepto') or (contador = num_filas)) then begin - total_acumulado = total_acumulado + importe_total; importe_total = total_acumulado; tipo_detalle = 'Titulo'; - concepto = 'CAPÍTULO ' || num_capitulos ||'. General'; + if (num_capitulos > 1) then + concepto = 'CAPÍTULO ' || num_capitulos ||'. General'; + else + concepto = 'General'; visible = 1; ID = -1; posicion = -1; suspend; break; end - else begin - if (visible <> 0) then - total_acumulado = total_acumulado + importe_total; - end end end