Order the tasks in the customer_form view by name and invoice ID
This commit is contained in:
parent
3e6ecead87
commit
f85ca3f34f
|
@ -636,6 +636,7 @@ module StopTime::Controllers
|
||||||
def get
|
def get
|
||||||
@customer = Customer.new(:hourly_rate => @config['hourly_rate'])
|
@customer = Customer.new(:hourly_rate => @config['hourly_rate'])
|
||||||
@input = @customer.attributes
|
@input = @customer.attributes
|
||||||
|
@tasks = []
|
||||||
|
|
||||||
@target = [Customers]
|
@target = [Customers]
|
||||||
@button = "create"
|
@button = "create"
|
||||||
|
@ -655,6 +656,7 @@ module StopTime::Controllers
|
||||||
def get(customer_id)
|
def get(customer_id)
|
||||||
@customer = Customer.find(customer_id)
|
@customer = Customer.find(customer_id)
|
||||||
@input = @customer.attributes
|
@input = @customer.attributes
|
||||||
|
@tasks = @customer.tasks.all(:order => "name, invoice_id ASC")
|
||||||
@invoices = @customer.invoices
|
@invoices = @customer.invoices
|
||||||
@invoices.each do |i|
|
@invoices.each do |i|
|
||||||
@input["paid_#{i.number}"] = true if i.paid?
|
@input["paid_#{i.number}"] = true if i.paid?
|
||||||
|
@ -1521,7 +1523,7 @@ module StopTime::Views
|
||||||
form :action => R(CustomersNTasks, @customer.id), :method => :post do
|
form :action => R(CustomersNTasks, @customer.id), :method => :post do
|
||||||
h2 "Projects & Tasks"
|
h2 "Projects & Tasks"
|
||||||
select :name => "task_id", :size => 10 do
|
select :name => "task_id", :size => 10 do
|
||||||
@customer.tasks.each do |task|
|
@tasks.each do |task|
|
||||||
if task.billed?
|
if task.billed?
|
||||||
option(:value => task.id,
|
option(:value => task.id,
|
||||||
:disabled => true) { task.name + " (#{task.invoice.number})" }
|
:disabled => true) { task.name + " (#{task.invoice.number})" }
|
||||||
|
|
Loading…
Reference in New Issue