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

32 lines
1 KiB
Text
Raw Normal View History

.box_title
%h2 Laufende Bestellungen
.column_content
- if ordergroup.not_enough_apples?
.warning
%p Achtung, Deine Bestellgruppe hat zu wenig Äpfel um Bestellen zu können!
- unless Order.open.empty?
%table.list
%thead
%tr
%th Lieferantin
%th Ende
%th Wer hat bestellt?
%th Summe
%tbody
- total = 0
- Order.open.each do |order|
%tr{:class => cycle('even', 'odd', :name => 'open_orders')}
%td= link_to_ordering(order)
%td=h format_time(order.ends) unless order.ends.nil?
2011-06-13 15:26:06 +02:00
- if group_order = order.group_order(ordergroup)
- total += group_order.price
2011-06-13 15:26:06 +02:00
%td= "#{group_order.updated_by.nick} (#{format_time(group_order.updated_on)})"
%td= number_to_currency(group_order.price)
- else
2011-06-13 15:26:06 +02:00
%td{:colspan => 2}
- if total > 0
%p
Gesamtsumme:
%b= number_to_currency(total)
- else
%i Derzeit gibt es keine laufenden Bestellungen