Ported more items to the new Rate API. #1924

This commit is contained in:
Eric Davis committed 2009-01-21 14:46:58 -08:00
1 parent 045f50e0dd
commit 7fa4f33748
2 files changed
+11 -10

No files matched your search

+4 -5
View File
@@ -114,8 +114,8 @@ class Budget
# Find each Member for their rate
time_logs.each do |time_log|
member = Member.find_by_user_id_and_project_id(time_log.user_id, time_log.project_id)
total += (member.rate * time_log.hours) unless member.nil? || member.rate.nil?
rate = Rate.amount_for(time_log.user, time_log.project, time_log.spent_on.to_s)
total += (rate * time_log.hours) unless rate.nil?
end
return total
@@ -135,10 +135,9 @@ class Budget
time_logs = missing_issues.collect(&:time_entries).flatten
# Find each Member for their rate
time_logs.each do |time_log|
member = Member.find_by_user_id_and_project_id(time_log.user_id, time_log.project_id)
total += (member.rate * time_log.hours) unless member.nil? || member.rate.nil?
rate = Rate.amount_for(time_log.user, time_log.project, time_log.spent_on.to_s)
total += (rate * time_log.hours) unless rate.nil?
end
return total