lib/taskjuggler/TimeSheets.rb in taskjuggler-3.0.0 vs lib/taskjuggler/TimeSheets.rb in taskjuggler-3.1.0

- old
+ new

@@ -1,11 +1,11 @@ #!/usr/bin/env ruby -w # encoding: UTF-8 # # = TimeSheets.rb -- The TaskJuggler III Project Management Software # -# Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 +# Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012 # by Chris Schlaeger <chris@linux.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. @@ -290,12 +290,12 @@ 'No trackingscenario has been defined.') end if @resource['efficiency', scenarioIdx] > 0.0 targetSlots = totalNetWorkingSlots - # This is acceptable rounding error when checking the total reported - # work. + # This is the acceptable rounding error when checking the total + # reported work. delta = 1 if totalSlots < (targetSlots - delta) error('ts_work_too_low', "The total work to be reported for this time sheet " + "is #{workWithUnit(targetSlots)} but only " + @@ -327,15 +327,13 @@ # Compute the total number of potential working time slots during the # report period. This value is not resource specific. def totalGrossWorkingSlots project = @resource.project - # Calculate the average working days per week (usually 5) - weeklyWorkingDays = project['yearlyworkingdays'] / 52.1428 # Calculate the number of weeks in the report weeksToReport = (@interval.end - @interval.start) / (60 * 60 * 24 * 7) - daysToSlots(weeklyWorkingDays * weeksToReport) + daysToSlots(project.weeklyWorkingDays * weeksToReport) end # Compute the total number of actual working time slots of the # Resource. This is the sum of allocated, free time slots. def totalNetWorkingSlots