[#4182] Display the Labor and Overhead spent on the Contract page.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user