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:
parent
de58a979c8
commit
47fca9df2a
|
@ -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] = []
|
||||
|
|
Loading…
Reference in New Issue