Qwaiter supplier on Ember 1.0

This commit is contained in:
2013-09-30 17:49:22 +02:00
parent 6d7647c2c5
commit 8ea2e79dc2
44 changed files with 378 additions and 156 deletions
+2 -2
View File
@@ -43,8 +43,8 @@ class SupplierController < ApplicationController
ho = {products: []}
order_total = 0.0
for product_order in order.product_orders
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}
order_total += (product_order.quantity * product_order.price).round(2)
ho[:products] << {name: product_order.product.name, id: product_order.product_id, number: product_order.quantity, price: product_order.price}
end
ho[:total_amount] = order_total.round(2)
ho[:state] = order.state