[#4182] Display the Labor and Overhead spent on the Contract page.

This commit is contained in:
Eric Davis
2010-07-07 13:46:00 -07:00
parent b9e68cd52c
commit 5cc66ddb09
3 changed files with 74 additions and 7 deletions
+3 -4
View File
@@ -6,10 +6,9 @@ module ContractsHelper
end
end
def format_budget_for_deliverable(deliverable, total)
# TODO LATER: calculate amount used
if total > 0
content_tag(:span, "0", :class => 'spent-amount') +
def format_budget_for_deliverable(deliverable, spent, total)
if total > 0 || spent > 0
content_tag(:span, h(number_to_currency(spent, :unit => '')), :class => 'spent-amount') +
" " +
content_tag(:span, h(number_to_currency(total, :unit => '')), :class => 'total-amount')
else
+2 -2
View File
@@ -43,10 +43,10 @@
<%# TODO: Status %>
<td class="manager"><%= h deliverable.manager.try(:name) %></td>
<td class="labor">
<%= format_budget_for_deliverable(deliverable, deliverable.labor_budget_total) %>
<%= format_budget_for_deliverable(deliverable, deliverable.labor_budget_spent, deliverable.labor_budget_total) %>
</td>
<td class="overhead">
<%= format_budget_for_deliverable(deliverable, deliverable.overhead_budget_total) %>
<%= format_budget_for_deliverable(deliverable, deliverable.overhead_spent, deliverable.overhead_budget_total) %>
</td>
<td class="fixed">---</td>
<td><%= link_to(l(:button_edit), edit_contract_deliverable_path(@project, resource, deliverable), :class => 'icon icon-edit') %></td>