From a8eefaaa29bf236347892b56cc423423b8358a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenzo=20Tilve=20=C3=81lvaro?= Date: Fri, 26 Jul 2013 17:50:38 +0200 Subject: [PATCH] Modified automatic budget cell calculations and rearranged report The manually introduced budget cell will be representing the total amount for the budget on that item, and the expenses cell will show the difference between that total and the resources costs for the task hours and required criteria. FEA: ItEr77S17AutomaticBudgeting --- .../reports/dtos/ProjectStatusReportDTO.java | 20 +- .../projectStatusReportWithHoursBudget.jrxml | 221 ++++++++++-------- .../projectStatus.properties | 2 + .../projectStatus_es.properties | 4 +- .../ProjectStatusReportController.java | 5 + .../web/reports/ProjectStatusReportModel.java | 19 +- 6 files changed, 166 insertions(+), 105 deletions(-) diff --git a/libreplan-business/src/main/java/org/libreplan/business/reports/dtos/ProjectStatusReportDTO.java b/libreplan-business/src/main/java/org/libreplan/business/reports/dtos/ProjectStatusReportDTO.java index adef556ed..98eb08917 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/reports/dtos/ProjectStatusReportDTO.java +++ b/libreplan-business/src/main/java/org/libreplan/business/reports/dtos/ProjectStatusReportDTO.java @@ -50,10 +50,10 @@ public class ProjectStatusReportDTO { private BigDecimal budget; - private BigDecimal expensesBudget; - private BigDecimal resourcesBudget; + private BigDecimal expensesBudget; + private BigDecimal hoursCost; private BigDecimal expensesCost; @@ -64,11 +64,14 @@ public class ProjectStatusReportDTO { public ProjectStatusReportDTO(EffortDuration estimatedHours, EffortDuration plannedHours, EffortDuration imputedHours, + BigDecimal resourcesBudget, BigDecimal expensesBudget, BigDecimal budget, BigDecimal hoursCost, BigDecimal expensesCost, BigDecimal totalCost) { this.estimatedHours = estimatedHours; this.plannedHours = plannedHours; this.imputedHours = imputedHours; + this.resourcesBudget = resourcesBudget; + this.expensesBudget = expensesBudget; this.budget = budget; this.hoursCost = hoursCost; this.expensesCost = expensesCost; @@ -77,9 +80,11 @@ public class ProjectStatusReportDTO { public ProjectStatusReportDTO(String code, String name, EffortDuration estimatedHours, EffortDuration plannedHours, - EffortDuration imputedHours, BigDecimal budget, + EffortDuration imputedHours, BigDecimal resourcesBudget, + BigDecimal expensesBudget, BigDecimal budget, BigDecimal hoursCost, BigDecimal expensesCost, BigDecimal totalCost) { - this(estimatedHours, plannedHours, imputedHours, budget, hoursCost, + this(estimatedHours, plannedHours, imputedHours, resourcesBudget, + expensesBudget, budget, hoursCost, expensesCost, totalCost); this.code = code; this.name = name; @@ -291,8 +296,9 @@ public class ProjectStatusReportDTO { */ private void calculateCostMark() { if (totalCost != null) { - if (budget != null && (budget.compareTo(BigDecimal.ZERO) > 0)) { - if (totalCost.compareTo(budget) > 0) { + if (expensesBudget != null + && (expensesBudget.compareTo(BigDecimal.ZERO) > 0)) { + if (totalCost.compareTo(expensesBudget) > 0) { costMark = EXCLAMATION_MARK; } } @@ -307,4 +313,4 @@ public class ProjectStatusReportDTO { return costMark; } -} \ No newline at end of file +} diff --git a/libreplan-webapp/src/main/jasper/projectStatusReportWithHoursBudget.jrxml b/libreplan-webapp/src/main/jasper/projectStatusReportWithHoursBudget.jrxml index 882a6572f..9064ae994 100644 --- a/libreplan-webapp/src/main/jasper/projectStatusReportWithHoursBudget.jrxml +++ b/libreplan-webapp/src/main/jasper/projectStatusReportWithHoursBudget.jrxml @@ -1,7 +1,7 @@ - +