layout changes and section handling

This commit is contained in:
2012-09-02 14:23:17 +02:00
parent 50434c28cf
commit 0b56d07ed1
24 changed files with 390 additions and 283 deletions
+2
View File
@@ -49,6 +49,7 @@ class SupplierController < ApplicationController
ho[:total_amount] = order_total.round(2)
ho[:state] = order.state
ho[:table_number] = order.table_number
ho[:section_title] = order.list.table.section.title
ho[:id] = order.id
list_total += ho[:total_amount]
h[:orders] << ho
@@ -73,6 +74,7 @@ class SupplierController < ApplicationController
hl = list.as_json
hl[:total_amount] = list.orders.inject(0.0){|sum, o| sum + o.product_orders.inject(0.0){|s, po| s + (po.amount * po.price).round(2)}}.round(2)
grand_total += hl[:total_amount]
hl[:section_title] = list.table.section.title
h[:lists] << hl
end
h[:total_amount] = grand_total.round(2)