<%= form_tag({}) do -%> <%= sort_header_tag("id", :caption => '#', :default_order => 'desc') %> <%= sort_header_tag("status", :caption => l(:caption_status), :default_order => 'desc') %> <%= sort_header_tag("subject", :caption => l(:caption_subject)) %> <% total_budget = BigDecimal.new("0"); labor_budget = BigDecimal.new("0"); material_budget = BigDecimal.new("0"); spent = BigDecimal.new("0") %> <% cost_objects.each do |cost_object| %> <%= content_tag(:td, l(cost_object.status), :class => 'status') %> <%= content_tag(:td, link_to(h(cost_object.subject), :controller => 'cost_objects', :action => 'show', :id => cost_object), :class => 'subject') %> <%= content_tag(:td, number_to_currency(cost_object.budget, :precision => 0), :class => 'currency') %> <%= content_tag(:td, number_to_currency(cost_object.spent, :precision => 0), :class => 'currency') %> <%= content_tag(:td, number_to_currency(cost_object.budget - cost_object.spent, :precision => 0), :class => 'currency') %> <%= content_tag(:td, extended_progress_bar(cost_object.budget_ratio, :legend => "#{cost_object.budget_ratio}%")) %> <%- total_budget += cost_object.budget labor_budget += cost_object.labor_budget material_budget += cost_object.material_budget spent += cost_object.spent -%> <% end %> <% if cost_objects.length > 0 %> <% end %>
<%= link_to image_tag('check.png'), {}, :onclick => 'toggleIssuesSelection(Element.up(this, "form")); return false;', :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %> <%= l(:caption_budget) %> <%= l(:caption_spent) %> <%= l(:caption_budget_available) %> <%= l(:caption_budget_ratio) %>
<%= check_box_tag("ids[]", cost_object.id, false, :id => nil) %> <%= link_to cost_object.id, :controller => 'cost_objects', :action => 'show', :id => cost_object %>
<%= number_to_currency( total_budget, :precision => 0) %> <%= number_to_currency( spent, :precision => 0) %> <%= number_to_currency( total_budget - spent, :precision => 0) %>
<% end -%>