From ba2ce0371dab26eb22a3bb06dbb1dfecf7e2be0e Mon Sep 17 00:00:00 2001 From: Manuel Rego Casasnovas Date: Mon, 29 Oct 2012 17:44:23 +0100 Subject: [PATCH] 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 --- .../orders/entities/SumChargedEffort.java | 24 +++++++++++++++++++ .../src/main/resources/db.changelog-1.3.xml | 14 +++++++++++ .../business/orders/entities/Orders.hbm.xml | 6 +++++ 3 files changed, 44 insertions(+) diff --git a/libreplan-business/src/main/java/org/libreplan/business/orders/entities/SumChargedEffort.java b/libreplan-business/src/main/java/org/libreplan/business/orders/entities/SumChargedEffort.java index 46a8839e9..fdd513247 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/orders/entities/SumChargedEffort.java +++ b/libreplan-business/src/main/java/org/libreplan/business/orders/entities/SumChargedEffort.java @@ -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; } } diff --git a/libreplan-business/src/main/resources/db.changelog-1.3.xml b/libreplan-business/src/main/resources/db.changelog-1.3.xml index b4ce27ed8..3bd067ddd 100644 --- a/libreplan-business/src/main/resources/db.changelog-1.3.xml +++ b/libreplan-business/src/main/resources/db.changelog-1.3.xml @@ -73,4 +73,18 @@ + + + Add columns first_timesheet_date and last_timesheet_date to + sum_charged_effort table + + + + + + + + + diff --git a/libreplan-business/src/main/resources/org/libreplan/business/orders/entities/Orders.hbm.xml b/libreplan-business/src/main/resources/org/libreplan/business/orders/entities/Orders.hbm.xml index c32dada6c..fc378c102 100644 --- a/libreplan-business/src/main/resources/org/libreplan/business/orders/entities/Orders.hbm.xml +++ b/libreplan-business/src/main/resources/org/libreplan/business/orders/entities/Orders.hbm.xml @@ -271,6 +271,12 @@ + + + +