diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index bde4623f..e00d3c81 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -3817,6 +3817,7 @@ for select pre.id, pre.id_presupuesto, pre.posicion, pre.tipo_detalle, F_RTFTOTEXT(F_RTFTOTEXT(pre.CONCEPTO)) as CONCEPTO, pre.cantidad, pre.unidad_medida, case + when (pre.cantidad = 0) then 0 when (pre.descuento <> 0) then (pre.importe_total / pre.cantidad) else pre.importe_unidad end as importe_unidad,