Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes
This commit is contained in:
@@ -1437,7 +1437,8 @@ $(function() {
|
||||
}
|
||||
}
|
||||
|
||||
row = '<div class="card custom-card testimonial-card fadeInRight" style="height:100%;background-image:url(../../'+image_path+');background-repeat: no-repeat;">'
|
||||
row = '<div class="col-md-3">'
|
||||
+'<div class="card custom-card testimonial-card fadeInRight" style="height:100%;background-image:url(../../'+image_path+');background-repeat: no-repeat;">'
|
||||
+'<div class="custom-card-head card-head row" style="line-height:14px;margin:0px;" style="">'
|
||||
+'<div class="col-md-10 " style="padding:0px !important;">'+ menu_items[field].name +'</div>'
|
||||
+"<div class='col-md-2 "+menu_item_box+" ' data-item-code='"
|
||||
@@ -1471,7 +1472,8 @@ $(function() {
|
||||
+'<div class="card-footer custom-card-footer" style="opacity:0.7">'
|
||||
+'<span>'+ price +'</span>'
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
+'</div>'
|
||||
+'</div>'; ;
|
||||
$('.menu_items_list').append(row);
|
||||
}
|
||||
//end instances in menu-items alest 1 instance
|
||||
|
||||
@@ -12,6 +12,7 @@ section .content{
|
||||
}
|
||||
.custom-card {
|
||||
border: 2px solid rgba(0, 0, 0, 0.125) !important;
|
||||
margin-bottom: 7px !important;
|
||||
}
|
||||
.custom-card-footer{
|
||||
padding:0.35rem 1.25rem !important;
|
||||
@@ -72,16 +73,26 @@ section .content{
|
||||
.nav-tabs {
|
||||
background-color: #ccc;
|
||||
}
|
||||
.nav-tabs li a.active{
|
||||
border-bottom:1px solid #54A5AF !important;
|
||||
}
|
||||
.nav-tabs .nav-link {
|
||||
padding: 0.7286rem 0.2575;
|
||||
border-top-left-radius: 0rem;
|
||||
border-top-right-radius: 0rem;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-link:focus, .nav-tabs .nav-link:hover {
|
||||
color: #54A5AF #54A5AF #54A5AF;
|
||||
}
|
||||
.nav-tabs .nav-link.active:focus, .nav-tabs .nav-link.active:hover {
|
||||
background-color: #009688;
|
||||
}
|
||||
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
|
||||
background-color: #a1aade;
|
||||
border-left: 6px solid #111;
|
||||
color:#54A5AF;
|
||||
font-weight: bold;
|
||||
background-color: #fff !important;
|
||||
border-left: 6px solid #54A5AF !important;
|
||||
color: #54A5AF !important;
|
||||
font-weight: bold !important;
|
||||
border-color: #fff #fff #fff #54A5AF;
|
||||
}
|
||||
.sub_category_list{
|
||||
|
||||
@@ -117,6 +117,9 @@ class Api::OrdersController < Api::ApiController
|
||||
end
|
||||
|
||||
@status, @booking = @order.generate
|
||||
if @status && @booking
|
||||
Order.process_order_queue(@order.order_id,@order.table_id,@order.source)
|
||||
end
|
||||
# # for parallel order
|
||||
# remoteIP = ""
|
||||
# begin
|
||||
|
||||
@@ -301,13 +301,6 @@ class Order < ApplicationRecord
|
||||
end
|
||||
# end
|
||||
end
|
||||
|
||||
def check_cup_status(status)
|
||||
if status.include? "Active: active (running)" || "Active: active (exited)" #"Cup Server is already running"
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
#send order items and send to order queue
|
||||
def send_order_broadcast(booking)
|
||||
@@ -485,68 +478,74 @@ class Order < ApplicationRecord
|
||||
end
|
||||
|
||||
#Process order items and send to order queue
|
||||
# def process_order_queue
|
||||
# print_status = nil
|
||||
# cup_status = nil
|
||||
def self.process_order_queue(order_id,table_id,source)
|
||||
print_status = nil
|
||||
cup_status = nil
|
||||
|
||||
# #Send to background job for processing
|
||||
# order = Order.find(self.id)
|
||||
# sidekiq = Lookup.find_by_lookup_type("sidekiq")
|
||||
#Send to background job for processing
|
||||
order = Order.find(order_id)
|
||||
sidekiq = Lookup.find_by_lookup_type("sidekiq")
|
||||
|
||||
# if ENV["SERVER_MODE"] != 'cloud'
|
||||
# cup_status = `#{"sudo service cups status"}`
|
||||
# print_status = check_cup_status(cup_status)
|
||||
# end
|
||||
if ENV["SERVER_MODE"] != 'cloud'
|
||||
cup_status = `#{"sudo service cups status"}`
|
||||
print_status = check_cup_status(cup_status)
|
||||
end
|
||||
|
||||
# if print_status
|
||||
# if !sidekiq.nil?
|
||||
# OrderQueueProcessorJob.perform_later(self.id, self.table_id)
|
||||
# else
|
||||
# if order
|
||||
# oqs = OrderQueueStation.new
|
||||
# oqs.process_order(order, self.table_id, self.source)
|
||||
# end
|
||||
# # assign_order = AssignedOrderItem.assigned_order_item_by_job(self.id)
|
||||
# # ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
||||
# end
|
||||
# else
|
||||
# if ENV["SERVER_MODE"] != 'cloud'
|
||||
# cup_start = `#{"sudo service cups start"}`
|
||||
# cup_status = `#{"sudo service cups status"}`
|
||||
# print_status = check_cup_status(cup_status)
|
||||
# end
|
||||
if print_status
|
||||
if !sidekiq.nil?
|
||||
OrderQueueProcessorJob.perform_later(order_id, table_id)
|
||||
else
|
||||
if order
|
||||
oqs = OrderQueueStation.new
|
||||
oqs.process_order(order, table_id, source)
|
||||
end
|
||||
# assign_order = AssignedOrderItem.assigned_order_item_by_job(order_id)
|
||||
# ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
||||
end
|
||||
else
|
||||
if ENV["SERVER_MODE"] != 'cloud'
|
||||
cup_start = `#{"sudo service cups start"}`
|
||||
cup_status = `#{"sudo service cups status"}`
|
||||
print_status = check_cup_status(cup_status)
|
||||
end
|
||||
|
||||
# if print_status
|
||||
# if !sidekiq.nil?
|
||||
# OrderQueueProcessorJob.perform_later(self.id, self.table_id)
|
||||
# else
|
||||
# if order
|
||||
# oqs = OrderQueueStation.new
|
||||
# oqs.process_order(order, self.table_id, self.source)
|
||||
# end
|
||||
# # assign_order = AssignedOrderItem.assigned_order_item_by_job(self.id)
|
||||
# # ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
||||
# end
|
||||
# else
|
||||
# if ENV["SERVER_MODE"] != 'cloud'
|
||||
if print_status
|
||||
if !sidekiq.nil?
|
||||
OrderQueueProcessorJob.perform_later(order_id, table_id)
|
||||
else
|
||||
if order
|
||||
oqs = OrderQueueStation.new
|
||||
oqs.process_order(order, table_id, source)
|
||||
end
|
||||
# assign_order = AssignedOrderItem.assigned_order_item_by_job(order_id)
|
||||
# ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
||||
end
|
||||
else
|
||||
if ENV["SERVER_MODE"] != 'cloud'
|
||||
|
||||
# msg = ' Print Error ! Please contact to service'
|
||||
# ActionCable.server.broadcast "call_waiter_channel",table: msg,time:'print_error'
|
||||
# end
|
||||
# if !sidekiq.nil?
|
||||
# OrderQueueProcessorJob.perform_later(self.id, self.table_id)
|
||||
# else
|
||||
# if order
|
||||
# oqs = OrderQueueStation.new
|
||||
# oqs.process_order(order, self.table_id, self.source)
|
||||
# end
|
||||
# assign_order = AssignedOrderItem.assigned_order_item_by_job(self.id)
|
||||
# ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
msg = ' Print Error ! Please contact to service'
|
||||
ActionCable.server.broadcast "call_waiter_channel",table: msg,time:'print_error'
|
||||
end
|
||||
if !sidekiq.nil?
|
||||
OrderQueueProcessorJob.perform_later(order_id, table_id)
|
||||
else
|
||||
if order
|
||||
oqs = OrderQueueStation.new
|
||||
oqs.process_order(order, table_id, source)
|
||||
end
|
||||
assign_order = AssignedOrderItem.assigned_order_item_by_job(order_id)
|
||||
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def self.check_cup_status(status)
|
||||
if status.include? "Active: active (running)" || "Active: active (exited)" #"Cup Server is already running"
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
<div class="card">
|
||||
<div class="card-block" style="">
|
||||
<div class="card-text" id="custom-slimscroll">
|
||||
<div class="card-columns custom-card-columns menu_items_list" style="column-gap: 0.5rem;">
|
||||
<div class="row menu_items_list" style="margin:0px 1px 0px 1px ;">
|
||||
<!-- append data -->
|
||||
<% @menu.each do |menu| %>
|
||||
<% if !menu.valid_time.nil? %>
|
||||
|
||||
@@ -6,11 +6,12 @@ json.valid_time_to menu.valid_time_to.strftime("%H:%M")
|
||||
|
||||
if (menu.menu_categories)
|
||||
order_by = Lookup.find_by_lookup_type("order_by")
|
||||
if !order_by.nil? && order_by.value == "name"
|
||||
categories = MenuCategory.unscoped.where("menu_id ='#{menu.id}'").order("name asc")
|
||||
else
|
||||
categories = menu.menu_categories
|
||||
end
|
||||
# if !order_by.nil? && order_by.value == "name"
|
||||
# categories = MenuCategory.unscoped.where("menu_id ='#{menu.id}'").order("name asc")
|
||||
# else
|
||||
# categories = menu.menu_categories
|
||||
# end
|
||||
categories = menu.menu_categories
|
||||
json.categories categories do |category|
|
||||
|
||||
menu_category = MenuCategory.find_by_menu_category_id(category.id)
|
||||
|
||||
Reference in New Issue
Block a user