mbasset / project_overview

Adds a new project overview page to redmine 2+.
MIT License
13 stars 9 forks source link

project_overview_spent_time calculate the wrong value #20

Closed amizhang closed 9 years ago

amizhang commented 9 years ago

on the project overview, the spent time shows total spent time for all projects, but not on each project.

So i change the code like: def project_overview_spent_time(project) TimeEntry.visible.sum(:hours, :include => project, :conditions => project.project_condition(true)) end

Now it's working. Pls help to correct me if there is any better solution!

Thank you!

amizhang commented 9 years ago

oh, how about this:

cond = project.project_condition(true)
TimeEntry.visible.where(cond).sum(:hours)
mbasset commented 9 years ago

Could you create a PR for this?

amizhang commented 9 years ago

Sure thing. Thank you!