update option and menu export csv single
This commit is contained in:
@@ -67,7 +67,8 @@ class Api::OrdersController < Api::ApiController
|
||||
end
|
||||
}
|
||||
#end extra time
|
||||
|
||||
puts params[:order_items]
|
||||
puts "ITEM aaaaaaaaaaaaaaaaaaa"
|
||||
# begin
|
||||
@order = Order.new
|
||||
@order.source = params[:order_source]
|
||||
|
||||
@@ -94,10 +94,10 @@ class Origami::AddordersController < BaseOrigamiController
|
||||
extra_time = Time.at(time)
|
||||
end
|
||||
end
|
||||
if i["parent_order_item_id"]
|
||||
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"parent_order_item_id": i["parent_order_item_id"],"options": i["options"]}
|
||||
if i["parent_order_item_id"];
|
||||
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"parent_order_item_id": i["parent_order_item_id"],"options": JSON.parse(i["options"])}
|
||||
else
|
||||
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"options": i["options"]}
|
||||
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"options": JSON.parse(i["options"])}
|
||||
end
|
||||
items_arr.push(items)
|
||||
}
|
||||
|
||||
@@ -7,9 +7,12 @@ class Settings::MenusController < ApplicationController
|
||||
def index
|
||||
@settings_menus = Menu.all.page(params[:page]).per(10)
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.csv { send_data Menu.to_csv }
|
||||
end
|
||||
format.html
|
||||
# format.csv { send_data MenuCsvExport.generate }
|
||||
|
||||
format.csv { send_data Menu.to_csv }
|
||||
# format.csv { send_data MenuCategory.to_csv }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /settings/menus/1
|
||||
@@ -71,6 +74,11 @@ class Settings::MenusController < ApplicationController
|
||||
# end
|
||||
end
|
||||
|
||||
def import
|
||||
Menu.import(params[:file])
|
||||
redirect_to settings_menu_path, notice: "imported"
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_settings_menu
|
||||
|
||||
@@ -21,11 +21,12 @@ class Transactions::OrdersController < ApplicationController
|
||||
@receipt_no = filter
|
||||
@from = from
|
||||
@to = to
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @orders }
|
||||
end
|
||||
format.html
|
||||
format.json { render json: @orders }
|
||||
# format.csv { send_data OrdersCsvExport.generate }
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
Reference in New Issue
Block a user