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

41 lines
1.3 KiB
Text

%section
%h2= t '.title'
- if ordergroup.not_enough_apples?
.alert
= t '.not_enough_apples'
- orders = Order.open.started
- unless orders.empty?
%table.table.table-striped
%thead
%tr
%th= heading_helper Order, :name
%th
%th= heading_helper Order, :pickup
%th= heading_helper Order, :ends
%th= t '.who_ordered'
%th.numeric= heading_helper GroupOrder, :price
%tbody
- total = 0
- orders.each do |order|
%tr
%td
= link_to_ordering(order, show: true)
%td
.btn-small= link_to_ordering(order){ t 'ui.edit' }
%td= format_date(order.pickup) unless order.pickup.nil?
%td= format_time(order.ends) unless order.ends.nil?
- if group_order = order.group_order(ordergroup)
- total += group_order.price
%td= "#{show_user group_order.updated_by} (#{format_time(group_order.updated_on)})"
%td.numeric
= number_to_currency(group_order.price)
- else
%td{:colspan => 2}
- if total > 0
%tfooter
%tr
%th(colspan="4")
%th= t('.total_sum') + ':'
%th.numeric= number_to_currency(total)
- else
%i= t '.no_open_orders'