<% show_cost_budget_col = User.current.allowed_to?(:view_unit_price, @project) show_hour_budget_col = User.current.allowed_to?(:view_all_rates, @project) || User.current.allowed_to?(:view_own_rate, @project) -%>

<%= l(:caption_materials_budget)%>

<% unless @deliverable.deliverable_costs.empty? %> <% if show_cost_budget_col %> <%end%> <% @deliverable.deliverable_costs.each do |deliverable_cost| %> <% if show_cost_budget_col %> <% end %> <% end %> <% if show_cost_budget_col %> <% end %>
<%= l(:caption_cost_unit_plural)%> <%= l(:caption_cost_type) %><%= l(:caption_budget) %>
<%=h pluralize(deliverable_cost.units, deliverable_cost.cost_type.unit, deliverable_cost.cost_type.unit_plural) %> <%=h deliverable_cost.cost_type.name %><%= number_to_currency(deliverable_cost.costs) %>
<%= number_to_currency(@deliverable.materials_budget) %>
<% end %>

<%= l(:caption_labor_budget)%>

<% unless @deliverable.deliverable_hours.empty? %> <% if show_hour_budget_col %> <%end%> <% @deliverable.deliverable_hours.each do |deliverable_hour| %> <% if show_hour_budget_col %> <% end %> <% end %> <% if User.current.allowed_to?(:view_all_rates, @project) %> <% end %>
<%= l(:field_hours)%> <%= l(:label_user) %><%= l(:caption_budget) %>
<%= deliverable_hour.hours %>h <%=h deliverable_hour.user.name %><%= number_to_currency(deliverable_hour.costs) %>
<%= number_to_currency(@deliverable.labor_budget) %>
<% end %>