Minor refactoring in stats partial.
This commit is contained in:
parent
4b6499d529
commit
f1b71a5588
2 changed files with 7 additions and 1 deletions
|
|
@ -62,6 +62,12 @@ class Ordergroup < Group
|
|||
stats[:orders_sum] != 0 ? stats[:jobs_size].to_f / stats[:orders_sum].to_f : 0
|
||||
end
|
||||
|
||||
# This is the ordergroup job per euro performance
|
||||
# in comparison to the hole foodcoop average
|
||||
def apples
|
||||
((avg_jobs_per_euro / Ordergroup.avg_jobs_per_euro) * 100).to_i rescue 0
|
||||
end
|
||||
|
||||
# Global average
|
||||
def self.avg_jobs_per_euro
|
||||
stats = Ordergroup.all.collect(&:stats)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue