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 b49ccb296..9dd625c1d 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 @@ -23,8 +23,10 @@ package org.libreplan.business.orders.entities; import java.util.Date; +import org.apache.commons.lang.BooleanUtils; import org.libreplan.business.common.BaseEntity; import org.libreplan.business.workingday.EffortDuration; +import org.libreplan.business.workreports.entities.WorkReportLine; /** * It represents the efforts charged to an {@link OrderElement}, avoiding the @@ -45,6 +47,13 @@ public class SumChargedEffort extends BaseEntity { private Date lastTimesheetDate; + /** + * Finished according to timesheets. If true it means that + * there's a {@link WorkReportLine} marking as finished this + * {@link OrderElement}. + */ + private Boolean finishedTimesheets = false; + protected SumChargedEffort() {} private SumChargedEffort(OrderElement orderElement) { @@ -125,4 +134,12 @@ public class SumChargedEffort extends BaseEntity { setLastTimesheetDate(lastTimesheetDate); } + public Boolean isFinishedTimesheets() { + return finishedTimesheets; + } + + public void setFinishedTimesheets(Boolean finishedTimesheets) { + this.finishedTimesheets = BooleanUtils.isTrue(finishedTimesheets); + } + } 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 5c638d5e6..ca9640cf5 100644 --- a/libreplan-business/src/main/resources/db.changelog-1.3.xml +++ b/libreplan-business/src/main/resources/db.changelog-1.3.xml @@ -119,4 +119,23 @@ columnDataType="BOOLEAN" /> + + + + Add new column finished_timesheets with default value FALSE 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 fc378c102..75854b42e 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 @@ -276,6 +276,8 @@ column="first_timesheet_date" /> +