2012-10-15 21:19:17 +02:00
|
|
|
%table.table.table-hover
|
|
|
|
%thead
|
|
|
|
%tr
|
2013-11-23 12:05:29 +01:00
|
|
|
%th= heading_helper Article, :name
|
2014-01-03 12:42:36 +01:00
|
|
|
%th= heading_helper Article, :unit
|
2013-02-08 01:52:20 +01:00
|
|
|
%th= t '.prices'
|
2013-12-18 21:34:54 +01:00
|
|
|
- if order.stockit?
|
|
|
|
%th= t '.units_ordered'
|
|
|
|
- else
|
|
|
|
%th= 'Members'
|
2013-02-08 01:52:20 +01:00
|
|
|
%th= t '.units_full'
|
2012-10-15 21:19:17 +02:00
|
|
|
- total_net, total_gross, counter = 0, 0, 0
|
2014-01-17 13:14:49 +01:00
|
|
|
%tbody.list
|
2012-10-15 21:19:17 +02:00
|
|
|
- order.articles_grouped_by_category.each do |category_name, order_articles|
|
2014-01-17 13:14:49 +01:00
|
|
|
%tr.list-heading.article-category
|
2012-10-15 21:19:17 +02:00
|
|
|
%td
|
|
|
|
= category_name
|
|
|
|
%i.icon-tag
|
|
|
|
%td{:colspan => "9"}
|
|
|
|
- order_articles.each do |order_article|
|
|
|
|
- net_price = order_article.price.price
|
|
|
|
- gross_price = order_article.price.gross_price
|
|
|
|
- unit_quantity = order_article.price.unit_quantity
|
2013-12-18 21:34:54 +01:00
|
|
|
- units = order_article.units
|
2012-10-15 21:19:17 +02:00
|
|
|
- total_net += units * unit_quantity * net_price
|
|
|
|
- total_gross += units * unit_quantity * gross_price
|
2013-12-18 21:34:54 +01:00
|
|
|
- cssclass = (units > 0 ? 'used' : (order_article.quantity > 0 ? 'unused' : 'unavailable'))
|
|
|
|
%tr{:class => cycle('even', 'odd', :name => 'articles') + ' ' + cssclass}
|
2014-01-17 13:14:49 +01:00
|
|
|
%td.name=h order_article.article.name
|
2014-01-03 12:42:36 +01:00
|
|
|
%td= order_article.article.unit
|
2014-01-09 13:24:40 +01:00
|
|
|
%td= "#{number_to_currency(net_price)} / #{number_to_currency(gross_price)}"
|
2012-10-15 21:19:17 +02:00
|
|
|
- if order.stockit?
|
|
|
|
%td= units
|
|
|
|
- else
|
2013-07-11 23:18:12 +02:00
|
|
|
- if unit_quantity > 1 or order_article.tolerance > 0
|
|
|
|
%td= "#{order_article.quantity} + #{order_article.tolerance}"
|
|
|
|
- else
|
|
|
|
%td= "#{order_article.quantity}"
|
2014-01-31 13:07:13 +01:00
|
|
|
%td{title: units_history_line(order_article, plain: true)}
|
2013-12-18 21:34:54 +01:00
|
|
|
= units
|
2014-01-03 12:42:36 +01:00
|
|
|
= pkg_helper order_article.price
|
2009-01-29 01:57:51 +01:00
|
|
|
%p
|
2013-02-08 01:52:20 +01:00
|
|
|
= t '.prices_sum'
|
2009-01-29 01:57:51 +01:00
|
|
|
= "#{number_to_currency(total_net)} / #{number_to_currency(total_gross)}"
|
|
|
|
%p
|
2013-02-08 01:52:20 +01:00
|
|
|
= t '.article_count'
|
|
|
|
= order.order_articles.ordered.count
|