Fix wrong behaviour of projects list filtering

The component that shows the filtering results is adding the unscheduled projects when they
are not excluded by the dates range, but they were appearing also when they were not matching
the combobox conditions.

FEA: ItEr77S15FilteringEnhancements
This commit is contained in:
Lorenzo Tilve Álvaro 2013-03-11 19:31:15 +01:00
parent cabf12ad8f
commit cd17d48d28

View file

@ -240,21 +240,10 @@ public class OrderDAO extends IntegrationEntityDAO<Order> implements
org.hibernate.criterion.Criterion and = Restrictions.and(
Restrictions.in("id", ordersIdsFiltered),
Restrictions.in("id", ordersIdsByDates));
if (ordersIdsUnscheduled.isEmpty()) {
c.add(and);
} else {
c.add(Restrictions.or(and,
Restrictions.in("id", ordersIdsUnscheduled)));
}
c.add(and);
} else {
if (ordersIdsFiltered != null) {
if (ordersIdsUnscheduled.isEmpty()) {
c.add(Restrictions.in("id", ordersIdsFiltered));
} else {
c.add(Restrictions.or(
Restrictions.in("id", ordersIdsFiltered),
Restrictions.in("id", ordersIdsUnscheduled)));
}
c.add(Restrictions.in("id", ordersIdsFiltered));
}
if (ordersIdsByDates != null) {
if (ordersIdsUnscheduled.isEmpty()) {