diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index 38a10643..25e43390 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -3455,15 +3455,27 @@ begin /* Tratar el resto de las filas */ - for select id, id_presupuesto, posicion, tipo_detalle, F_RTFTOTEXT(concepto) as concepto, - importe_total, coalesce(visible, 1) - from presupuestos_cliente_detalles - where tipo_detalle = 'Titulo' and id_presupuesto = :AID - order by id_presupuesto, posicion + for select id, id_presupuesto, posicion, tipo_detalle, + F_RTFTOTEXT(concepto) as concepto, importe_total, coalesce(visible, 1) + from presupuestos_cliente_detalles + where id_presupuesto = :AID and + tipo_detalle in ('Titulo', 'Subtotal') + order by posicion into :ID, :ID_PRESUPUESTO, :POSICION, :TIPO_DETALLE, :CONCEPTO, :IMPORTE_TOTAL, :VISIBLE do - suspend; + begin + contador = contador + 1; + if (tipo_detalle = 'Titulo') then + begin + concepto_capitulo = concepto; + end + if (tipo_detalle = 'Subtotal') then + begin + concepto = concepto_capitulo; + suspend; + end + end end^ SET TERM ; ^