backup push

This commit is contained in:
2012-08-24 16:20:03 +02:00
parent e3c189d187
commit 4765608e2d
17 changed files with 172 additions and 56 deletions
+11 -3
View File
@@ -94,8 +94,8 @@ class ListsController < ApplicationController
ho = {products: []}
order_total = 0.0
for product_order in order.product_orders
order_total += (product_order.amount * product_order.product.price).round(2)
ho[:products] << {name: product_order.product.name, id: product_order.product_id, number: product_order.amount, price: product_order.product.price}
order_total += (product_order.amount * product_order.price).round(2)
ho[:products] << {name: product_order.product.name, id: product_order.product_id, number: product_order.amount, price: product_order.price}
end
ho[:total_amount] = order_total.round(2)
ho[:state] = order.state
@@ -110,12 +110,20 @@ class ListsController < ApplicationController
end
# POST /orders/1/is_delivered
# POST /orders/1/is_closed
def is_closed
@list = List.find(params[:id])
@list.close!
render nothing: true
end
# POST /orders/1/is_helped
def is_helped
@list = List.find(params[:id])
@list.needs_help = false
@list.save
render nothing: true
end
private
def set_relation_options