Merge branch 'feature/50f182-new-invoice-buttons-in-invoices-tab' into development (closes: #50f182)

This commit is contained in:
Paul van Tilburg 2014-10-25 18:04:28 +02:00
commit 88660d9e56
1 changed files with 11 additions and 5 deletions

View File

@ -1377,7 +1377,7 @@ module StopTime::Controllers
Customer.all.each do |customer|
invoices = customer.invoices
next if invoices.empty?
@invoices[customer.name] = invoices
@invoices[customer] = invoices
invoices.each do |i|
@input["paid_#{i.number}"] = true if i.paid?
end
@ -2020,10 +2020,16 @@ module StopTime::Views
else
div.row do
div.span7 do
@invoices.keys.sort.each do |key|
next if @invoices[key].empty?
h3 { key }
_invoice_list(@invoices[key])
@invoices.keys.sort.each do |customer|
next if @invoices[customer].empty?
h2 do
text! customer.name
div.btn_group.pull_right do
a.btn.btn_small "» Create a new invoice",
:href => R(CustomersNInvoicesNew, customer.id)
end
end
_invoice_list(@invoices[customer])
end
end
end