diff --git a/app/models/group_order.rb b/app/models/group_order.rb index becb7879..d4ca7c69 100644 --- a/app/models/group_order.rb +++ b/app/models/group_order.rb @@ -27,7 +27,7 @@ class GroupOrder < ActiveRecord::Base validates_uniqueness_of :ordergroup_id, :scope => :order_id # order groups can only order once per order named_scope :open, lambda { {:conditions => ["order_id IN (?)", Order.open.collect(&:id)]} } - named_scope :finished, lambda { {:conditions => ["order_id IN (?)", Order.finished.collect(&:id)]} } + named_scope :finished, lambda { {:conditions => ["order_id IN (?)", Order.finished_not_closed.collect(&:id)]} } # Updates the "price" attribute. # This will be the maximum value of an open order or diff --git a/app/views/ordering/index.haml b/app/views/ordering/index.haml index 2cd7ddac..f5c74a69 100644 --- a/app/views/ordering/index.haml +++ b/app/views/ordering/index.haml @@ -28,7 +28,7 @@ .box_title %h2 Nicht abgerechnete Bestellungen .column_content - = render :partial => "orders", :locals => {:orders => Order.finished} + = render :partial => "orders", :locals => {:orders => Order.finished_not_closed} - if @ordergroup.value_of_finished_orders > 0 %p Gesamtsumme: diff --git a/app/views/ordering/myOrders.haml b/app/views/ordering/myOrders.haml index 4850d0b5..93dc70c9 100644 --- a/app/views/ordering/myOrders.haml +++ b/app/views/ordering/myOrders.haml @@ -7,7 +7,7 @@ .box_title %h2 beendet/nicht abgerechnet .column_content - = render :partial => "orders", :locals => {:orders => Order.finished} + = render :partial => "orders", :locals => {:orders => Order.finished_not_closed} .single_column{:style => "width:50em"} .box_title