lib/taskjuggler/TimeSheets.rb in taskjuggler-0.0.11 vs lib/taskjuggler/TimeSheets.rb in taskjuggler-0.1.0
- old
+ new
@@ -282,10 +282,15 @@
@records.each do |record|
record.check
totalSlots += record.work
end
- if @resource['efficiency', @resource.project['trackingScenarioIdx']] > 0.0
+ unless (scenarioIdx = @resource.project['trackingScenarioIdx'])
+ error('ts_no_tracking_scenario',
+ '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.
delta = 1
if totalSlots < (targetSlots - delta)