ItEr41S09RFSoporteRecursosVirtuaisItEr40S12: Taking into account the capacity

This commit is contained in:
Óscar González Fernández 2009-12-28 13:51:47 +01:00
parent 8c8e531d5f
commit f7461e2e82

View file

@ -63,7 +63,14 @@ public class ResourceCalendar extends BaseCalendar {
if (!isActive(date)) {
return 0;
}
return super.getWorkableHours(date);
return multiplyByCapacity(super.getWorkableHours(date));
}
private Integer multiplyByCapacity(Integer workableHours) {
if (capacity == null) {
return workableHours;
}
return capacity * workableHours;
}
@AssertTrue(message = "Capacity must be a positive integer number")