From bf1d0c633d1b8c86fc01761aa97247c2a0444873 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Tue, 31 Jan 2012 22:51:31 +0100 Subject: [PATCH] Add the bill number to billed tasks in the time entry form (closes: #b1b255) --- stoptime.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stoptime.rb b/stoptime.rb index 8d4179f..83b87a2 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -1188,7 +1188,10 @@ module StopTime::Controllers @input["start"] = @time_entry.start.to_formatted_s(:time_only) @input["end"] = @time_entry.end.to_formatted_s(:time_only) @customer_list = Customer.all.map { |c| [c.id, c.shortest_name] } - @task_list = Task.all.map { |t| [t.id, t.name] } + @task_list = Task.all(:order => "name, invoice_id ASC").map do |t| + name = t.billed? ? t.name + " (#{t.invoice.number})" : t.name + [t.id, name] + end @target = [TimelineN, entry_id] @button = "update"