Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into quick_service
This commit is contained in:
@@ -38,11 +38,11 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
else
|
||||
# check for license file
|
||||
# if check_license
|
||||
# current_license(ENV["SX_PROVISION_URL"])
|
||||
# else
|
||||
# redirect_to activate_path
|
||||
# end
|
||||
if check_license
|
||||
current_license(ENV["SX_PROVISION_URL"])
|
||||
else
|
||||
redirect_to activate_path
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -38,15 +38,21 @@ class Origami::HomeController < BaseOrigamiController
|
||||
if !order.order_items.empty?
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, order.order_items.count)
|
||||
else
|
||||
@order_items_count[booking.dining_facility_id] += order.order_items.count
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status !='completed'
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||
if !booking.sale_id.nil?
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status !='completed'
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||
else
|
||||
@order_items_count[booking.dining_facility_id] += sale.sale_items.count
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -80,6 +86,9 @@ class Origami::HomeController < BaseOrigamiController
|
||||
@order_items.push(item)
|
||||
end
|
||||
accounts = @customer.tax_profiles
|
||||
puts accounts.to_json
|
||||
puts "sssssssssss"
|
||||
puts @customer.tax_profiles
|
||||
@account_arr =[]
|
||||
accounts.each do |acc|
|
||||
account = TaxProfile.find(acc)
|
||||
|
||||
@@ -24,15 +24,21 @@ class Origami::OrdersController < BaseOrigamiController
|
||||
if !order.order_items.empty?
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, order.order_items.count)
|
||||
else
|
||||
@order_items_count[booking.dining_facility_id] += order.order_items.count
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status !='completed'
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||
if !booking.sale_id.nil?
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status !='completed'
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||
else
|
||||
@order_items_count[booking.dining_facility_id] += sale.sale_items.count
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,15 +34,21 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
if !order.order_items.empty?
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, order.order_items.count)
|
||||
else
|
||||
@order_items_count[booking.dining_facility_id] += order.order_items.count
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status !='completed'
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||
if !booking.sale_id.nil?
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status !='completed'
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||
else
|
||||
@order_items_count[booking.dining_facility_id] += sale.sale_items.count
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@ class SymControlController < BaseController
|
||||
http_basic_authenticate_with name: "vip", password: "!abcABC01"
|
||||
|
||||
def run
|
||||
sym_path = "/home/yan/symmetric/"
|
||||
sym_path = File.expand_path("~/symmetric/")
|
||||
check_sym_proc_str = `#{"sudo service SymmetricDS status"}`
|
||||
# Check Sym Installed
|
||||
# if sym_install_status[1] == "false"
|
||||
@@ -12,13 +12,13 @@ class SymControlController < BaseController
|
||||
|
||||
if check_sym_proc_str.include? "Active: active (running)" || "Active: active (exited)" #"Server is already running"
|
||||
# Create Sym Table
|
||||
check_sym_table = system("sudo " + sym_path + "bin/symadmin --engine sx create-sym-tables")
|
||||
check_sym_table = system("sudo " + sym_path + "/bin/symadmin --engine sx create-sym-tables")
|
||||
if check_sym_table
|
||||
sym_sql = Rails.root + "db/sym_master.sql"
|
||||
|
||||
if File.exist? (sym_sql)
|
||||
# Import Sym Sql to db and start sym
|
||||
run_sym_sql = system("sudo " + sym_path + "bin/dbimport --engine sx " + sym_sql.to_s)
|
||||
run_sym_sql = system("sudo " + sym_path + "/bin/dbimport --engine sx " + sym_sql.to_s)
|
||||
stop_sym = system("sudo service SymmetricDS stop")
|
||||
run_sym = system("sudo service SymmetricDS start")
|
||||
if run_sym
|
||||
|
||||
Reference in New Issue
Block a user