Pull from master
This commit is contained in:
@@ -58,8 +58,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="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;">'
|
+'<div class="custom-card-head card-head row" style="line-height:14px;margin:0px;">'
|
||||||
+'<div class="col-md-9">'+ product[field].name +'</div>'
|
+'<div class="col-md-10">'+ product[field].name +'</div>'
|
||||||
+"<div class='col-md-3 menu_item_box' data-item-code='"
|
+"<div class='col-md-2 menu_item_box' data-item-code='"
|
||||||
+ product[field].item_code +"' data-instance = '"
|
+ product[field].item_code +"' data-instance = '"
|
||||||
+JSON.stringify(item_attributes)+"' data-id = '"
|
+JSON.stringify(item_attributes)+"' data-id = '"
|
||||||
+JSON.stringify(item_attributes)+"' data-item = '"
|
+JSON.stringify(item_attributes)+"' data-item = '"
|
||||||
@@ -67,7 +67,7 @@ $(function() {
|
|||||||
+JSON.stringify(product[field].options)+"'data-opt = '"
|
+JSON.stringify(product[field].options)+"'data-opt = '"
|
||||||
+JSON.stringify(product[field].options)+"' data-item-sets = '"
|
+JSON.stringify(product[field].options)+"' data-item-sets = '"
|
||||||
+JSON.stringify(item_attributes)+"' data-image='"+image_path+"' data-toggle='modal' data-target='.sx_item_detailModal'>"
|
+JSON.stringify(item_attributes)+"' data-image='"+image_path+"' data-toggle='modal' data-target='.sx_item_detailModal'>"
|
||||||
+"<i class='fa fa-bars material-icons'>"
|
+"<i class='fa fa-bars material-icons m-l--10'>"
|
||||||
+'view_list</i>'
|
+'view_list</i>'
|
||||||
+'</div>'
|
+'</div>'
|
||||||
+'</div>'
|
+'</div>'
|
||||||
@@ -1430,8 +1430,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="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="custom-card-head card-head row" style="line-height:14px;margin:0px;" style="">'
|
||||||
+'<div class="col-md-9">'+ menu_items[field].name +'</div>'
|
+'<div class="col-md-10 " style="padding-left:10px !important;">'+ menu_items[field].name +'</div>'
|
||||||
+"<div class='col-md-3 "+menu_item_box+"' data-item-code='"
|
+"<div class='col-md-2 "+menu_item_box+"' data-item-code='"
|
||||||
+ menu_items[field].code +"' data-instance = '"
|
+ menu_items[field].code +"' data-instance = '"
|
||||||
+JSON.stringify(menu_items[field].instances)+"' data-id = '"
|
+JSON.stringify(menu_items[field].instances)+"' data-id = '"
|
||||||
+JSON.stringify(menu_items[field].attributes)+"' data-item = '"
|
+JSON.stringify(menu_items[field].attributes)+"' data-item = '"
|
||||||
@@ -1439,7 +1439,7 @@ $(function() {
|
|||||||
+JSON.stringify(menu_items[field].options)+"'data-opt = '"
|
+JSON.stringify(menu_items[field].options)+"'data-opt = '"
|
||||||
+JSON.stringify(menu_items[field].options)+"' data-item-sets = '"
|
+JSON.stringify(menu_items[field].options)+"' data-item-sets = '"
|
||||||
+JSON.stringify(menu_items[field].item_sets)+"' data-toggle='modal' data-target='."+data_target+"' >"
|
+JSON.stringify(menu_items[field].item_sets)+"' data-toggle='modal' data-target='."+data_target+"' >"
|
||||||
+"<i class='fa "+fa_plus+" '>"
|
+"<i class='m-l--10 fa "+fa_plus+" '>"
|
||||||
+add+ '</i>'
|
+add+ '</i>'
|
||||||
+'</div>'
|
+'</div>'
|
||||||
+'</div>'
|
+'</div>'
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ App.order = App.cable.subscriptions.create('BillChannel', {
|
|||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
|
var hostname = location.hostname.trim();
|
||||||
|
if(data.from == "" || hostname == data.from)
|
||||||
|
{
|
||||||
if($('.table_'+data.table.id).hasClass('blue')){
|
if($('.table_'+data.table.id).hasClass('blue')){
|
||||||
$('.table_'+data.table.id).removeClass('blue');
|
$('.table_'+data.table.id).removeClass('blue');
|
||||||
$('.table_'+data.table.id).addClass('red');
|
$('.table_'+data.table.id).addClass('red');
|
||||||
@@ -16,5 +19,6 @@ App.order = App.cable.subscriptions.create('BillChannel', {
|
|||||||
$('.new_text_'+data.table.id).removeClass('hide');
|
$('.new_text_'+data.table.id).removeClass('hide');
|
||||||
$('.new_text_'+data.table.id).text('billed');
|
$('.new_text_'+data.table.id).text('billed');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
App.order = App.cable.subscriptions.create('OrderChannel', {
|
App.order = App.cable.subscriptions.create('OrderChannel', {
|
||||||
// App.messages = App.cable.subscriptions.create('MessagesChannel', {
|
|
||||||
|
|
||||||
connected: function() {},
|
connected: function() {},
|
||||||
|
|
||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|||||||
@@ -1,7 +1,27 @@
|
|||||||
module ApplicationCable
|
module ApplicationCable
|
||||||
class Connection < ActionCable::Connection::Base
|
class Connection < ActionCable::Connection::Base
|
||||||
|
identified_by :current_subdomain
|
||||||
def connect
|
def connect
|
||||||
|
if ENV["server_mode"] == "cloud"
|
||||||
|
self.current_subdomain = verified_subdomain
|
||||||
|
end
|
||||||
logger.add_tags "SX-ActionCable"
|
logger.add_tags "SX-ActionCable"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def verified_subdomain
|
||||||
|
from = request.subdomain.downcase + "." + request.domain.downcase
|
||||||
|
file_path = "config/shops.json"
|
||||||
|
shop_data = File.read(file_path)
|
||||||
|
|
||||||
|
shop_json = JSON.parse(shop_data)
|
||||||
|
shop_json["data"].each do |j|
|
||||||
|
if j["lookup"] == from
|
||||||
|
verified_subdomain = from
|
||||||
|
else
|
||||||
|
reject_unauthorized_connection
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -39,9 +39,12 @@ class Origami::RequestBillsController < ApplicationController
|
|||||||
# Promotion Activation
|
# Promotion Activation
|
||||||
Promotion.promo_activate(@sale)
|
Promotion.promo_activate(@sale)
|
||||||
#bill channel
|
#bill channel
|
||||||
#if ENV["SERVER_MODE"] != 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
ActionCable.server.broadcast "bill_channel",table: table
|
from = request.subdomain + "." + request.domain
|
||||||
#end
|
else
|
||||||
|
from = ""
|
||||||
|
end
|
||||||
|
ActionCable.server.broadcast "bill_channel",table: table, from: from
|
||||||
if order.source == "quick_service"
|
if order.source == "quick_service"
|
||||||
result = {:status=> @status, :data => @sale.sale_id }
|
result = {:status=> @status, :data => @sale.sale_id }
|
||||||
render :json => result.to_json
|
render :json => result.to_json
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class MenuCategory < ApplicationRecord
|
|||||||
validates_presence_of :code, :name, :menu, :order_by
|
validates_presence_of :code, :name, :menu, :order_by
|
||||||
validates_uniqueness_of :code
|
validates_uniqueness_of :code
|
||||||
|
|
||||||
default_scope { order('order_by asc') }
|
default_scope { order('name asc') }
|
||||||
scope :active, -> {where("is_available = 1")}
|
scope :active, -> {where("is_available = 1")}
|
||||||
|
|
||||||
def self.destroyCategory(menu_category)
|
def self.destroyCategory(menu_category)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class MenuItem < ApplicationRecord
|
|||||||
validates_presence_of :item_code, :name, :type, :min_qty,:account_id
|
validates_presence_of :item_code, :name, :type, :min_qty,:account_id
|
||||||
validates_uniqueness_of :item_code
|
validates_uniqueness_of :item_code
|
||||||
|
|
||||||
default_scope { order('item_code asc') }
|
default_scope { order('name asc') }
|
||||||
|
|
||||||
scope :simple_menu_item, -> { where(type: 'SimpleMenuItem') }
|
scope :simple_menu_item, -> { where(type: 'SimpleMenuItem') }
|
||||||
scope :set_menu_item, -> { where(type: 'SetMenuItem') }
|
scope :set_menu_item, -> { where(type: 'SetMenuItem') }
|
||||||
|
|||||||
@@ -71,9 +71,9 @@ class Order < ApplicationRecord
|
|||||||
BookingOrder.create({:booking_id => booking.booking_id, :order => self})
|
BookingOrder.create({:booking_id => booking.booking_id, :order => self})
|
||||||
|
|
||||||
#Send order to queue one it done!
|
#Send order to queue one it done!
|
||||||
# if self.source != "quick_service"
|
if self.source != "quick_service"
|
||||||
process_order_queue
|
process_order_queue
|
||||||
# end
|
end
|
||||||
|
|
||||||
#send order to broadcast job
|
#send order to broadcast job
|
||||||
send_order_broadcast(booking)
|
send_order_broadcast(booking)
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
order = Order.find(order_id)
|
order = Order.find(order_id)
|
||||||
order_items = order.order_items
|
order_items = order.order_items
|
||||||
|
|
||||||
|
Order.pay_process_order_queue(order_id,table_id)
|
||||||
if table_id.to_i > 0
|
if table_id.to_i > 0
|
||||||
# get dining
|
# get dining
|
||||||
dining = DiningFacility.find(table_id)
|
dining = DiningFacility.find(table_id)
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ class ActionController::Base
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
#check for license file
|
#check for license file
|
||||||
if check_license
|
# if check_license
|
||||||
current_license(ENV["SX_PROVISION_URL"])
|
# current_license(ENV["SX_PROVISION_URL"])
|
||||||
else
|
# else
|
||||||
redirect_to activate_path
|
# redirect_to activate_path
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user