Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into sqa-1804-001
This commit is contained in:
@@ -6,6 +6,10 @@ App.call_waiter = App.cable.subscriptions.create('CallWaiterChannel', {
|
|||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
|
|
||||||
|
var hostname = location.hostname.trim();
|
||||||
|
if(data.from == "" || hostname == data.from)
|
||||||
|
{
|
||||||
table = data.table
|
table = data.table
|
||||||
time = data.time
|
time = data.time
|
||||||
|
|
||||||
@@ -69,5 +73,6 @@ App.call_waiter = App.cable.subscriptions.create('CallWaiterChannel', {
|
|||||||
}
|
}
|
||||||
//end Notificaiotn message
|
//end Notificaiotn message
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -6,11 +6,15 @@ App.checkin = App.cable.subscriptions.create('CheckInBookingChannel', {
|
|||||||
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('green')){
|
if($('.table_'+data.table.id).hasClass('green')){
|
||||||
$('.table_'+data.table.id).removeClass('green');
|
$('.table_'+data.table.id).removeClass('green');
|
||||||
$('.table_'+data.table.id).addClass('blue');
|
$('.table_'+data.table.id).addClass('blue');
|
||||||
}
|
}
|
||||||
$('.new_text_'+data.table.id).removeClass('hide');
|
$('.new_text_'+data.table.id).removeClass('hide');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', {
|
|||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
|
var hostname = location.hostname.trim();
|
||||||
|
if(data.from == "" || hostname == data.from)
|
||||||
|
{
|
||||||
var order = data.data;
|
var order = data.data;
|
||||||
var shop_code = data.shop_code;
|
var shop_code = data.shop_code;
|
||||||
if(order.length > 0){
|
if(order.length > 0){
|
||||||
@@ -17,7 +20,6 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', {
|
|||||||
order_lists += ', ' + value.order_reservation_id;
|
order_lists += ', ' + value.order_reservation_id;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// alert(order_lists);
|
// alert(order_lists);
|
||||||
if (typeof checkNewOrderAlert !== 'undefined' && $.isFunction(checkNewOrderAlert)) {
|
if (typeof checkNewOrderAlert !== 'undefined' && $.isFunction(checkNewOrderAlert)) {
|
||||||
checkNewOrderAlert(shop_code, order_lists);
|
checkNewOrderAlert(shop_code, order_lists);
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ App.check_order_ready_to_delivery = App.cable.subscriptions.create('CheckOrderRe
|
|||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
|
var hostname = location.hostname.trim();
|
||||||
|
if(data.from == "" || hostname == data.from)
|
||||||
|
{
|
||||||
var order = data.data;
|
var order = data.data;
|
||||||
var shop_code = data.shop_code;
|
var shop_code = data.shop_code;
|
||||||
if(order.length > 0){
|
if(order.length > 0){
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ App.check_order_send_to_kitchen = App.cable.subscriptions.create('CheckOrderSend
|
|||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
|
var hostname = location.hostname.trim();
|
||||||
|
if(data.from == "" || hostname == data.from)
|
||||||
|
{
|
||||||
var order = data.data;
|
var order = data.data;
|
||||||
var shop_code = data.shop_code;
|
var shop_code = data.shop_code;
|
||||||
if(order.length > 0){
|
if(order.length > 0){
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ App.order = App.cable.subscriptions.create('CheckinChannel', {
|
|||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
|
var hostname = location.hostname.trim();
|
||||||
|
if(data.from == "" || hostname == data.from)
|
||||||
|
{
|
||||||
$.each(data.table,function(key,value){
|
$.each(data.table,function(key,value){
|
||||||
if($('.table_'+value.table_id).hasClass('blue')){
|
if($('.table_'+value.table_id).hasClass('blue')){
|
||||||
$('.table_'+value.table_id).removeClass('blue');
|
$('.table_'+value.table_id).removeClass('blue');
|
||||||
@@ -22,5 +25,6 @@ App.order = App.cable.subscriptions.create('CheckinChannel', {
|
|||||||
$('.new_text_'+value.table_id).removeClass('hide');
|
$('.new_text_'+value.table_id).removeClass('hide');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ App.order = App.cable.subscriptions.create('OrderChannel', {
|
|||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
|
var hostname = location.hostname.trim();
|
||||||
|
console.log(hostname)
|
||||||
|
console.log(data.from)
|
||||||
|
if(data.from == "" || hostname == data.from)
|
||||||
|
{
|
||||||
if (data.type == 'order') {
|
if (data.type == 'order') {
|
||||||
$('.table_'+data.table.id).removeClass('green');
|
$('.table_'+data.table.id).removeClass('green');
|
||||||
$('.table_'+data.table.id).addClass('blue');
|
$('.table_'+data.table.id).addClass('blue');
|
||||||
@@ -15,5 +20,6 @@ App.order = App.cable.subscriptions.create('OrderChannel', {
|
|||||||
$('.new_text_'+data.table.id).removeClass('hide')
|
$('.new_text_'+data.table.id).removeClass('hide')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
|
|||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
|
var hostname = location.hostname.trim();
|
||||||
|
if(data.from == "" || hostname == data.from){
|
||||||
var oqs_id = $('.oqs_active').attr('data-id');
|
var oqs_id = $('.oqs_active').attr('data-id');
|
||||||
items = data.order;
|
items = data.order;
|
||||||
for(var field in items) {
|
for(var field in items) {
|
||||||
@@ -83,6 +85,7 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
|
|||||||
return parseInt(next.substring(4, 16)) - parseInt(first.substring(4, 16));
|
return parseInt(next.substring(4, 16)) - parseInt(first.substring(4, 16));
|
||||||
});
|
});
|
||||||
$("#oqs_container").html(SortListDivs);
|
$("#oqs_container").html(SortListDivs);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
|
|||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
|
var hostname = location.hostname.trim();
|
||||||
|
if(data.from == "" || hostname == data.from){
|
||||||
var shop_code = data.shop_code;
|
var shop_code = data.shop_code;
|
||||||
var order = data.data;
|
var order = data.data;
|
||||||
if(order.length > 0){
|
if(order.length > 0){
|
||||||
@@ -49,5 +51,6 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
|
|||||||
|
|
||||||
customTableClick();
|
customTableClick();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayChannel', {
|
|||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
|
var hostname = location.hostname.trim();
|
||||||
|
if(data.from == "" || hostname == data.from){
|
||||||
var data_obj = data.data;
|
var data_obj = data.data;
|
||||||
var status = data.status;
|
var status = data.status;
|
||||||
var count = 0
|
var count = 0
|
||||||
@@ -34,5 +36,6 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayChannel', {
|
|||||||
$('#s_grand_total').append(data_obj.grand_total);
|
$('#s_grand_total').append(data_obj.grand_total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
|||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
|
var hostname = location.hostname.trim();
|
||||||
|
if(data.from == "" || hostname == data.from){
|
||||||
var items = data.data;
|
var items = data.data;
|
||||||
var tax = data.tax_profiles;
|
var tax = data.tax_profiles;
|
||||||
var status= data.status
|
var status= data.status
|
||||||
@@ -161,6 +163,6 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
|||||||
$('#s_grand_total').empty();
|
$('#s_grand_total').empty();
|
||||||
$('#s_grand_total').append(fixed_grand_total);
|
$('#s_grand_total').append(fixed_grand_total);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -47,9 +47,12 @@ class Api::BillController < Api::ApiController
|
|||||||
Promotion.promo_activate(@sale)
|
Promotion.promo_activate(@sale)
|
||||||
|
|
||||||
#BillBroadcastJob.perform_later(table)
|
#BillBroadcastJob.perform_later(table)
|
||||||
#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
|
||||||
else
|
else
|
||||||
@status = false
|
@status = false
|
||||||
@error_message = "No Current Open Shift"
|
@error_message = "No Current Open Shift"
|
||||||
|
|||||||
@@ -6,9 +6,12 @@ class Api::CallWaitersController < ActionController::API
|
|||||||
@time = params[:time]
|
@time = params[:time]
|
||||||
@table = DiningFacility.find(@table_id)
|
@table = DiningFacility.find(@table_id)
|
||||||
# CallWaiterJob.perform_later(@table,@time)
|
# CallWaiterJob.perform_later(@table,@time)
|
||||||
#if ENV["SERVER_MODE"] != 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
ActionCable.server.broadcast "call_waiter_channel",table: @table,time:@time
|
from = request.subdomain + "." + request.domain
|
||||||
#end
|
else
|
||||||
|
from = ""
|
||||||
|
end
|
||||||
|
ActionCable.server.broadcast "call_waiter_channel",table: @table,time:@time,from: from
|
||||||
# get printer info
|
# get printer info
|
||||||
@shop = Shop.first
|
@shop = Shop.first
|
||||||
unique_code = "CallWaiterPdf"
|
unique_code = "CallWaiterPdf"
|
||||||
|
|||||||
@@ -6,7 +6,16 @@ class Api::CheckInProcessController < Api::ApiController
|
|||||||
booking = dining_facility.get_current_checkout_booking
|
booking = dining_facility.get_current_checkout_booking
|
||||||
if !booking.nil?
|
if !booking.nil?
|
||||||
|
|
||||||
DiningFacility.check_in_booking(params[:dining_id])
|
# DiningFacility.check_in_booking(params[:dining_id])
|
||||||
|
|
||||||
|
table = DiningFacility.find(params[:dining_id])
|
||||||
|
#Send to background job for processing
|
||||||
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
|
from = request.subdomain + "." + request.domain
|
||||||
|
else
|
||||||
|
from = ""
|
||||||
|
end
|
||||||
|
ActionCable.server.broadcast "check_in_booking_channel",table: table,from:from
|
||||||
|
|
||||||
check_in_time = booking.checkin_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
|
check_in_time = booking.checkin_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
|
||||||
check_out_time = booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
|
check_out_time = booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
|
||||||
|
|||||||
@@ -73,7 +73,12 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController
|
|||||||
|
|
||||||
result = { :status => true, :order_reservation_id => order_reservation_id, :message => "Order reservation is successfully created!" }
|
result = { :status => true, :order_reservation_id => order_reservation_id, :message => "Order reservation is successfully created!" }
|
||||||
order_reservation = OrderReservation.get_pending_orders #find(order_reservation_id)
|
order_reservation = OrderReservation.get_pending_orders #find(order_reservation_id)
|
||||||
ActionCable.server.broadcast "order_reservation_channel",data: order_reservation,shop_code: shop_code
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
|
from = request.subdomain + "." + request.domain
|
||||||
|
else
|
||||||
|
from = ""
|
||||||
|
end
|
||||||
|
ActionCable.server.broadcast "order_reservation_channel",data: order_reservation,shop_code: shop_code,from:from
|
||||||
else
|
else
|
||||||
result = { :status => true, :order_reservation_id => order_reservation_id, :message => "Order reservation is already existed!" }
|
result = { :status => true, :order_reservation_id => order_reservation_id, :message => "Order reservation is already existed!" }
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -181,6 +181,12 @@ puts params[:id]
|
|||||||
|
|
||||||
@status, @booking = @order.generate
|
@status, @booking = @order.generate
|
||||||
|
|
||||||
|
if @status && @booking
|
||||||
|
if params[:order_source] != "quick_service"
|
||||||
|
process_order_queue(@order.order_id,@order.table_id,@order.source)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Order.send_customer_view(@booking)
|
# Order.send_customer_view(@booking)
|
||||||
|
|
||||||
if current_user.role != "waiter" && params[:create_type] == "create_pay"
|
if current_user.role != "waiter" && params[:create_type] == "create_pay"
|
||||||
@@ -188,8 +194,12 @@ puts params[:id]
|
|||||||
|
|
||||||
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
|
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
|
||||||
# for second display
|
# for second display
|
||||||
#if ENV["SERVER_MODE"] != 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
ActionCable.server.broadcast "second_display_channel",data: @sale,status:"sale"
|
from = request.subdomain + "." + request.domain
|
||||||
|
else
|
||||||
|
from = ""
|
||||||
|
end
|
||||||
|
ActionCable.server.broadcast "second_display_channel",data: @sale,status:"sale",from:from
|
||||||
#end
|
#end
|
||||||
result = {:status=> @status, :data => @sale }
|
result = {:status=> @status, :data => @sale }
|
||||||
render :json => result.to_json
|
render :json => result.to_json
|
||||||
@@ -241,6 +251,81 @@ puts params[:id]
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def process_order_queue(order_id,table_id,order_source)
|
||||||
|
print_status = nil
|
||||||
|
cup_status = nil
|
||||||
|
|
||||||
|
#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 print_status
|
||||||
|
if !sidekiq.nil?
|
||||||
|
OrderQueueProcessorJob.perform_later(order_id, table_id)
|
||||||
|
else
|
||||||
|
if order
|
||||||
|
oqs = OrderQueueStation.new
|
||||||
|
oqs.process_order(order, table_id, order_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(order_id, table_id)
|
||||||
|
else
|
||||||
|
if order
|
||||||
|
oqs = OrderQueueStation.new
|
||||||
|
oqs.process_order(order, table_id, order_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'
|
||||||
|
from = ""
|
||||||
|
msg = ' Print Error ! Please contact to service'
|
||||||
|
ActionCable.server.broadcast "call_waiter_channel",table: msg,time:'print_error',from:from
|
||||||
|
end
|
||||||
|
if !sidekiq.nil?
|
||||||
|
OrderQueueProcessorJob.perform_later(order_id, table_id)
|
||||||
|
else
|
||||||
|
if order
|
||||||
|
oqs = OrderQueueStation.new
|
||||||
|
oqs.process_order(order, table_id, order_source)
|
||||||
|
end
|
||||||
|
|
||||||
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
|
from = request.subdomain + "." + request.domain
|
||||||
|
else
|
||||||
|
from = ""
|
||||||
|
end
|
||||||
|
assign_order = AssignedOrderItem.assigned_order_item_by_job(order_id)
|
||||||
|
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order,from:from
|
||||||
|
end
|
||||||
|
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
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# def set_dining
|
# def set_dining
|
||||||
|
|||||||
@@ -13,8 +13,12 @@ class Origami::SecondDisplayController < BaseOrigamiController
|
|||||||
else
|
else
|
||||||
tax_profiles = nil
|
tax_profiles = nil
|
||||||
end
|
end
|
||||||
#if ENV["SERVER_MODE"] != 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
ActionCable.server.broadcast "second_display_view_channel",data: params[:data],tax_profiles: tax_profiles,status:params[:status]
|
from = request.subdomain + "." + request.domain
|
||||||
|
else
|
||||||
|
from = ""
|
||||||
|
end
|
||||||
|
ActionCable.server.broadcast "second_display_view_channel",data: params[:data],tax_profiles: tax_profiles,status:params[:status],from:from
|
||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
#Shop Name in Navbor
|
#Shop Name in Navbor
|
||||||
|
|||||||
@@ -337,9 +337,13 @@ class Origami::SplitBillController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
Promotion.promo_activate(sale)
|
Promotion.promo_activate(sale)
|
||||||
#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
|
||||||
|
|
||||||
render :json => { status: status }
|
render :json => { status: status }
|
||||||
else
|
else
|
||||||
render :json => { status: false, error_message: 'No Current Open Shift!'}
|
render :json => { status: false, error_message: 'No Current Open Shift!'}
|
||||||
|
|||||||
@@ -157,15 +157,25 @@ class DiningFacility < ApplicationRecord
|
|||||||
#Send to background job for processing
|
#Send to background job for processing
|
||||||
# CheckInBookingJob.perform_later(table)
|
# CheckInBookingJob.perform_later(table)
|
||||||
#if ENV["SERVER_MODE"] != 'cloud'
|
#if ENV["SERVER_MODE"] != 'cloud'
|
||||||
ActionCable.server.broadcast "check_in_booking_channel",table: table
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
|
from = request.subdomain + "." + request.domain
|
||||||
|
else
|
||||||
|
from = ""
|
||||||
|
end
|
||||||
|
ActionCable.server.broadcast "check_in_booking_channel",table: table,from:from
|
||||||
#end
|
#end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.checkin_time
|
def self.checkin_time
|
||||||
table = DiningFacility.get_checkin_booking
|
table = DiningFacility.get_checkin_booking
|
||||||
if table.length > 0
|
if table.length > 0
|
||||||
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
|
from = request.subdomain + "." + request.domain
|
||||||
|
else
|
||||||
|
from = ""
|
||||||
|
end
|
||||||
if ENV["SERVER_MODE"] != 'cloud'
|
if ENV["SERVER_MODE"] != 'cloud'
|
||||||
ActionCable.server.broadcast "checkin_channel",table: table
|
ActionCable.server.broadcast "checkin_channel",table: table,from:from
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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)
|
||||||
@@ -108,9 +108,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)
|
||||||
@@ -283,68 +283,6 @@ class Order < ApplicationRecord
|
|||||||
# Counter number of quantityf
|
# Counter number of quantityf
|
||||||
end
|
end
|
||||||
|
|
||||||
#Process order items and send to order queue
|
|
||||||
def process_order_queue
|
|
||||||
print_status = nil
|
|
||||||
cup_status = nil
|
|
||||||
|
|
||||||
#Send to background job for processing
|
|
||||||
order = Order.find(self.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 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(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'
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
#Process order items and send to order queue
|
#Process order items and send to order queue
|
||||||
def self.pay_process_order_queue(id,table_id)
|
def self.pay_process_order_queue(id,table_id)
|
||||||
@@ -378,9 +316,13 @@ class Order < ApplicationRecord
|
|||||||
type = 'order'
|
type = 'order'
|
||||||
#Send to background job for processing
|
#Send to background job for processing
|
||||||
# OrderBroadcastJob.perform_later(table,type)
|
# OrderBroadcastJob.perform_later(table,type)
|
||||||
#if ENV["SERVER_MODE"] != 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
ActionCable.server.broadcast "order_channel",table: table,type:type
|
from = request.subdomain + "." + request.domain
|
||||||
#end
|
else
|
||||||
|
from = ""
|
||||||
|
end
|
||||||
|
ActionCable.server.broadcast "order_channel",table: table,type:type,from:from
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -534,10 +476,77 @@ class Order < ApplicationRecord
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#if ENV["SERVER_MODE"] != 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
ActionCable.server.broadcast "second_display_channel",data: @data_array,status:@status
|
from = request.subdomain + "." + request.domain
|
||||||
#end
|
else
|
||||||
|
from = ""
|
||||||
end
|
end
|
||||||
|
ActionCable.server.broadcast "second_display_channel",data: @data_array,status:@status,from:from
|
||||||
|
end
|
||||||
|
|
||||||
|
#Process order items and send to order queue
|
||||||
|
# def process_order_queue
|
||||||
|
# print_status = nil
|
||||||
|
# cup_status = nil
|
||||||
|
|
||||||
|
# #Send to background job for processing
|
||||||
|
# order = Order.find(self.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 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(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'
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,19 @@ 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)
|
# Order.pay_process_order_queue(order_id,table_id)
|
||||||
|
if order
|
||||||
|
oqs = OrderQueueStation.new
|
||||||
|
oqs.process_order(order, table_id)
|
||||||
|
end
|
||||||
|
assign_order = AssignedOrderItem.assigned_order_item_by_job(order_id)
|
||||||
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
|
from = request.subdomain + "." + request.domain
|
||||||
|
else
|
||||||
|
from = ""
|
||||||
|
end
|
||||||
|
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order,from:from
|
||||||
|
|
||||||
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)
|
||||||
|
|||||||
@@ -318,8 +318,14 @@ class OrderReservation < ApplicationRecord
|
|||||||
order_reservation = OrderReservation.where("status='new'")
|
order_reservation = OrderReservation.where("status='new'")
|
||||||
if order_reservation.length > 0
|
if order_reservation.length > 0
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
ActionCable.server.broadcast "check_new_order_channel",data: order_reservation, shop_code: shop_code
|
from = request.subdomain + "." + request.domain
|
||||||
|
ActionCable.server.broadcast "check_new_order_channel",data: order_reservation, shop_code: shop_code,from:from
|
||||||
|
else
|
||||||
|
from = ""
|
||||||
end
|
end
|
||||||
|
# if ENV["SERVER_MODE"] == 'cloud'
|
||||||
|
# ActionCable.server.broadcast "check_new_order_channel",data: order_reservation, shop_code: shop_code
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -333,8 +339,14 @@ class OrderReservation < ApplicationRecord
|
|||||||
order_reservation = OrderReservation.where("status='accepted' and requested_time <= '#{Time.now.utc}'")
|
order_reservation = OrderReservation.where("status='accepted' and requested_time <= '#{Time.now.utc}'")
|
||||||
if order_reservation.length > 0
|
if order_reservation.length > 0
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
ActionCable.server.broadcast "check_order_send_to_kitchen_channel",data: order_reservation, shop_code: shop_code
|
from = request.subdomain + "." + request.domain
|
||||||
|
ActionCable.server.broadcast "check_order_send_to_kitchen_channel",data: order_reservation, shop_code: shop_code,from:from
|
||||||
|
else
|
||||||
|
from = ""
|
||||||
end
|
end
|
||||||
|
# if ENV["SERVER_MODE"] == 'cloud'
|
||||||
|
# ActionCable.server.broadcast "check_order_send_to_kitchen_channel",data: order_reservation, shop_code: shop_code
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -348,8 +360,14 @@ class OrderReservation < ApplicationRecord
|
|||||||
order_reservation = OrderReservation.where("status='send_to_kitchen' and requested_time <= '#{Time.now.utc}'")
|
order_reservation = OrderReservation.where("status='send_to_kitchen' and requested_time <= '#{Time.now.utc}'")
|
||||||
if order_reservation.length > 0
|
if order_reservation.length > 0
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
ActionCable.server.broadcast "check_order_ready_to_delivery_channel",data: order_reservation, shop_code: shop_code
|
from = request.subdomain + "." + request.domain
|
||||||
|
ActionCable.server.broadcast "check_order_ready_to_delivery_channel",data: order_reservation, shop_code: shop_code,from:from
|
||||||
|
else
|
||||||
|
from = ""
|
||||||
end
|
end
|
||||||
|
# if ENV["SERVER_MODE"] == 'cloud'
|
||||||
|
# ActionCable.server.broadcast "check_order_ready_to_delivery_channel",data: order_reservation, shop_code: shop_code
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -2541,32 +2541,32 @@ end
|
|||||||
if current_user.nil?
|
if current_user.nil?
|
||||||
query = Sale.joins("JOIN sale_items as a ON a.sale_id = sales.sale_id")
|
query = Sale.joins("JOIN sale_items as a ON a.sale_id = sales.sale_id")
|
||||||
if !from_time.nil? && !to_time.nil?
|
if !from_time.nil? && !to_time.nil?
|
||||||
query = query.where("sales.sale_status = 'completed' and a.remark='foc' and a.product_name not like '%FOC%' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%H:%i') between ? and ?",from,to,from_time,to_time)
|
query = query.where("sales.sale_status = 'completed' and a.status='foc' and a.product_name like '%FOC%' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%H:%i') between ? and ?",from,to,from_time,to_time)
|
||||||
.sum("a.qty")
|
.count()
|
||||||
else
|
else
|
||||||
query = query.where("sales.sale_status = 'completed' and a.remark='foc' and a.product_name not like '%FOC%' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between ? and ?",from,to)
|
query = query.where("sales.sale_status = 'completed' and a.status='foc' and a.product_name like '%FOC%' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between ? and ?",from,to)
|
||||||
.sum("a.qty")
|
.count()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account'
|
if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account'
|
||||||
query = Sale.joins("JOIN sale_items as a ON a.sale_id = sales.sale_id")
|
query = Sale.joins("JOIN sale_items as a ON a.sale_id = sales.sale_id")
|
||||||
if !from_time.nil? && !to_time.nil?
|
if !from_time.nil? && !to_time.nil?
|
||||||
query = query.where("sales.sale_status = 'completed' and a.remark='foc' and a.product_name not like '%FOC%' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%H:%i') between ? and ?",from,to,from_time,to_time)
|
query = query.where("sales.sale_status = 'completed' and a.status='foc' and a.product_name like '%FOC%' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%H:%i') between ? and ?",from,to,from_time,to_time)
|
||||||
.sum("a.qty")
|
.count()
|
||||||
else
|
else
|
||||||
query = query.where("sales.sale_status = 'completed' and a.remark='foc' and a.product_name not like '%FOC%' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between ? and ?",from,to)
|
query = query.where("sales.sale_status = 'completed' and a.status='foc' and a.product_name like '%FOC%' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between ? and ?",from,to)
|
||||||
.sum("a.qty")
|
.count()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
shift = ShiftSale.current_open_shift(current_user.id)
|
shift = ShiftSale.current_open_shift(current_user.id)
|
||||||
if !shift.nil?
|
if !shift.nil?
|
||||||
query = Sale.joins("JOIN sale_items as a ON a.sale_id = sales.sale_id")
|
query = Sale.joins("JOIN sale_items as a ON a.sale_id = sales.sale_id")
|
||||||
if !from_time.nil? && !to_time.nil?
|
if !from_time.nil? && !to_time.nil?
|
||||||
query = query.where("sales.sale_status = 'completed' and a.remark='foc' and a.product_name not like '%FOC%' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%H:%i') between ? and ? and sales.shift_sale_id=?",from,to,from_time,to_time,shift.id)
|
query = query.where("sales.sale_status = 'completed' and a.status='foc' and a.product_name like '%FOC%' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%H:%i') between ? and ? and sales.shift_sale_id=?",from,to,from_time,to_time,shift.id)
|
||||||
.sum("a.qty")
|
.count()
|
||||||
else
|
else
|
||||||
query = query.where("sales.sale_status = 'completed' and a.remark='foc' and a.product_name not like '%FOC%' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between ? and ? and sales.shift_sale_id=?",from,to,shift.id)
|
query = query.where("sales.sale_status = 'completed' and a.status='foc' and a.product_name like '%FOC%' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between ? and ? and sales.shift_sale_id=?",from,to,shift.id)
|
||||||
.sum("a.qty")
|
.count()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2574,19 +2574,19 @@ end
|
|||||||
else
|
else
|
||||||
if current_user.nil?
|
if current_user.nil?
|
||||||
query = Sale.joins("JOIN sale_items as a ON a.sale_id = sales.sale_id")
|
query = Sale.joins("JOIN sale_items as a ON a.sale_id = sales.sale_id")
|
||||||
.where("sales.sale_status = 'completed' and a.remark='foc' and a.product_name not like '%FOC%' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = ?",today)
|
.where("sales.sale_status = 'completed' and a.status='foc' and a.product_name like '%FOC%' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = ?",today)
|
||||||
.sum("a.qty")
|
.count()
|
||||||
else
|
else
|
||||||
if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account'
|
if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account'
|
||||||
query = Sale.joins("JOIN sale_items as a ON a.sale_id = sales.sale_id")
|
query = Sale.joins("JOIN sale_items as a ON a.sale_id = sales.sale_id")
|
||||||
.where("sales.sale_status = 'completed' and a.remark='foc' and a.product_name not like '%FOC%' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = ?",today)
|
.where("sales.sale_status = 'completed' and a.status='foc' and a.product_name like '%FOC%' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = ?",today)
|
||||||
.sum("a.qty")
|
.count()
|
||||||
else
|
else
|
||||||
shift = ShiftSale.current_open_shift(current_user.id)
|
shift = ShiftSale.current_open_shift(current_user.id)
|
||||||
if !shift.nil?
|
if !shift.nil?
|
||||||
query = Sale.joins("JOIN sale_items as a ON a.sale_id = sales.sale_id")
|
query = Sale.joins("JOIN sale_items as a ON a.sale_id = sales.sale_id")
|
||||||
.where("sales.sale_status = 'completed' and a.remark='foc' and a.product_name not like '%FOC%' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = ? and sales.shift_sale_id=?",today,shift.id)
|
.where("sales.sale_status = 'completed' and a.status='foc' and a.product_name like '%FOC%' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = ? and sales.shift_sale_id=?",today,shift.id)
|
||||||
.sum("a.qty")
|
.count()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -609,7 +609,12 @@ class SalePayment < ApplicationRecord
|
|||||||
#Send to background job for processing
|
#Send to background job for processing
|
||||||
# OrderBroadcastJob.perform_later(table,type)
|
# OrderBroadcastJob.perform_later(table,type)
|
||||||
#if ENV["SERVER_MODE"] != 'cloud'
|
#if ENV["SERVER_MODE"] != 'cloud'
|
||||||
ActionCable.server.broadcast "order_channel",table: table,type:type
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
|
from = request.subdomain + "." + request.domain
|
||||||
|
else
|
||||||
|
from = ""
|
||||||
|
end
|
||||||
|
ActionCable.server.broadcast "order_channel",table: table,type:type,from:from
|
||||||
#end
|
#end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -346,10 +346,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||||
|
<% if @cashier_type!="quick_service" %>
|
||||||
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
||||||
<i class="material-icons">reply</i>
|
<i class="material-icons">reply</i>
|
||||||
Back
|
Back
|
||||||
</button>
|
</button>
|
||||||
|
<% end %>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<% if current_login_employee.role == "cashier" %>
|
<% if current_login_employee.role == "cashier" %>
|
||||||
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="foc"> FOC</a>
|
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="foc"> FOC</a>
|
||||||
|
|||||||
@@ -2,13 +2,11 @@ class CreateDisplayImages < ActiveRecord::Migration[5.1]
|
|||||||
def change
|
def change
|
||||||
create_table :display_images do |t|
|
create_table :display_images do |t|
|
||||||
t.integer :shop_id
|
t.integer :shop_id
|
||||||
|
t.string :name
|
||||||
t.binary :image
|
t.binary :image
|
||||||
t.string :created_by
|
t.string :created_by
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def down
|
|
||||||
drop_table :display_images
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
5
spec/models/display_image_spec.rb
Normal file
5
spec/models/display_image_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe DisplayImage, type: :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user