Also show total of hours for fixed cost tasks
This commit is contained in:
parent
347da9e0e3
commit
f9a0ee323e
13
stoptime.rb
13
stoptime.rb
|
@ -174,7 +174,8 @@ module StopTime::Models
|
||||||
def summary
|
def summary
|
||||||
case type
|
case type
|
||||||
when "fixed_cost"
|
when "fixed_cost"
|
||||||
[nil, nil, fixed_cost]
|
total = time_entries.inject(0.0) { |summ, te| summ + te.hours_total }
|
||||||
|
[total, nil, fixed_cost]
|
||||||
when "hourly_rate"
|
when "hourly_rate"
|
||||||
time_entries.inject([0.0, hourly_rate, 0.0]) do |summ, te|
|
time_entries.inject([0.0, hourly_rate, 0.0]) do |summ, te|
|
||||||
summ[0] += te.hours_total
|
summ[0] += te.hours_total
|
||||||
|
@ -1193,14 +1194,8 @@ module StopTime::Views
|
||||||
:href => R(CustomersNTasksN, customer.id, task.id)
|
:href => R(CustomersNTasksN, customer.id, task.id)
|
||||||
end
|
end
|
||||||
summary = task.summary
|
summary = task.summary
|
||||||
case task.type
|
td.right { "%.2fh" % summary[0] }
|
||||||
when "fixed_rate"
|
td.right { "€ %.2f" % summary[2] }
|
||||||
td ""
|
|
||||||
td.right { "€ %.2f" % summary[2] }
|
|
||||||
when "hourly_rate"
|
|
||||||
td.right { "%.2fh" % summary[0] }
|
|
||||||
td.right { "€ %.2f" % summary[2] }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue