foodsoft/app/views/shared/_articles_by_groups.html.haml

43 lines
1.5 KiB
Plaintext

%table.table.table-hover
%thead
%tr
%th{:style => "width:40%"}= t '.name'
%th
%acronym{:title => t('shared.articles.ordered_desc')}= t 'shared.articles.ordered'
%th
%acronym{:title => t('shared.articles.received_desc')}= t 'shared.articles.received'
%th
%acronym{:title => t('.fc_price_desc')}= t '.fc_price'
%th
%acronym{:title => t('.unit_quantity_desc')}= t '.unit_quantity'
%th= t '.unit'
%th= t '.price'
- for group_order in order.group_orders.ordered
%thead
%tr
%th{:colspan => "7"}
%h4= group_order.ordergroup.name
%tbody
- total = 0
- for goa in group_order.group_order_articles.ordered.all(:include => :order_article)
- fc_price = goa.order_article.price.fc_price
- subTotal = fc_price * goa.result
- total += subTotal
%tr{:class => [cycle('even', 'odd', :name => 'articles'), if goa.result == 0 then 'unavailable' end]}
%td{:style => "width:40%"}=h goa.order_article.article.name
%td= "#{goa.quantity} + #{goa.tolerance}"
%td
%b= goa.result
%td= number_to_currency(fc_price)
%td= goa.order_article.price.unit_quantity
%td= goa.order_article.article.unit
%td= number_to_currency(subTotal)
%tr{:class => cycle('even', 'odd', :name => 'articles')}
%th{:colspan => "6"} Summe
%th= number_to_currency(total)
%tr
%th(colspan="7")
- reset_cycle("articles")