fixes bug#24308
qua: dev:Fabio git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@111544 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
d161cbc4c0
commit
bb79902609
|
@ -58,7 +58,7 @@ public class CategoriaDescuentoHibernateDAO
|
|||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
|
||||
sql.append(" SELECT coalesce(cd.indnaoaplicatarifaminima, 0) as tarifa ");
|
||||
sql.append(" SELECT cd.indnaoaplicatarifaminima as tarifa ");
|
||||
sql.append(" from categoria_descuento cd ");
|
||||
sql.append(" inner join categoria_ctrl cc ");
|
||||
sql.append(" on cc.categoriactrl_id = cd.categoriactrl_id ");
|
||||
|
@ -66,6 +66,7 @@ public class CategoriaDescuentoHibernateDAO
|
|||
sql.append(" and cc.activo = 1 ");
|
||||
sql.append(" where cd.categoria_id = :categoriaId ");
|
||||
sql.append(" and cd.activo = 1 ");
|
||||
sql.append(" and cd.indnaoaplicatarifaminima = 1 ");
|
||||
|
||||
Query query = getSession().createSQLQuery(sql.toString())
|
||||
.addScalar("tarifa", BooleanType.INSTANCE);
|
||||
|
@ -73,8 +74,8 @@ public class CategoriaDescuentoHibernateDAO
|
|||
query.setParameter("empresaId", empresaId );
|
||||
query.setParameter("categoriaId", categoriaId );
|
||||
|
||||
Boolean retorno = (Boolean)query.uniqueResult();
|
||||
|
||||
return Boolean.FALSE.equals(retorno);
|
||||
List<Boolean> retorno = (List<Boolean>)query.list();
|
||||
|
||||
return retorno !=null && !retorno.isEmpty() && Boolean.TRUE.equals(retorno.get(0)) ? Boolean.TRUE : Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue