ItEr49S10CUVisualizacionResponsabilidadesTRaballoNaPlanificacionItEr48S10: Pulling up isActive implementation to BaseCalendar
This commit is contained in:
parent
2fcc514e38
commit
7fff669be4
2 changed files with 9 additions and 17 deletions
|
|
@ -748,11 +748,16 @@ public class BaseCalendar extends BaseEntity implements IWorkHours {
|
|||
return isActive(new LocalDate(date));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is intended to be overridable
|
||||
*/
|
||||
public boolean isActive(LocalDate date) {
|
||||
return true;
|
||||
if (getCalendarAvailabilities().isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
for (CalendarAvailability calendarAvailability : getCalendarAvailabilities()) {
|
||||
if (calendarAvailability.isActive(date)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public CalendarAvailability getLastCalendarAvailability() {
|
||||
|
|
|
|||
|
|
@ -72,19 +72,6 @@ public class ResourceCalendar extends BaseCalendar {
|
|||
return multiplyByCapacity(super.getCapacityAt(date));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive(LocalDate date) {
|
||||
if (getCalendarAvailabilities().isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
for (CalendarAvailability calendarAvailability : getCalendarAvailabilities()) {
|
||||
if (calendarAvailability.isActive(date)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected int multiplyByCapacity(Integer workableHours) {
|
||||
if (workableHours == null) {
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue