layout changes and section handling
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -83,5 +83,27 @@ module Suppliers
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /sections/1/manage_tables
|
||||
# GET /sections/1/manage_tables.json
|
||||
def manage_tables
|
||||
@section = Section.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @section }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /sections/1/tables_view
|
||||
# GET /sections/1/tables_view.json
|
||||
def tables_view
|
||||
@section = Section.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @section }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user