Add new columns in SumChargedEffort for first and last timesheet date

The first and last date of the task depending on the timesheets will be stored
in these two new fields in SumChargedEffort.

FEA: ItEr77S12AdaptPlanningAccordingTimesheets
This commit is contained in:
Manuel Rego Casasnovas 2012-10-29 17:44:23 +01:00
parent 47600797d8
commit ba2ce0371d
3 changed files with 44 additions and 0 deletions

View file

@ -21,6 +21,8 @@
package org.libreplan.business.orders.entities;
import java.util.Date;
import org.libreplan.business.common.BaseEntity;
import org.libreplan.business.workingday.EffortDuration;
@ -39,6 +41,10 @@ public class SumChargedEffort extends BaseEntity {
private EffortDuration indirectChargedEffort = EffortDuration.zero();
private Date firstTimesheetDate;
private Date lastTimesheetDate;
protected SumChargedEffort() {}
private SumChargedEffort(OrderElement orderElement) {
@ -93,6 +99,24 @@ public class SumChargedEffort extends BaseEntity {
public void reset() {
directChargedEffort = EffortDuration.zero();
indirectChargedEffort = EffortDuration.zero();
firstTimesheetDate = null;
lastTimesheetDate = null;
}
public Date getFirstTimesheetDate() {
return firstTimesheetDate;
}
public void setFirstTimesheetDate(Date firstTimesheetDate) {
this.firstTimesheetDate = firstTimesheetDate;
}
public Date getLastTimesheetDate() {
return lastTimesheetDate;
}
public void setLastTimesheetDate(Date lastTimesheetDate) {
this.lastTimesheetDate = lastTimesheetDate;
}
}

View file

@ -73,4 +73,18 @@
</update>
</changeSet>
<changeSet id="add-columns-first-and-last-timesheet_date-to-sum_charged_effort"
author="mrego">
<comment>
Add columns first_timesheet_date and last_timesheet_date to
sum_charged_effort table
</comment>
<addColumn tableName="sum_charged_effort">
<column name="first_timesheet_date" type="DATETIME" />
</addColumn>
<addColumn tableName="sum_charged_effort">
<column name="last_timesheet_date" type="DATETIME" />
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -271,6 +271,12 @@
<property name="indirectChargedEffort" access="field"
column="indirect_charged_effort"
type="org.libreplan.business.workingday.hibernate.EffortDurationType" />
<property name="firstTimesheetDate" access="field"
column="first_timesheet_date" />
<property name="lastTimesheetDate" access="field"
column="last_timesheet_date" />
</class>
<class name="SumExpenses" table="sum_expenses">