foodsoft/app/views/orders/_showResult_groups.rhtml
2009-01-06 11:49:19 +01:00

45 lines
No EOL
1.5 KiB
Text

<div class="legend">
<table style="margin-bottom:1em" class="legend">
<tr>
<th style="width:40%">Name</th>
<th><acronym title="zugeteilte Einheiten (davon aus Toleranzmenge)">Menge</acronym></th>
<th><acronym title="Bruttopreis incl. MwSt, Aufschlag, Pfand">Preis</acronym></th>
<th><acronym title="Gebindegröße">GebGr</acronym></th>
<th>Einheit</th>
<th>Gesamtpreis</th>
</tr>
</table>
</div>
<% for groupOrderResult in @order.group_order_results %>
<table style="margin-bottom:1em">
<thead>
<tr>
<th colspan="6"><%=h groupOrderResult.group_name %></th>
</tr>
</thead>
<tbody>
<%
total = 0
for result in groupOrderResult.group_order_article_results
price = result.order_article_result.gross_price
quantity = result.quantity
subTotal = price * quantity
total += subTotal
%>
<tr class="<%= cycle('even', 'odd', :name => 'articles') %>">
<td style="width:40%"><%=h result.order_article_result.name %></td>
<td><%=h quantity %> (<%=h result.tolerance %>)</td>
<td><%= number_to_currency(price) %></td>
<td><%=h result.order_article_result.unit_quantity %></td>
<td><%=h result.order_article_result.unit %></td>
<td><%= number_to_currency(subTotal) %></td>
</tr>
<% end %>
<tr class="<%= cycle('even', 'odd', :name => 'articles') %>">
<th colspan="5">Summe</th>
<th><%= number_to_currency(total) %></th>
</tr>
</tbody>
</table>
<%- reset_cycle("articles") -%>
<% end %>