diff --git a/app/views/line_items/_issue_line_items.html.erb b/app/views/line_items/_issue_line_items.html.erb index f48d4ce..4dbf322 100644 --- a/app/views/line_items/_issue_line_items.html.erb +++ b/app/views/line_items/_issue_line_items.html.erb @@ -1,42 +1,50 @@ -<% if @issue.line_items.any? %> +<% if @issue.line_items.any? || @issue.descendant_line_items_total > 0%>

<%= t :label_line_items %>

- - - - - - - - - + <% total = 0 %> - - <% total = 0 %> - - <% @issue.line_items.each do |item| %> - <% line_total = item.quantity.to_f * item.unit_price.to_f %> - <% total += line_total %> + <% if @issue.line_items.any?%> +
<%= t :label_description %><%= t :label_qty %><%= t :label_price %><%= t :label_total %>
+ - - - - + + + + - <% end %> - + - - - - - - <% if @issue.children? %> + + + <% @issue.line_items.each do |item| %> + <% line_total = item.quantity.to_f * item.unit_price.to_f %> + <% total += line_total %> + + + + + + + + <% end %> + + + <% end %> + + + <% if @issue.line_items.any?%> + + + + + <% end %> + + <% if @issue.descendant_line_items_total > 0 %>
<%= h item.description %><%= item.quantity %><%= number_to_currency(item.unit_price) %><%= number_to_currency(line_total) %><%= t :label_description %><%= t :label_qty %><%= t :label_price %><%= t :label_total %>
<%= t :label_total %> - <%= number_to_currency(total) %> -
<%= h item.description %><%= item.quantity %><%= number_to_currency(item.unit_price) %><%= number_to_currency(line_total) %>
<%= t :label_total %> + <%= number_to_currency(total) %> +
<%= t :label_running_total %>