2009-01-29 01:57:51 +01:00
|
|
|
%table
|
|
|
|
%tr
|
|
|
|
%th Name
|
|
|
|
%th Gebinde
|
2009-02-03 21:14:48 +01:00
|
|
|
%th Netto-/Bruttopreis
|
2009-01-29 01:57:51 +01:00
|
|
|
%th Bestellte Einheiten
|
|
|
|
%th Volle Gebinde
|
|
|
|
- total_net, total_gross, counter = 0, 0, 0
|
2009-02-04 16:41:01 +01:00
|
|
|
- order.articles_grouped_by_category.each do |category_name, order_articles|
|
2009-01-29 01:57:51 +01:00
|
|
|
%tr{:style => "background-color:#EFEFEF"}
|
|
|
|
%td{:style => "text-align:left; color: grey;"}=h category_name
|
|
|
|
%td{:colspan => "9"}
|
|
|
|
- order_articles.each do |order_article|
|
|
|
|
- net_price = order_article.price.price
|
2009-02-03 21:14:48 +01:00
|
|
|
- gross_price = order_article.price.gross_price
|
2009-01-29 01:57:51 +01:00
|
|
|
- units = order_article.units_to_order
|
|
|
|
- unit_quantity = order_article.price.unit_quantity
|
|
|
|
- total_net += units * unit_quantity * net_price
|
2009-02-03 21:14:48 +01:00
|
|
|
- total_gross += units * unit_quantity * gross_price
|
2009-01-29 01:57:51 +01:00
|
|
|
%tr{:class => cycle('even', 'odd', :name => 'articles'), :style => "color: #{units > 0 ? 'green' : 'red'}"}
|
|
|
|
%td=h order_article.article.name
|
|
|
|
%td= "#{unit_quantity} x #{order_article.article.unit}"
|
2009-02-03 21:14:48 +01:00
|
|
|
%td= "#{number_to_currency(net_price)} / #{number_to_currency(gross_price)}"
|
2009-01-29 01:57:51 +01:00
|
|
|
%td= "#{order_article.quantity} + #{order_article.tolerance}" if unit_quantity > 1
|
|
|
|
%td= units
|
|
|
|
%p
|
2009-02-03 21:14:48 +01:00
|
|
|
Summe (Netto/Brutto-Preise):
|
2009-01-29 01:57:51 +01:00
|
|
|
= "#{number_to_currency(total_net)} / #{number_to_currency(total_gross)}"
|
|
|
|
%p
|
|
|
|
Bestellte Artikel.
|
|
|
|
= order.order_articles.ordered.count
|