From 0686dcc824f24df018dbf6cc0f650811e9c3d862 Mon Sep 17 00:00:00 2001 From: Susana Montes Pedreira Date: Fri, 9 Jul 2010 14:33:52 +0200 Subject: [PATCH] ItEr60S04ValidacionEProbasFuncionaisItEr59S04 : [Bug #545] Fix bug. it shows the field name in the hour type column in the report. --- .../navalplanner/business/orders/daos/OrderDAO.java | 6 +++--- .../reports/dtos/OrderCostsPerResourceDTO.java | 13 ++++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/navalplanner-business/src/main/java/org/navalplanner/business/orders/daos/OrderDAO.java b/navalplanner-business/src/main/java/org/navalplanner/business/orders/daos/OrderDAO.java index 1d7e86ef6..e2297c0c5 100644 --- a/navalplanner-business/src/main/java/org/navalplanner/business/orders/daos/OrderDAO.java +++ b/navalplanner-business/src/main/java/org/navalplanner/business/orders/daos/OrderDAO.java @@ -140,16 +140,16 @@ public class OrderDAO extends IntegrationEntityDAO implements // Attach ordername value each.setOrderName(order.getName()); - // Attach calculated pricePerHour BigDecimal pricePerHour = CostCategoryDAO .getPriceByResourceDateAndHourType(each.getWorker(), new LocalDate(each.getDate()), each - .getHoursType()); + .getHoursTypeCode()); if (pricePerHour == null) { for (TypeOfWorkHours defaultprice : typeOfWorkHoursDAO .list(TypeOfWorkHours.class)) { - if (defaultprice.getCode().equals(each.getHoursType())) { + if (defaultprice.getCode().equals( + each.getHoursTypeCode())) { pricePerHour = defaultprice.getDefaultPrice(); } } diff --git a/navalplanner-business/src/main/java/org/navalplanner/business/reports/dtos/OrderCostsPerResourceDTO.java b/navalplanner-business/src/main/java/org/navalplanner/business/reports/dtos/OrderCostsPerResourceDTO.java index e6209d73f..08a297271 100644 --- a/navalplanner-business/src/main/java/org/navalplanner/business/reports/dtos/OrderCostsPerResourceDTO.java +++ b/navalplanner-business/src/main/java/org/navalplanner/business/reports/dtos/OrderCostsPerResourceDTO.java @@ -52,6 +52,8 @@ public class OrderCostsPerResourceDTO implements private String hoursType; + private String hoursTypeCode; + // Attached outside the DTO private BigDecimal cost; @@ -75,7 +77,8 @@ public class OrderCostsPerResourceDTO implements this.numHours = workReportLine.getNumHours(); this.descriptionValues = descriptionValuesAsString(workReportLine.getDescriptionValues()); this.labels = labelsAsString(workReportLine.getLabels()); - this.hoursType = workReportLine.getTypeOfWorkHours().getCode(); + this.hoursType = workReportLine.getTypeOfWorkHours().getName(); + this.hoursTypeCode = workReportLine.getTypeOfWorkHours().getCode(); this.orderElement = workReportLine.getOrderElement(); this.orderElementCode = workReportLine.getOrderElement().getCode(); this.worker = worker; @@ -215,4 +218,12 @@ public class OrderCostsPerResourceDTO implements + o.getOrderElementCode()); } + public void setHoursTypeCode(String hoursTypeCode) { + this.hoursTypeCode = hoursTypeCode; + } + + public String getHoursTypeCode() { + return hoursTypeCode; + } + } \ No newline at end of file