ItEr45S09RFNavegacionOrganizacionTraballoItEr44S15 : Changes the order predicate to filter correctly when its dates are empty.
This commit is contained in:
parent
debb8dd8b8
commit
91d15c8055
1 changed files with 14 additions and 10 deletions
|
|
@ -185,11 +185,22 @@ public class OrderPredicate implements IPredicate {
|
|||
private boolean acceptFiltersDates(Order order) {
|
||||
// Check if exist work report items into interval between the start date
|
||||
// and finish date.
|
||||
if (isInTheRangeFilterDates(order.getInitDate())
|
||||
&& isInTheRangeFilterDates(order.getDeadline())) {
|
||||
return (acceptStartDate(order.getInitDate()) && (acceptFinishDate(order
|
||||
.getDeadline())));
|
||||
}
|
||||
|
||||
private boolean acceptStartDate(Date initDate) {
|
||||
if ((initDate == null) && (startDate == null)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return isInTheRangeFilterDates(initDate);
|
||||
}
|
||||
|
||||
private boolean acceptFinishDate(Date deadLine) {
|
||||
if ((deadLine == null) && (finishDate == null)) {
|
||||
return true;
|
||||
}
|
||||
return isInTheRangeFilterDates(deadLine);
|
||||
}
|
||||
|
||||
private boolean isInTheRangeFilterDates(Date date) {
|
||||
|
|
@ -198,13 +209,6 @@ public class OrderPredicate implements IPredicate {
|
|||
date, finishDate));
|
||||
}
|
||||
|
||||
private boolean isInTheRangeWorkReportDates(Date date,
|
||||
Order order) {
|
||||
// Check if date is into interval between the startdate and finish date
|
||||
return (isGreaterToStartDate(date, order.getInitDate()) && isLowerToFinishDate(
|
||||
date, order.getDeadline()));
|
||||
}
|
||||
|
||||
private boolean isGreaterToStartDate(Date date, Date startDate) {
|
||||
if (startDate == null) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue