Author: meynier Date: 2013-07-23 16:52:56 +0200 (Tue, 23 Jul 2013) New Revision: 374 Url: http://chorem.org/projects/chorem/repository/revisions/374 Log: Corrected bug on quotation calculation Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java trunk/chorem-entities/src/main/java/org/chorem/project/QuotationCalculation.java Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java 2013-07-23 14:51:55 UTC (rev 373) +++ trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java 2013-07-23 14:52:56 UTC (rev 374) @@ -25,6 +25,8 @@ import org.chorem.entities.Attachment; import org.chorem.entities.ChoremUser; import org.chorem.entities.Company; +import org.chorem.entities.CompanyHR; +import org.chorem.entities.CompanyHRImpl; import org.chorem.entities.CompanyImpl; import org.chorem.entities.Configuration; import org.chorem.entities.ConfigurationImpl; @@ -392,9 +394,6 @@ * @return */ public double getDailyReturn(Employee e) { - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - //Code commented before confirmation or modification of the contract implementation - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Wikitty w = this.restore(e.getWikittyId()); Wikitty companyW = null; @@ -402,7 +401,7 @@ companyW = restore(e.getCompany(false).getWikittyId()); if(w.hasExtension("EmployeeHR") && w.getFieldAsDouble("EmployeeHR", "dailyReturn") != 0) { - return w.getFieldAsDouble("Contract", "dailyReturn"); + return w.getFieldAsDouble("EmployeeHR", "dailyReturn"); } else if(companyW != null && companyW.hasExtension("CompanyHR") && companyW.getFieldAsDouble("CompanyHR", "dailyReturn") != 0) { @@ -418,9 +417,7 @@ * @return */ public double getDailyHoursWorked(Employee e) { - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - //Code commented before confirmation or modification of the contract implementation - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + Wikitty w = this.restore(e.getWikittyId()); Wikitty companyW = null; if(e.getCompany(false) != null) @@ -440,4 +437,6 @@ return this.getConfiguration().getDailyHoursWorked(); } } + + } Modified: trunk/chorem-entities/src/main/java/org/chorem/project/QuotationCalculation.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/project/QuotationCalculation.java 2013-07-23 14:51:55 UTC (rev 373) +++ trunk/chorem-entities/src/main/java/org/chorem/project/QuotationCalculation.java 2013-07-23 14:52:56 UTC (rev 374) @@ -34,7 +34,7 @@ public HashMap<Employee, Double> getPercentages() { HashMap<Employee, Double> percentages = new HashMap<Employee, Double>(); double totalDays = 0; - for(Task t : tasks) + for(Task t : getTasks()) totalDays += t.getEstimatedDays(); List<Task> tasks = getTasks();