diff --git a/app/models/ordergroup.rb b/app/models/ordergroup.rb index 7eef09ad..aee429f7 100644 --- a/app/models/ordergroup.rb +++ b/app/models/ordergroup.rb @@ -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) diff --git a/app/views/home/_stats.erb b/app/views/home/_stats.erb index ed8279d2..a8f63de2 100644 --- a/app/views/home/_stats.erb +++ b/app/views/home/_stats.erb @@ -14,7 +14,7 @@ unless global_avg == 0 or global_avg.nan? %> Engagement Deiner Bestellgruppe
Durchschnittsengagement