diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 7fafd6bd..3f789fc4 100755
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -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
diff --git a/app/controllers/sym_control_controller.rb b/app/controllers/sym_control_controller.rb
index 92d9cedd..9b7a7a66 100644
--- a/app/controllers/sym_control_controller.rb
+++ b/app/controllers/sym_control_controller.rb
@@ -22,14 +22,14 @@ class SymControlController < BaseController
stop_sym = system("service SymmetricDS stop")
run_sym = system("service SymmetricDS start")
if run_sym
- render :text => "
Success!
"
+ flash[:notice] = 'Success!'
end
else
- render :text => "Sym Sql file not found!
"
+ flash[:notice] = 'Sym Sql file not found!'
end
end
else
- render :text => "Sym not running!
"
+ flash[:notice] = "Sym not running!"
end
end
@@ -37,9 +37,9 @@ class SymControlController < BaseController
license = License.new(ENV["SX_PROVISION_URL"])
status = license.get_key
if status
- render :text => "Success!
"
+ flash[:notice] = "Success!"
else
- render :text => "Not Get!
"
+ flash[:notice] = "Not Get!"
end
end
diff --git a/app/models/license.rb b/app/models/license.rb
index b8604b20..869abe59 100755
--- a/app/models/license.rb
+++ b/app/models/license.rb
@@ -106,7 +106,7 @@ class License
redis = Redis.new
cache_license = redis.get(cache_key)
- # Rails.logger.info "Cache key - " + cache_key.to_s
+ Rails.logger.info "Cache key - " + cache_key.to_s
if cache_license.nil?
cache = {"shop" => @activate["shop_name"], "key" => aes_key, "iv" => @activate["iv_key"], "renewable_date" => @activate["renewable_date"] }
@@ -114,7 +114,7 @@ class License
redis.set(cache_key, Marshal.dump(cache))
end
- # Rails.logger.info "License - " + response.parsed_response.to_s
+ Rails.logger.info "License - " + response.parsed_response.to_s
response = create_license_file(@activate)
if(response[:status])
@@ -136,9 +136,9 @@ class License
response = self.class.get("/verify", @params)
@varified = response.parsed_response
- # Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
+ Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
if (@varified["status"])
- if (!check_expired(@varified["plan_next_renewal_date"]))
+ if (!check_expired(@varified["renewable_date"]))
return true
end
else
@@ -247,10 +247,10 @@ class License
redis = Redis.new
cache_license = redis.get(cache_key)
- # Rails.logger.info "Cache key - " + cache_key.to_s
+ Rails.logger.info "Cache key - " + cache_key.to_s
if cache_license.nil?
- cache = {"shop" => shop_name, "key" => @data["secret_key"], "iv" => @data["iv_key"], "renewable_date" => @data["plan_next_renewable_date"] }
+ cache = {"shop" => shop_name, "key" => @data["secret_key"], "iv" => @data["iv_key"], "renewable_date" => @data["renewable_date"] }
redis = Redis.new
redis.set(cache_key, Marshal.dump(cache))
end
@@ -358,7 +358,7 @@ class License
f.write("db.user=#{dbusername}\n")
f.write("db.password=#{dbpassword}\n")
f.write("registration.url=http://#{db_host}:31415/sync/sx\n")
- f.write("group.id=store\n")
+ f.write("group.id=cloud\n")
f.write("external.id=001\n")
f.write("job.routing.period.time.ms=5000\n")
f.write("job.push.period.time.ms=10000\n")
diff --git a/app/models/order.rb b/app/models/order.rb
index ef21b7ff..e0bee492 100755
--- a/app/models/order.rb
+++ b/app/models/order.rb
@@ -137,13 +137,13 @@ class Order < ApplicationRecord
Rails.logger.debug menu_item
set_order_items = Array.new
##If menu Item set item - must add child items to order as well, where price is only take from menu_item
- # if (menu_item[:type] == "SetMenuItem")
- # set_order_items =
- # end
-
- if (item.include? 'sub_items') || (item.include? :sub_items)
- item[:sub_items].each do |si|
- set_order_items.push({"item_instance_code"=>si[:item_instance_code], "quantity"=>si[:quantity]})
+ if (menu_item[:type] == "SetMenuItem")
+ if (item.include? 'sub_items') || (item.include? :sub_items)
+ item[:sub_items].each do |si|
+ # Retrive instance's Price
+ set_item = MenuItem.search_by_item_code(si[:item_instance_code])
+ set_order_items.push({"item_instance_code"=>si[:item_instance_code], "quantity"=>si[:quantity]}, "price"=>set_item[:price])
+ end
end
end
diff --git a/app/views/layouts/installation.html.erb b/app/views/layouts/installation.html.erb
index 35b99bd3..542b7d5a 100755
--- a/app/views/layouts/installation.html.erb
+++ b/app/views/layouts/installation.html.erb
@@ -29,9 +29,21 @@
+ <% flash.each do |type, message| %>
+ <% if type == "notice"
+ color = "alert-success"
+ elsif type == "error"
+ color = "alert-danger"
+ else
+ color = "bg-black"
+ end %>
+
+
+
+ <% end %>
<%= yield %>
-