Bug #1559: Remove WorkReportLines with zero effort in personal timesheets
FEA: ItEr77S04BugFixing
This commit is contained in:
parent
38cbd25d06
commit
c9a638e4f3
1 changed files with 19 additions and 1 deletions
|
|
@ -431,9 +431,14 @@ public class PersonalTimesheetModel implements IPersonalTimesheetModel {
|
|||
// saved as it will not be possible to find it later with
|
||||
// WorkReportDAO.getPersonalTimesheetWorkReport() method.
|
||||
} else {
|
||||
Set<WorkReportLine> deletedWorkReportLinesSet = removeWorkReportLinesWithEffortZero();
|
||||
|
||||
Set<OrderElement> orderElements = sumChargedEffortDAO
|
||||
.getOrderElementsToRecalculateTimsheetDates(
|
||||
workReport.getWorkReportLines(), null);
|
||||
workReport.getWorkReportLines(),
|
||||
deletedWorkReportLinesSet);
|
||||
sumChargedEffortDAO
|
||||
.updateRelatedSumChargedEffortWithDeletedWorkReportLineSet(deletedWorkReportLinesSet);
|
||||
sumChargedEffortDAO
|
||||
.updateRelatedSumChargedEffortWithWorkReportLineSet(workReport
|
||||
.getWorkReportLines());
|
||||
|
|
@ -446,6 +451,19 @@ public class PersonalTimesheetModel implements IPersonalTimesheetModel {
|
|||
resetModifiedFields();
|
||||
}
|
||||
|
||||
private Set<WorkReportLine> removeWorkReportLinesWithEffortZero() {
|
||||
Set<WorkReportLine> toRemove = new HashSet<WorkReportLine>();
|
||||
for (WorkReportLine line : workReport.getWorkReportLines()) {
|
||||
if (line.getEffort().isZero()) {
|
||||
toRemove.add(line);
|
||||
}
|
||||
}
|
||||
for (WorkReportLine line : toRemove) {
|
||||
workReport.removeWorkReportLine(line);
|
||||
}
|
||||
return toRemove;
|
||||
}
|
||||
|
||||
private void resetModifiedFields() {
|
||||
modified = false;
|
||||
modifiedMap = new HashMap<OrderElement, Set<LocalDate>>();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue