rake
This commit is contained in:
@@ -118,11 +118,11 @@ class Foodcourt::AddordersController < BaseFoodcourtController
|
||||
end
|
||||
items_arr.push(items)
|
||||
}
|
||||
# begin
|
||||
|
||||
if params[:order_source] == "quick_service" && params[:table_id].to_i == 0
|
||||
customer_id = "CUS-000000000002" # for no customer id from mobile
|
||||
customer_id = takeaway.customer_id # for no customer id from mobile
|
||||
else
|
||||
customer_id = params[:customer_id] == ""? "CUS-000000000001" : params[:customer_id] # for no customer id from mobile
|
||||
customer_id = params[:customer_id].present? ? params[:customer_id] : walkin.customer_id # for no customer id from mobile
|
||||
end
|
||||
|
||||
@order = Order.new
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Foodcourt::DashboardController < BaseFoodcourtController
|
||||
def get_all_menu
|
||||
@menus = Menu.includes(:menu_categories => {:menu_items => :menu_item_instances}).includes(:menu_categories => {:menu_items => :item_sets }).active.shop
|
||||
@menus = Menu.includes(:menu_categories => {:menu_items => :menu_item_instances}).includes(:menu_categories => {:menu_items => :item_sets }).active
|
||||
@item_attributes = MenuItemAttribute.all.load
|
||||
@item_options = MenuItemOption.all.load
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@ class Settings::MenusController < ApplicationController
|
||||
# GET /settings/menus
|
||||
# GET /settings/menus.json
|
||||
def index
|
||||
|
||||
|
||||
@settings_menus = Menu.all.page(params[:page]).per(10)
|
||||
respond_to do |format|
|
||||
format.html
|
||||
@@ -31,7 +31,7 @@ class Settings::MenusController < ApplicationController
|
||||
# POST /settings/menus
|
||||
# POST /settings/menus.json
|
||||
def create
|
||||
|
||||
|
||||
@settings_menu = Menu.new(settings_menu_params)
|
||||
@settings_menu.created_by = current_login_employee.name
|
||||
respond_to do |format|
|
||||
@@ -75,7 +75,7 @@ class Settings::MenusController < ApplicationController
|
||||
end
|
||||
|
||||
def export
|
||||
|
||||
|
||||
@settings_menus = Menu.all.page(params[:page]).per(10)
|
||||
menu = Menu.find(params[:id])
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
<%if ShiftSale.current_open_shift(current_login_employee) %>
|
||||
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
|
||||
<%if current_login_employee.role == "cashier" && food_court %>
|
||||
<a class="navbar-brand mbl_view" href="<%=foodcourt_food_court_path%>" style="margin-left: 20px;">
|
||||
<a class="navbar-brand mbl_view" href="<%=foodcourt_food_court_path%>" style="margin-left: 20px;">
|
||||
<%else%>
|
||||
<a class="navbar-brand mbl_view" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">
|
||||
<a class="navbar-brand mbl_view" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">
|
||||
<%end%>
|
||||
<%else%>
|
||||
<a class="navbar-brand mbl_view" href="" style="margin-left: 20px;">
|
||||
@@ -161,15 +161,15 @@
|
||||
</a>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
|
||||
<% if food_court %>
|
||||
<li>
|
||||
<p class="waves-effect waves-block p-l-30 m-b-5 close_cashier">
|
||||
<i class="material-icons font-7 logout_icon">close</i>
|
||||
<span class="font-15">Close Cashier</span>
|
||||
</p>
|
||||
</li>
|
||||
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
|
||||
<% if food_court %>
|
||||
<li>
|
||||
<p class="waves-effect waves-block p-l-30 m-b-5 close_cashier">
|
||||
<i class="material-icons font-7 logout_icon">close</i>
|
||||
<span class="font-15">Close Cashier</span>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<li>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<%= render 'layouts/header' %>
|
||||
<section>
|
||||
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
|
||||
<% if food_court %>
|
||||
<% if food_court && current_user.role=='cashier'%>
|
||||
<%= render 'layouts/foodcourt_left_sidebar' %>
|
||||
<% else %>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace :manual_data do
|
||||
{lookup_type:'employee_roles',name: 'Manager',value: 'manager',shop_code: args.shop_code},
|
||||
{lookup_type:'employee_roles',name: 'Accountant',value: 'account',shop_code: args.shop_code},
|
||||
{lookup_type:'employee_roles',name: 'Administrator',value: 'administrator',shop_code: args.shop_code},
|
||||
{lookup_type:'employee_roles',name: 'FoodCourt Cashier',value: 'foodcourt_cashier',shop_code: args.shop_code}])
|
||||
{lookup_type:'employee_roles',name: 'Application',value: 'application',shop_code: args.shop_code}])
|
||||
puts " Finished employee_roles Set Up Data"
|
||||
|
||||
#booking_status
|
||||
@@ -151,7 +151,7 @@ namespace :manual_data do
|
||||
puts " Finished changable_tax Set Up Data"
|
||||
|
||||
# expity_time
|
||||
expity_time = Lookup.create([{lookup_type:'expity_time',name: 'login',value: '{30}',shop_code: args.shop_code}])
|
||||
expity_time = Lookup.create([{lookup_type:'expiry_time',name: 'login',value: '{30}',shop_code: args.shop_code}])
|
||||
puts " Finished expity_time Set Up Data"
|
||||
|
||||
#foodcourt use
|
||||
@@ -178,12 +178,12 @@ namespace :manual_data do
|
||||
puts " Finished Default CUSTOMER Set Up Data"
|
||||
|
||||
#seed_generators
|
||||
ActiveRecord::Base.connection.execute("INSERT INTO seed_generators(model,current,next,shop_code,created_at,updated_at) VALUES ('Customer',3,4,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP());")
|
||||
ActiveRecord::Base.connection.execute("INSERT INTO seed_generators(model,current,next,shop_code,created_at,updated_at) VALUES ('Customer',3,4,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('TableBooking',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('Order',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('OrderItem',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('AssignedOrderItem',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('sale',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SaleOrder',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SaleItem',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SaleAudit',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SalePayment',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('SaleTax',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('Reservation',1,2,'#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP());")
|
||||
puts " Finished seed_generators Set Up Data"
|
||||
|
||||
|
||||
#Create Adminstrator employee
|
||||
ActiveRecord::Base.connection.execute("INSERT INTO employees(name,role,password_digest,emp_id,created_by,shop_code,created_at,updated_at) VALUES ('Administrator','administrator','$2a$10$OKFA4b4yh0xCJNmzjMMijusnO712LUSEL4/y56p2XmdKBRPWgXwDa','999','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP()),('Cashier','cashier','$2a$12$NZ6JNxcp8PbSafAl1p740uUqGsULETtHq4Kr0JQYnfAiSNR3Jrfuu','222','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP());")
|
||||
ActiveRecord::Base.connection.execute("INSERT INTO employees(name,role,password_digest,emp_id,created_by,shop_code,created_at,updated_at,app_id,app_token) VALUES ('Administrator','administrator','$2a$10$OKFA4b4yh0xCJNmzjMMijusnO712LUSEL4/y56p2XmdKBRPWgXwDa','999','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(),NULL,NULL),('Cashier','cashier','$2a$10$rXWBQro.YqUu5klH9oxqA.vcdq7webHm75FeXylY4uoJlek82luOq','333','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(),NULL,NULL),('Manager','manager','$2a$10$JmzePPoejam8alpR6hrjr.8jIe/pm36IhErtoP4WwK788x2JfHUL2','777','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(),NULL,NULL),('Application','application','$2a$12$Kzr5OIFb7B7KU52iKNoeSu5LnXtfJx0YX3s3d.HHJzxeodCv31Ehm','444','SYSTEM DEFAULT','#{args.shop_code}',CURRENT_TIMESTAMP(),CURRENT_TIMESTAMP(), '#{SecureRandom.urlsafe_base64(nil, false)}', '#{SecureRandom.hex(10)}');")
|
||||
puts " Finished Create Adminstrator employee Set Up Data"
|
||||
|
||||
#PrintSetting
|
||||
@@ -215,7 +215,6 @@ namespace :manual_data do
|
||||
|
||||
payment_methods = PaymentMethodSetting.create({payment_method:"PAYMAL",gateway_url: "/api/create_payment",merchant_account_id:"pZBHXEFbGNj/G",shop_code: args.shop_code})
|
||||
puts " Finished payment_methods Set Up Data"
|
||||
|
||||
puts " Finished System Default Set Up Data"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user