Adds margins additional to task limits(start, end) for default load ratios calculation in resource allocation advance search.

Two margins have been added:

   * A margin before the task start date.
   * A margin after the task end date.

The time used in these two margins has been the same and is equal to 30 days.

FEA: ItEr77S10ResourceAllocationLoadInformation
This commit is contained in:
Javier Moran Rua 2012-10-13 17:36:41 +02:00 committed by Manuel Rego Casasnovas
parent d7ed3aa149
commit 3944232a98
2 changed files with 15 additions and 4 deletions

View file

@ -45,6 +45,8 @@ import org.zkoss.zul.Radiogroup;
@SuppressWarnings("serial")
public class NewAllocationSelector extends AllocationSelector {
public static final int DAYS_LEAD_LAG_TO_TASK_LIMITS_DATES_FILTERING_INITIALIZATION = 30;
private NewAllocationSelectorController selectorController;
private ResourceAllocationBehaviour behaviour;

View file

@ -31,6 +31,7 @@ import java.util.List;
import org.apache.commons.lang.Validate;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.joda.time.LocalDate;
import org.libreplan.business.orders.entities.AggregatedHoursGroup;
import org.libreplan.business.planner.entities.CalculatedValue;
import org.libreplan.business.planner.entities.DerivedAllocation;
@ -322,10 +323,18 @@ public class ResourceAllocationController extends GenericForwardComposer {
}
public void goToAdvancedSearch() {
newAllocationSelector.setStartFilteringDate(resourceAllocationModel
.getTaskStart());
newAllocationSelector.setEndFilteringDate(resourceAllocationModel
.getTaskEnd());
newAllocationSelector
.setStartFilteringDate(LocalDate
.fromDateFields(resourceAllocationModel.getTaskStart())
.minusDays(
NewAllocationSelector.DAYS_LEAD_LAG_TO_TASK_LIMITS_DATES_FILTERING_INITIALIZATION)
.toDateTimeAtStartOfDay().toDate());
newAllocationSelector
.setEndFilteringDate(LocalDate
.fromDateFields(resourceAllocationModel.getTaskEnd())
.plusDays(
NewAllocationSelector.DAYS_LEAD_LAG_TO_TASK_LIMITS_DATES_FILTERING_INITIALIZATION)
.toDateTimeAtStartOfDay().toDate());
applyButton.setVisible(false);
workerSearchTab.setSelected(true);
// The initial search and ratio load calculations is raised