diff --git a/libreplan-business/src/main/java/org/libreplan/business/reports/dtos/CostWorkReportLineDTO.java b/libreplan-business/src/main/java/org/libreplan/business/reports/dtos/CostWorkReportLineDTO.java deleted file mode 100644 index 033d9ec5a..000000000 --- a/libreplan-business/src/main/java/org/libreplan/business/reports/dtos/CostWorkReportLineDTO.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * This file is part of LibrePlan - * - * Copyright (C) 2012 WirelessGalcia S.L. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package org.libreplan.business.reports.dtos; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.Set; - -import org.joda.time.LocalTime; -import org.libreplan.business.labels.entities.Label; -import org.libreplan.business.orders.entities.OrderElement; -import org.libreplan.business.resources.entities.Worker; -import org.libreplan.business.workreports.entities.WorkReportLine; -import org.libreplan.business.workreports.valueobjects.DescriptionValue; - -/** - * Note: this class has a natural ordering that is inconsistent with equals. - */ - -/** - * @author Susana Montes Pedreira - */ -public class CostWorkReportLineDTO implements Comparable { - - private OrderElement orderElement; - - private String workerName; - - private Date date; - - private LocalTime clockStart; - - private LocalTime clockFinish; - - private BigDecimal numHours; - - private String descriptionValues; - - private String labels; - - private String hoursType; - - private String hoursTypeCode; - - // Attached outside the DTO - private BigDecimal cost; - - // Attached outside the DTO - private BigDecimal costPerHour; - - private Worker worker; - - private Boolean costTypeHours = Boolean.TRUE; - - public CostWorkReportLineDTO(Worker worker, WorkReportLine workReportLine) { - - this.workerName = worker.getName(); - if (workReportLine.getLocalDate() != null) { - this.date = workReportLine.getLocalDate().toDateTimeAtStartOfDay().toDate(); - } - this.clockStart = workReportLine.getClockStart(); - this.clockFinish = workReportLine.getClockFinish(); - this.numHours = workReportLine.getEffort().toHoursAsDecimalWithScale(2); - this.descriptionValues = descriptionValuesAsString(workReportLine.getDescriptionValues()); - this.labels = labelsAsString(workReportLine.getLabels()); - this.hoursType = workReportLine.getTypeOfWorkHours().getName(); - this.hoursTypeCode = workReportLine.getTypeOfWorkHours().getCode(); - this.worker = worker; - } - - public CostWorkReportLineDTO(OrderCostsPerResourceDTO dto) { - this.workerName = dto.getWorkerName(); - this.date = dto.getDate(); - this.clockStart = dto.getClockStart(); - this.clockFinish = dto.getClockFinish(); - this.numHours = dto.getNumHours(); - this.descriptionValues = dto.getDescriptionValues(); - this.labels = dto.getLabels(); - this.hoursType = dto.getHoursType(); - this.hoursTypeCode = dto.getHoursTypeCode(); - this.worker = dto.getWorker(); - } - - private String labelsAsString(Set