Fixed open_orders partial.
This commit is contained in:
parent
5b2df07378
commit
adbe93f39e
3 changed files with 5 additions and 6 deletions
|
@ -82,7 +82,7 @@ class Order < ActiveRecord::Base
|
|||
def expired?
|
||||
!ends.nil? && ends < Time.now
|
||||
end
|
||||
|
||||
|
||||
# search GroupOrder of given Ordergroup
|
||||
def group_order(ordergroup)
|
||||
group_orders.first :conditions => { :ordergroup_id => ordergroup.id }
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
- if current_user.ordergroup
|
||||
// Current orders
|
||||
= render :partial => 'shared/open_orders'
|
||||
= render :partial => 'shared/open_orders', :locals => {:ordergroup => current_user.ordergroup}
|
||||
|
||||
// Stats
|
||||
- if current_user.ordergroup
|
||||
|
|
|
@ -15,13 +15,12 @@
|
|||
%tr{:class => cycle('even', 'odd', :name => 'open_orders')}
|
||||
%td= link_to h(order.name), :controller => 'ordering', :action => 'order', :id => order
|
||||
%td=h format_time(order.ends) unless order.ends.nil?
|
||||
- if group_order = order.group_order(@ordergroup)
|
||||
- if group_order = order.group_order(ordergroup)
|
||||
- total += group_order.price
|
||||
%td=h "#{group_order.updated_by.nick} (#{format_time(group_order.updated_on)})"
|
||||
%td= "#{group_order.updated_by.nick} (#{format_time(group_order.updated_on)})"
|
||||
%td= number_to_currency(group_order.price)
|
||||
- else
|
||||
%td
|
||||
%td
|
||||
%td{:colspan => 2}
|
||||
- if total > 0
|
||||
%p
|
||||
Gesamtsumme:
|
||||
|
|
Loading…
Reference in a new issue