From 93559feecf5e1b5ccf3ba1b208577bcf659a7bcc Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 8 Sep 2015 14:12:14 +0200 Subject: [PATCH] Fixed calculation of average state. --- lib/stats/ticket_in_process.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stats/ticket_in_process.rb b/lib/stats/ticket_in_process.rb index 97ede41d7..9f3178cd7 100644 --- a/lib/stats/ticket_in_process.rb +++ b/lib/stats/ticket_in_process.rb @@ -65,7 +65,7 @@ class Stats::TicketInProcess return result end - in_percent = ( result[:used_for_average].to_f / (result[:total].to_f/100) ).round(1) + in_percent = ( result[:used_for_average].to_f / (result[:average_per_agent].to_f/100) ).round(1) if in_percent >= 90 result[:state] = 'supergood' elsif in_percent >= 65