From 4eef4669a52d74e465519503cf444156259632a9 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:20:11 +0200 Subject: [PATCH] Only show unbilled time in the customer form Done so that it is the same as in the task form. Also the list of all time entries for a customer can be very long, thus creating a long load time of the customer form. --- stoptime.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stoptime.rb b/stoptime.rb index 0e680d1..103bbb4 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -1025,7 +1025,8 @@ module StopTime::Controllers end end - @time_entries = @customer.time_entries.order("start DESC") + @time_entries = @customer.time_entries.order("start DESC")\ + .reject { |te| te.task.billed? } @invoices = @customer.invoices @invoices.each do |i| @input["paid_#{i.number}"] = true if i.paid?