End of day commit

This commit is contained in:
2014-07-21 20:31:11 +02:00
parent 2fec0b3bb6
commit 8ca59c4e38
27 changed files with 258 additions and 94 deletions
+6 -3
View File
@@ -268,10 +268,14 @@ class List
end
end
def relevant_orders
orders.reject(&:cancelled?)
end
# Store the final list price in a property
def set_price
list_total = 0.0
for order in orders
for order in relevant_orders
order_total = 0.0
for product_order in order.product_orders
order_total += (product_order.quantity * product_order.price).round(2)
@@ -408,8 +412,7 @@ class List
@with_info_as_json = hl
end
private
# should not be private, called from order as well
def broadcast_users(message, content = {})
for user_id in Array.wrap(user_ids)
broadcast_user user_id, message, content