<% 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)) %> <%= sort_header_tag("fixed_date", :caption => l(:caption_fixed_date)) %> <% total_budget = 0; labor_budget = 0; material_budget = 0; spent = 0 %> <% deliverables.each do |deliverable| %> <%= content_tag(:td, l(deliverable.status), :class => 'status') %> <%= content_tag(:td, link_to(h(deliverable.subject), :controller => 'deliverables', :action => 'show', :id => deliverable), :class => 'subject') %> <%= content_tag(:td, format_date(deliverable.fixed_date), :class => 'fixed_date') %> <%= content_tag(:td, number_to_currency(deliverable.spent, :precision => 0), :class => 'currency') %> <%= content_tag(:td, number_to_currency(deliverable.budget || 0.0, :precision => 0), :class => 'currency') %> <%= content_tag(:td, number_to_currency(deliverable.labor_budget || 0.0, :precision => 0), :class => 'currency') %> <%= content_tag(:td, number_to_currency(deliverable.material_budget || 0.0, :precision => 0), :class => 'currency') %> <%= content_tag(:td, extended_progress_bar(deliverable.budget_ratio, :width => '100%')) %> <%- total_budget += deliverable.budget labor_budget += deliverable.labor_budget material_budget += deliverable.material_budget spent += deliverable.spent -%> <% end %> <% if deliverables.length > 0 %> <% end %>
<%= link_to image_tag('toggle_check.png'), {}, :onclick => 'toggleIssuesSelection(Element.up(this, "form")); return false;', :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %> <%= l(:caption_spent) %> <%= l(:caption_budget) %> <%= l(:caption_labor_budget) %> <%= l(:caption_material_budget) %> <%= l(:caption_budget_ratio) %>
<%= check_box_tag("ids[]", deliverable.id, false, :id => nil) %> <%= link_to deliverable.id, :controller => 'deliverables', :action => 'show', :id => deliverable %>
<%= number_to_currency( spent || 0.0, :precision => 0) %> <%= number_to_currency( total_budget || 0.0, :precision => 0) %> <%= number_to_currency( labor_budget || 0.0, :precision => 0) %> <%= number_to_currency( material_budget || 0.0, :precision => 0) %>
<% end -%>