Also color customer names based on invoice status in the overview view

This commit is contained in:
Paul van Tilburg 2013-06-16 23:38:22 +02:00
parent d359b76209
commit ba5fd086b5

View file

@ -1455,7 +1455,12 @@ module StopTime::Views
else
div.span6 do
@tasks.keys.sort_by { |c| c.name }.each do |customer|
h3 { a customer.name, :href => R(CustomersN, customer.id) }
inv_klass = "text_info"
inv_klass = "text_warning" if customer.invoices.any? { |inv| inv.past_due? }
inv_klass = "text_error" if customer.invoices.any? { |inv| inv.way_past_due? }
h3 { a customer.name,
:class => inv_klass,
:href => R(CustomersN, customer.id) }
if @tasks[customer].empty?
p do
text! "No projects/tasks found! Create one " +