Handle billed fixed-cost tasks correctly in the customer_form view

Billed fixed-cost tasks will have no active task once they are billed,
because invoicing a fixed-cost will not split off a task but manipulate the
active one into being billed.
This commit is contained in:
Paul van Tilburg 2013-07-14 14:32:02 +02:00
parent de58a979c8
commit 47fca9df2a
1 changed files with 7 additions and 1 deletions

View File

@ -817,7 +817,13 @@ module StopTime::Controllers
cur_active_task = nil
@tasks.each do |task|
if task.billed?
@billed_tasks[cur_active_task] << task
if cur_active_task.nil?
# Apparently there is no active task anymore, probably
# it was a fixed-cost task
@billed_tasks[task] = []
else
@billed_tasks[cur_active_task] << task
end
else
cur_active_task = task
@billed_tasks[task] = []