From 70c0ad4a543e0ba36a68ed124d7fcf04a4957cff Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Fri, 7 Feb 2014 20:30:38 +0100 Subject: [PATCH] Fix fixed cost tasks being grouped under random projects in customer view --- stoptime.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stoptime.rb b/stoptime.rb index 0c34401..64ec42c 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -817,9 +817,11 @@ module StopTime::Controllers cur_active_task = nil @tasks.each do |task| if task.billed? - if cur_active_task.nil? - # Apparently there is no active task anymore, probably - # it was a fixed-cost task + if cur_active_task.nil? or + task.name != cur_active_task.name + # Apparently, this is billed but it does not belong to the + # current active task, so probably it was a fixed-cost task + cur_active_task = task @billed_tasks[task] = [task] else @billed_tasks[cur_active_task] << task