Files
redmine_contracts/app/views/deliverables/_finances.html.erb

62 lines
2.2 KiB
Plaintext

<div id="summary" class="contextual">
<%= l(:text_deliverable_spending_summary,
:spent => content_tag(:span, h(number_to_currency(deliverable.labor_budget_spent, :precision => 0)), :class => 'spent'),
:total => content_tag(:span, h(number_to_currency(deliverable.labor_budget_total, :precision => 0)), :class => 'total'),
:hours => content_tag(:span, h(deliverable.labor_hours_spent_total), :class => 'hours')) %>
</div>
<h2><%= h(deliverable.title) %></h2>
<h3>Activities</h3>
<table id="deliverable-labor-activities">
<thead>
<th><%= l(:field_labor) %></th>
<th colspan="2"><%= l(:field_cost) %></th>
<th colspan="2"><%= l(:field_hours) %></th>
</thead>
<tbody>
<%# Each labor activity + non-budgeted activities %>
<% deliverable.billable_time_entry_activities.each do |activity| %>
<% content_tag_for(:tr, activity, :class => 'labor ' + cycle('even','')) do %>
<td class="labor">
<%= h(activity.name) %>
</td>
<td class="spent-amount labor">
<%= number_to_currency(deliverable.spent_for_activity(activity), :precision => 0) %>
</td>
<td class="total-amount labor">
<%= number_to_currency(deliverable.budget_for_activity(activity), :precision => 0) %>
</td>
<td class="spent-hours labor">
<%= number_with_precision(deliverable.hours_spent_for_activity(activity), :precision => 0) %>
</td>
<td class="total-hours labor">
<%= number_with_precision(deliverable.hours_budget_for_activity(activity), :precision => 0) %>
</td>
<% end %>
<% end %>
<tr class="total labor">
<td class="labor">
Totals
</td>
<td class="spent-amount labor">
<%= number_to_currency(deliverable.labor_budget_spent, :precision => 0) %>
</td>
<td class="total-amount labor">
<%= number_to_currency(deliverable.labor_budget_total, :precision => 0) %>
</td>
<td class="spent-hours labor">
<%= number_with_precision(deliverable.labor_hours_spent_total, :precision => 0) %>
</td>
<td class="total-hours labor">
<%= number_with_precision(deliverable.labor_budget_hours, :precision => 0) %>
</td>
</tr>
</tbody>
</table>