-
This commit is contained in:
@@ -41,14 +41,14 @@ class Order < ApplicationRecord
|
|||||||
:booking_status => "assign" })
|
:booking_status => "assign" })
|
||||||
end
|
end
|
||||||
#end extra time
|
#end extra time
|
||||||
|
|
||||||
if self.table_id.to_i > 0
|
if self.table_id.to_i > 0
|
||||||
table = DiningFacility.find(self.table_id)
|
table = DiningFacility.find(self.table_id)
|
||||||
table.update_attributes(status:"occupied")
|
table.update_attributes(status:"occupied")
|
||||||
# table.status = "occupied"
|
# table.status = "occupied"
|
||||||
# table.save
|
# table.save
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
booking = Booking.find(self.booking_id)
|
booking = Booking.find(self.booking_id)
|
||||||
#add extra time
|
#add extra time
|
||||||
@@ -56,7 +56,7 @@ class Order < ApplicationRecord
|
|||||||
if !booking.checkout_at.nil?
|
if !booking.checkout_at.nil?
|
||||||
new_time = booking.checkout_at + self.extra_time.to_i
|
new_time = booking.checkout_at + self.extra_time.to_i
|
||||||
booking.update_attributes(checkout_at: new_time)
|
booking.update_attributes(checkout_at: new_time)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#end extra time
|
#end extra time
|
||||||
end
|
end
|
||||||
@@ -74,7 +74,7 @@ class Order < ApplicationRecord
|
|||||||
#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)
|
||||||
@@ -138,7 +138,7 @@ class Order < ApplicationRecord
|
|||||||
ordered_list.each do |item|
|
ordered_list.each do |item|
|
||||||
|
|
||||||
menu_item = MenuItem.search_by_item_code(item[:item_instance_code])
|
menu_item = MenuItem.search_by_item_code(item[:item_instance_code])
|
||||||
|
|
||||||
# For Product while item code not in menu item
|
# For Product while item code not in menu item
|
||||||
if menu_item.nil?
|
if menu_item.nil?
|
||||||
menu_item = Product.search_by_product_code(item[:item_instance_code])
|
menu_item = Product.search_by_product_code(item[:item_instance_code])
|
||||||
@@ -148,7 +148,7 @@ class Order < ApplicationRecord
|
|||||||
# Rails.logger.debug menu_item
|
# Rails.logger.debug menu_item
|
||||||
set_order_items = Array.new
|
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 set item - must add child items to order as well, where price is only take from menu_item
|
||||||
if (menu_item[:type] == "SetMenuItem")
|
if (menu_item[:type] == "SetMenuItem")
|
||||||
if (item.include? 'sub_items') || (item.include? :sub_items)
|
if (item.include? 'sub_items') || (item.include? :sub_items)
|
||||||
item[:sub_items].each do |si|
|
item[:sub_items].each do |si|
|
||||||
# Retrive instance's Price
|
# Retrive instance's Price
|
||||||
@@ -286,7 +286,7 @@ class Order < ApplicationRecord
|
|||||||
# Counter number of quantityf
|
# Counter number of quantityf
|
||||||
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)
|
||||||
# if ENV["SERVER_MODE"] != 'cloud'
|
# if ENV["SERVER_MODE"] != 'cloud'
|
||||||
@@ -294,7 +294,7 @@ class Order < ApplicationRecord
|
|||||||
if !sidekiq.nil?
|
if !sidekiq.nil?
|
||||||
OrderQueueProcessorJob.perform_later(id, table_id)
|
OrderQueueProcessorJob.perform_later(id, table_id)
|
||||||
else
|
else
|
||||||
order = Order.find(id)
|
order = Order.find(id)
|
||||||
if order
|
if order
|
||||||
oqs = OrderQueueStation.new
|
oqs = OrderQueueStation.new
|
||||||
oqs.process_order(order, table_id)
|
oqs.process_order(order, table_id)
|
||||||
@@ -314,11 +314,11 @@ class Order < ApplicationRecord
|
|||||||
# OrderBroadcastJob.perform_later(table,type)
|
# OrderBroadcastJob.perform_later(table,type)
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
from = request.subdomain + "." + request.domain
|
from = request.subdomain + "." + request.domain
|
||||||
else
|
else
|
||||||
from = ""
|
from = ""
|
||||||
end
|
end
|
||||||
ActionCable.server.broadcast "order_channel",table: table,type:type,from:from
|
ActionCable.server.broadcast "order_channel",table: table,type:type,from:from
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -434,7 +434,7 @@ class Order < ApplicationRecord
|
|||||||
if from.present? && to.present?
|
if from.present? && to.present?
|
||||||
order = Order.where("DATE_FORMAT(date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(date,'%d-%m-%Y') <= ?", from,to)
|
order = Order.where("DATE_FORMAT(date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(date,'%d-%m-%Y') <= ?", from,to)
|
||||||
query = order.where(keyword)
|
query = order.where(keyword)
|
||||||
else
|
else
|
||||||
where("order_id LIKE ? OR status LIKE ? OR order_type LIKE ? OR source='#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%")
|
where("order_id LIKE ? OR status LIKE ? OR order_type LIKE ? OR source='#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -442,12 +442,12 @@ class Order < ApplicationRecord
|
|||||||
def self.send_customer_view(booking)
|
def self.send_customer_view(booking)
|
||||||
@status = ""
|
@status = ""
|
||||||
@data_array = Array.new
|
@data_array = Array.new
|
||||||
if(!booking.sale_id.nil?)
|
if(!booking.sale_id.nil?)
|
||||||
sale = Sale.find(booking.sale_id)
|
sale = Sale.find(booking.sale_id)
|
||||||
if sale.sale_status != "completed" && sale.sale_status != 'void'
|
if sale.sale_status != "completed" && sale.sale_status != 'void'
|
||||||
@data_array.push(sale)
|
@data_array.push(sale)
|
||||||
@status = "sale"
|
@status = "sale"
|
||||||
@data_obj = sale
|
@data_obj = sale
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
||||||
@@ -474,7 +474,7 @@ class Order < ApplicationRecord
|
|||||||
end
|
end
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
from = request.subdomain + "." + request.domain
|
from = request.subdomain + "." + request.domain
|
||||||
else
|
else
|
||||||
from = ""
|
from = ""
|
||||||
end
|
end
|
||||||
ActionCable.server.broadcast "second_display_channel",data: @data_array,status:@status,from:from
|
ActionCable.server.broadcast "second_display_channel",data: @data_array,status:@status,from:from
|
||||||
@@ -484,11 +484,11 @@ class Order < ApplicationRecord
|
|||||||
def self.process_order_queue(order_id,table_id,source)
|
def self.process_order_queue(order_id,table_id,source)
|
||||||
print_status = nil
|
print_status = nil
|
||||||
cup_status = nil
|
cup_status = nil
|
||||||
|
|
||||||
#Send to background job for processing
|
#Send to background job for processing
|
||||||
order = Order.find(order_id)
|
order = Order.find(order_id)
|
||||||
sidekiq = Lookup.find_by_lookup_type("sidekiq")
|
sidekiq = Lookup.find_by_lookup_type("sidekiq")
|
||||||
|
|
||||||
if ENV["SERVER_MODE"] != 'cloud'
|
if ENV["SERVER_MODE"] != 'cloud'
|
||||||
cup_status = `#{"sudo service cups status"}`
|
cup_status = `#{"sudo service cups status"}`
|
||||||
print_status = check_cup_status(cup_status)
|
print_status = check_cup_status(cup_status)
|
||||||
@@ -526,7 +526,7 @@ class Order < ApplicationRecord
|
|||||||
else
|
else
|
||||||
if ENV["SERVER_MODE"] != 'cloud'
|
if ENV["SERVER_MODE"] != 'cloud'
|
||||||
|
|
||||||
msg = ' Print Error ! Please contact to service'
|
msg = ' Print Error ! Please contact to service'
|
||||||
ActionCable.server.broadcast "call_waiter_channel",table: msg,time:'print_error'
|
ActionCable.server.broadcast "call_waiter_channel",table: msg,time:'print_error'
|
||||||
end
|
end
|
||||||
if !sidekiq.nil?
|
if !sidekiq.nil?
|
||||||
|
|||||||
@@ -29,4 +29,4 @@ if @status == true
|
|||||||
else
|
else
|
||||||
json.status false
|
json.status false
|
||||||
json.error_message @error_message
|
json.error_message @error_message
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
<%end %>
|
<%end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||||
<%= paginate @crm_customers %>
|
<%= paginate @crm_customers %>
|
||||||
@@ -76,8 +76,8 @@
|
|||||||
<button id="member_acc_no" class="btn btn-success btn-md"><span class="fa fa-credit-card"></span> Member Card</button>
|
<button id="member_acc_no" class="btn btn-success btn-md"><span class="fa fa-credit-card"></span> Member Card</button>
|
||||||
<button id="qr_code" class="btn btn-danger btn-md">
|
<button id="qr_code" class="btn btn-danger btn-md">
|
||||||
<span class="fa fa-credit-card"></span> QR CODE
|
<span class="fa fa-credit-card"></span> QR CODE
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>-->
|
</tr>-->
|
||||||
<tr>
|
<tr>
|
||||||
@@ -122,8 +122,9 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= crm_customer.card_no rescue '-' %></td>
|
<td><%= crm_customer.card_no rescue '-' %></td>
|
||||||
|
<td><%= crm_customer.paypar_account_no rescue '-' %></td>
|
||||||
<td>
|
<td>
|
||||||
<% if crm_customer.membership_id.nil? && !crm_customer.membership_type.nil? && !crm_customer.membership_type =="" && !crm_customer.paypar_account_no =="" && !crm_customer.paypar_account_no.nil? %>
|
<% if crm_customer.membership_id.nil? && !crm_customer.membership_type.nil? && !crm_customer.membership_type.blank? && !crm_customer.paypar_account_no.blank? && !crm_customer.paypar_account_no.nil? %>
|
||||||
<%= link_to t("views.btn.sync"), crm_customer_sync_path(crm_customer), :class => "btn btn-md bg-green waves-effect" %>
|
<%= link_to t("views.btn.sync"), crm_customer_sync_path(crm_customer), :class => "btn btn-md bg-green waves-effect" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if @customer_update_phone_email_membertype %>
|
<% if @customer_update_phone_email_membertype %>
|
||||||
@@ -138,7 +139,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% if @create_flag %>
|
<% if @create_flag %>
|
||||||
@@ -178,10 +179,10 @@
|
|||||||
|
|
||||||
// QR Code Reader
|
// QR Code Reader
|
||||||
$("#qr_code").on('click', function(e){
|
$("#qr_code").on('click', function(e){
|
||||||
var code = "";
|
var code = "";
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
code=getQRCode();
|
code=getQRCode();
|
||||||
setQRCode(code);
|
setQRCode(code);
|
||||||
},100);
|
},100);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -199,12 +200,12 @@
|
|||||||
/*new customer UI func:*/
|
/*new customer UI func:*/
|
||||||
//Initialize tooltips
|
//Initialize tooltips
|
||||||
$('.nav-tabs > li a[title]').tooltip();
|
$('.nav-tabs > li a[title]').tooltip();
|
||||||
|
|
||||||
//Wizard
|
//Wizard
|
||||||
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
|
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
|
||||||
|
|
||||||
var $target = $(e.target);
|
var $target = $(e.target);
|
||||||
|
|
||||||
if ($target.parent().hasClass('disabled')) {
|
if ($target.parent().hasClass('disabled')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -256,10 +257,10 @@
|
|||||||
url: url,
|
url: url,
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
// Selected for Taxes
|
// Selected for Taxes
|
||||||
var taxes = JSON.stringify(data.tax_profiles);
|
var taxes = JSON.stringify(data.tax_profiles);
|
||||||
var parse_taxes = JSON.parse(taxes);
|
var parse_taxes = JSON.parse(taxes);
|
||||||
$.each(parse_taxes, function(i, value){
|
$.each(parse_taxes, function(i, value){
|
||||||
$("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'});
|
$("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'});
|
||||||
});
|
});
|
||||||
@@ -272,7 +273,7 @@
|
|||||||
$('#customer_salutation').val(data.salutation);
|
$('#customer_salutation').val(data.salutation);
|
||||||
$('#customer_nrc_no').val(data.nrc_no);
|
$('#customer_nrc_no').val(data.nrc_no);
|
||||||
$('#customer_card_no').val(data.card_no);
|
$('#customer_card_no').val(data.card_no);
|
||||||
$('#customer_type').val(data.customer_type);
|
$('#customer_type').val(data.customer_type);
|
||||||
$('#paypar_account_no').val(data.paypar_account_no);
|
$('#paypar_account_no').val(data.paypar_account_no);
|
||||||
$('#customer_address').val(data.address);
|
$('#customer_address').val(data.address);
|
||||||
$('#customer_date_of_birth').val(data.date_of_birth);
|
$('#customer_date_of_birth').val(data.date_of_birth);
|
||||||
|
|||||||
@@ -21,11 +21,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
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
application_path="#{File.expand_path("../..", __FILE__)}"
|
# application_path="#{File.expand_path("../..", __FILE__)}"
|
||||||
directory application_path
|
# directory application_path
|
||||||
#environment ENV.fetch("RAILS_ENV") { "production" }
|
# #environment ENV.fetch("RAILS_ENV") { "production" }
|
||||||
environment "production"
|
# environment "production"
|
||||||
pidfile "#{application_path}/tmp/puma/pid"
|
# pidfile "#{application_path}/tmp/puma/pid"
|
||||||
state_path "#{application_path}/tmp/puma/state"
|
# state_path "#{application_path}/tmp/puma/state"
|
||||||
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
||||||
port ENV.fetch("PORT") { 62158 }
|
# port ENV.fetch("PORT") { 62158 }
|
||||||
workers 2
|
# workers 2
|
||||||
preload_app!
|
# preload_app!
|
||||||
|
|||||||
Reference in New Issue
Block a user