From 916dbf2cd37f1c04691cf542047432c5407fd684 Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Mon, 14 May 2018 16:00:31 +0630 Subject: [PATCH 1/4] Pull from master --- app/assets/javascripts/addorder.js | 2 +- .../javascripts/channels/check_new_order.js | 51 ++++++++-------- .../channels/check_order_ready_to_delivery.js | 51 ++++++++-------- .../channels/check_order_send_to_kitchen.js | 51 ++++++++-------- app/assets/javascripts/order_reservation.js | 57 +++++++++--------- app/assets/stylesheets/addorder.scss | 4 ++ app/models/menu.rb | 32 ++++++---- app/views/origami/addorders/detail.html.erb | 2 +- app/views/origami/dashboard/index.html.erb | 16 ++++- app/views/origami/home/show.html.erb | 8 ++- .../origami/order_reservation/index.html.erb | 18 +++--- app/views/origami/payments/show.html.erb | 18 +++--- config/environments/development.rb | 2 +- public/AC-beep.mp3 | Bin 0 -> 63528 bytes 14 files changed, 173 insertions(+), 139 deletions(-) create mode 100644 public/AC-beep.mp3 diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index 344e663b..8b9c4e01 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -1373,7 +1373,7 @@ $(function() { if (JSON.stringify(menu_items[field].item_sets)!='[]') { fa_plus = ''; add = ''; - menu_item_box = 'add_icon'; + menu_item_box = 'set_add_icon'; data_target = 'sx_item_set_detailModal'; data_modal = 'modal' add_icon = "set_item_box" diff --git a/app/assets/javascripts/channels/check_new_order.js b/app/assets/javascripts/channels/check_new_order.js index a6317af6..92e0e715 100644 --- a/app/assets/javascripts/channels/check_new_order.js +++ b/app/assets/javascripts/channels/check_new_order.js @@ -19,33 +19,34 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', { }); // alert(order_lists); - swal({ - title: 'Information', - target: document.getElementById(shop_code+"_notify_new_order"), - text: "You have new orders
"+ - "Are you accept or reject for these orders "+order_lists+"?", - type: 'success', - html: true, - closeOnConfirm: false, - closeOnCancel: false, - allowOutsideClick: false - }, function (isConfirm) { - if(isConfirm){ - swal.close(); - } - }); - // $("#notify_new_order_lists").text(order_lists); + // swal({ + // title: 'Information', + // target: document.getElementById(shop_code+"_notify_new_order"), + // text: "You have new orders
"+ + // "Are you accept or reject for these orders "+order_lists+"?", + // type: 'success', + // html: true, + // closeOnConfirm: false, + // closeOnCancel: false, + // allowOutsideClick: false + // }, function (isConfirm) { + // if(isConfirm){ + // swal.close(); + // } + // }); + $("#notify_new_order_lists").text(order_lists); // if($("#notify_new_order").hasClass("hidden")){ - // $("#notify_new_order").removeClass("hidden"); + $("#notify_new_order").removeClass("hidden"); // } - // $("#notify_new_order").on('show.bs.modal', function(e){ - // $("#notify_order_send_to_kitchen").addClass("hidden"); - // $("#notify_order_ready_to_delivery").addClass("hidden"); - // }).on('shown.bs.modal', function(e){ - // $("#notify_new_order").focus(); - // }).on('hide.bs.modal', function (e) { - // $("#notify_new_order").addClass("hidden"); - // }).modal({show: true, keyboard: false, backdrop: false}); + $("#notify_new_order").on('shown.bs.modal', function(e){ + $(document).off('focusin.modal'); + $("#notify_new_order").focus(); + $("#"+shop_code+"_doemal_new_order").addClass("hidden"); + $("#notify_order_send_to_kitchen").addClass("hidden"); + $("#notify_order_ready_to_delivery").addClass("hidden"); + }).on('hide.bs.modal', function (e) { + $("#notify_new_order").addClass("hidden"); + }).modal({show: true, keyboard: false, backdrop: false}); } } }); diff --git a/app/assets/javascripts/channels/check_order_ready_to_delivery.js b/app/assets/javascripts/channels/check_order_ready_to_delivery.js index 319f7781..05a257b3 100644 --- a/app/assets/javascripts/channels/check_order_ready_to_delivery.js +++ b/app/assets/javascripts/channels/check_order_ready_to_delivery.js @@ -19,33 +19,34 @@ App.check_order_ready_to_delivery = App.cable.subscriptions.create('CheckOrderRe }); // alert(order_lists); - swal({ - title: 'Information', - target: document.getElementById(shop_code+"_notify_order_ready_to_delivery"), - text: "You have orders that are ready to deliver
"+ - "Could you ready these orders "+order_lists+" to deliver?", - type: 'success', - html: true, - closeOnConfirm: false, - closeOnCancel: false, - allowOutsideClick: false - }, function (isConfirm) { - if(isConfirm){ - swal.close(); - } - }); - // $("#notify_order_ready_to_delivery_lists").text(order_lists); + // swal({ + // title: 'Information', + // target: document.getElementById(shop_code+"_notify_order_ready_to_delivery"), + // text: "You have orders that are ready to deliver
"+ + // "Could you ready these orders "+order_lists+" to deliver?", + // type: 'success', + // html: true, + // closeOnConfirm: false, + // closeOnCancel: false, + // allowOutsideClick: false + // }, function (isConfirm) { + // if(isConfirm){ + // swal.close(); + // } + // }); + $("#notify_order_ready_to_delivery_lists").text(order_lists); // if($("#notify_order_ready_to_delivery").hasClass("hidden")){ - // $("#notify_order_ready_to_delivery").removeClass("hidden"); + $("#notify_order_ready_to_delivery").removeClass("hidden"); // } - // $("#notify_order_ready_to_delivery").on('shown.bs.modal', function(e){ - // $("#notify_new_order").addClass("hidden"); - // $("#notify_order_send_to_kitchen").addClass("hidden"); - // }).on('shown.bs.modal', function(e){ - // $("#notify_order_ready_to_delivery").focus(); - // }).on('hide.bs.modal', function (e) { - // $("#notify_order_ready_to_delivery").addClass("hidden"); - // }).modal({show: true, keyboard: false, backdrop: false}); + $("#notify_order_ready_to_delivery").on('shown.bs.modal', function(e){ + // $(document).off('focusin.modal'); + $("#notify_order_ready_to_delivery").focus(); + $("#"+shop_code+"_doemal_new_order").addClass("hidden"); + $("#notify_new_order").addClass("hidden"); + $("#notify_order_send_to_kitchen").addClass("hidden"); + }).on('hide.bs.modal', function (e) { + $("#notify_order_ready_to_delivery").addClass("hidden"); + }).modal({show: true, keyboard: false, backdrop: false}); } } }); diff --git a/app/assets/javascripts/channels/check_order_send_to_kitchen.js b/app/assets/javascripts/channels/check_order_send_to_kitchen.js index df9eb324..f9432810 100644 --- a/app/assets/javascripts/channels/check_order_send_to_kitchen.js +++ b/app/assets/javascripts/channels/check_order_send_to_kitchen.js @@ -19,33 +19,34 @@ App.check_order_send_to_kitchen = App.cable.subscriptions.create('CheckOrderSend }); // alert(order_lists); - swal({ - title: 'Information', - target: document.getElementById(shop_code+"_notify_order_send_to_kitchen"), - text: "You have to send order to kitchen
"+ - "Could you send these orders "+order_lists+" to kitchen?", - type: 'success', - html: true, - closeOnConfirm: false, - closeOnCancel: false, - allowOutsideClick: false - }, function (isConfirm) { - if(isConfirm){ - swal.close(); - } - }); - // $("#notify_order_send_to_kitchen_lists").text(order_lists); + // swal({ + // title: 'Information', + // target: document.getElementById(shop_code+"_notify_order_send_to_kitchen"), + // text: "You have to send order to kitchen
"+ + // "Could you send these orders "+order_lists+" to kitchen?", + // type: 'success', + // html: true, + // closeOnConfirm: false, + // closeOnCancel: false, + // allowOutsideClick: false + // }, function (isConfirm) { + // if(isConfirm){ + // swal.close(); + // } + // }); + $("#notify_order_send_to_kitchen_lists").text(order_lists); // if($("#notify_order_send_to_kitchen").hasClass("hidden")){ - // $("#notify_order_send_to_kitchen").removeClass("hidden"); + $("#notify_order_send_to_kitchen").removeClass("hidden"); // } - // $("#notify_order_send_to_kitchen").on('show.bs.modal', function(e){ - // $("#notify_new_order").addClass("hidden"); - // $("#notify_order_ready_to_delivery").addClass("hidden"); - // }).on('shown.bs.modal', function(e){ - // $("#notify_order_send_to_kitchen").focus(); - // }).on('hide.bs.modal', function (e) { - // $("#notify_order_send_to_kitchen").addClass("hidden"); - // }).modal({show: true, keyboard: false, backdrop: false}); + $("#notify_order_send_to_kitchen").on('shown.bs.modal', function(e){ + // $(document).off('focusin.modal'); + $("#notify_order_send_to_kitchen").focus(); + $("#"+shop_code+"_doemal_new_order").addClass("hidden"); + $("#notify_new_order").addClass("hidden"); + $("#notify_order_ready_to_delivery").addClass("hidden"); + }).on('hide.bs.modal', function (e) { + $("#notify_order_send_to_kitchen").addClass("hidden"); + }).modal({show: true, keyboard: false, backdrop: false}); } } }); diff --git a/app/assets/javascripts/order_reservation.js b/app/assets/javascripts/order_reservation.js index 83618770..d674926a 100644 --- a/app/assets/javascripts/order_reservation.js +++ b/app/assets/javascripts/order_reservation.js @@ -157,6 +157,7 @@ $(function() { } }); + // $('button[data-dismiss="modal"]').on('click', function(){ $(this).parent().parent().parent().parent().modal('hide'); }); // $(".new_order_close").on("click",function(){ @@ -473,36 +474,36 @@ function showNewOrder(order_reservation,shop_code){ audio.play(); // },10000); - // $("#new_order").text(order_reservation.order_reservation_id); - // $("#new_order_date").text(requested_date); + $("#new_order").text(order_reservation.order_reservation_id); + $("#new_order_date").text(requested_date); // if($("#"+shop_code+"_doemal_new_order").hasClass("hidden")){ - // $("#"+shop_code+"_doemal_new_order").removeClass("hidden"); + $("#"+shop_code+"_doemal_new_order").removeClass("hidden"); // } - // $("#"+shop_code+"_doemal_new_order").on('show.bs.modal', function(e){ - // $("#notify_new_order").addClass("hidden"); - // $("#notify_order_send_to_kitchen").addClass("hidden"); - // $("#notify_order_ready_to_delivery").addClass("hidden"); - // }).on('shown.bs.modal', function(e){ - // $("#"+shop_code+"_doemal_new_order").focus(); - // }).on('hide.bs.modal', function (e) { - // $("#"+shop_code+"_doemal_new_order").addClass("hidden"); - // }).modal({show: true, keyboard: false, backdrop: false}); - swal({ - title: 'Information', - target: document.getElementById(shop_code+"_notify_new_order"), - text: "You have new order "+ - ""+order_reservation.order_reservation_id+" requested for "+requested_date+"?", - type: 'success', - html: true, - closeOnConfirm: false, - closeOnCancel: false, - allowOutsideClick: false - }, function (isConfirm) { - if(isConfirm){ - audio.pause(); - swal.close(); - } - }); + $("#"+shop_code+"_doemal_new_order").on('shown.bs.modal', function(e){ + // $(document).off('focusin.modal'); + $("#"+shop_code+"_doemal_new_order").focus(); + $("#notify_new_order").addClass("hidden"); + $("#notify_order_send_to_kitchen").addClass("hidden"); + $("#notify_order_ready_to_delivery").addClass("hidden"); + }).on('hide.bs.modal', function (e) { + $("#"+shop_code+"_doemal_new_order").addClass("hidden"); + }).modal({show: true, keyboard: false, backdrop: false}); + // swal({ + // title: 'Information', + // target: document.getElementById(shop_code+"_notify_new_order"), + // text: "You have new order "+ + // ""+order_reservation.order_reservation_id+" requested for "+requested_date+"?", + // type: 'success', + // html: true, + // closeOnConfirm: false, + // closeOnCancel: false, + // allowOutsideClick: false + // }, function (isConfirm) { + // if(isConfirm){ + // audio.pause(); + // swal.close(); + // } + // }); } } diff --git a/app/assets/stylesheets/addorder.scss b/app/assets/stylesheets/addorder.scss index ba1089d2..d9b62131 100755 --- a/app/assets/stylesheets/addorder.scss +++ b/app/assets/stylesheets/addorder.scss @@ -270,4 +270,8 @@ i.logout_icon{ .border-left{ border-left:1px solid #fff; +} + +.set_add_icon{ + display:none; } \ No newline at end of file diff --git a/app/models/menu.rb b/app/models/menu.rb index 60200aeb..a9b88a85 100755 --- a/app/models/menu.rb +++ b/app/models/menu.rb @@ -155,24 +155,28 @@ class Menu < ApplicationRecord # Menu Item Attributes item_attrs = [] - attributes = row["Attributes"].split(',') - attributes.each do |attr| - attribute = MenuItemAttribute.find_by_name(attr) - if attribute.nil? - attribute = MenuItemAttribute.create({ attribute_type:"any", name: attr.capitalize, value: attr.downcase }) + if !row["Attributes"].nil? + attributes = row["Attributes"].split(',') + attributes.each do |attr| + attribute = MenuItemAttribute.find_by_name(attr) + if attribute.nil? + attribute = MenuItemAttribute.create({ attribute_type:"any", name: attr.capitalize, value: attr.downcase }) + end + item_attrs.push(attribute.id) end - item_attrs.push(attribute.id) end # Menu Item Options item_opts = [] + if !row["Options"].nil? options = row["Options"].split(',') - options.each do |opt| - option = MenuItemOption.find_by_name(opt) - if option.nil? - option = MenuItemOption.create({ option_type:"any", name: opt.capitalize, value: opt.downcase }) + options.each do |opt| + option = MenuItemOption.find_by_name(opt) + if option.nil? + option = MenuItemOption.create({ option_type:"any", name: opt.capitalize, value: opt.downcase }) + end + item_opts.push(option.id) end - item_opts.push(option.id) end menu_itm = MenuItem.find_by_item_code(row["Item Code"]) @@ -189,7 +193,11 @@ class Menu < ApplicationRecord menu_inst = MenuItemInstance.find_by_item_instance_code(row["Instance Code"]) if !menu_inst - imported_instance = MenuItemInstance.create(menu_item_id: menu_itm.id, item_instance_code: row["Instance Code"], item_instance_name: row["Instance Name"], item_attributes: [], price: row["Price"], is_on_promotion: false, promotion_price: 0, is_available: true, is_default: row["Is Default"]) + instance_name = '' + if !row["Instance Name"].nil? + instance_name = row["Instance Name"] + end + imported_instance = MenuItemInstance.create(menu_item_id: menu_itm.id, item_instance_code: row["Instance Code"], item_instance_name: instance_name, item_attributes: [], price: row["Price"], is_on_promotion: false, promotion_price: 0, is_available: true, is_default: row["Is Default"]) # else # status = status + "Instance Code already exists for " + row["Instance Name"] + "." end diff --git a/app/views/origami/addorders/detail.html.erb b/app/views/origami/addorders/detail.html.erb index 391ba83b..65ea665b 100644 --- a/app/views/origami/addorders/detail.html.erb +++ b/app/views/origami/addorders/detail.html.erb @@ -17,7 +17,7 @@ <%if @menu.present? %> - <%=menu[0].name%> + <%=@menus[0].name%> <% end%> diff --git a/app/views/origami/dashboard/index.html.erb b/app/views/origami/dashboard/index.html.erb index 4712a481..a0b0dc51 100644 --- a/app/views/origami/dashboard/index.html.erb +++ b/app/views/origami/dashboard/index.html.erb @@ -1,4 +1,7 @@
+

<%= t :date_time %> : <%= Time.zone.now.utc.getlocal.strftime("%Y-%m-%d %I:%M %p") %>

@@ -208,23 +211,32 @@ " id="server_mode"> \ No newline at end of file From 610d39847e71702062242913df85490c66be2ddf Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Fri, 18 May 2018 16:23:14 +0630 Subject: [PATCH 3/4] Add Approved By for waste & Spolie in Receive --- app/pdf/receipt_bill_pdf.rb | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 5c1f8c01..7dc29463 100755 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -532,7 +532,7 @@ class ReceiptBillPdf < Prawn::Document break; end end - if sale_data.payment_status == "foc" + if sale_data.payment_status == "foc" || sale_data.payment_status == "waste" || sale_data.payment_status == "spoile" y_position = cursor stroke_horizontal_rule @@ -540,12 +540,19 @@ class ReceiptBillPdf < Prawn::Document bounding_box([self.label_width,y_position], :width =>self.item_description_width) do move_down 70 stroke_horizontal_rule - end + end - bounding_box([self.label_width,y_position], :width =>self.item_description_width) do - move_down 73 - text "Acknowledged By" , :size => self.item_font_size,:align => :center - end + if sale_data.payment_status == "foc" + bounding_box([self.label_width,y_position], :width =>self.item_description_width) do + move_down 73 + text "Acknowledged By" , :size => self.item_font_size,:align => :center + end + elsif sale_data.payment_status == "waste" || sale_data.payment_status == "spoile" + bounding_box([self.label_width,y_position], :width =>self.item_description_width) do + move_down 73 + text "Approved By" , :size => self.item_font_size,:align => :center + end + end end end From c1525be8260a397b08899fe14fcfc6757885901b Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Fri, 18 May 2018 16:26:03 +0630 Subject: [PATCH 4/4] Pull from master --- app/assets/javascripts/addorder.js | 12 +++++----- app/assets/javascripts/cable.js | 2 +- app/assets/javascripts/channels/bill.js | 22 +++++++++++-------- app/assets/javascripts/channels/order.js | 2 -- app/channels/application_cable/connection.rb | 20 +++++++++++++++++ app/channels/order_channel.rb | 2 +- .../origami/request_bills_controller.rb | 11 ++++++---- app/models/menu_category.rb | 2 +- app/models/menu_item.rb | 2 +- app/models/order.rb | 4 ++-- app/models/order_queue_station.rb | 1 + config/initializers/action_controller.rb | 10 ++++----- 12 files changed, 58 insertions(+), 32 deletions(-) diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index 8b9c4e01..611ffb17 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -58,8 +58,8 @@ $(function() { row = '
' +'
' - +'
'+ product[field].name +'
' - +"' + +"' +'
' @@ -1430,8 +1430,8 @@ $(function() { row = '
' +'
' - +'
'+ menu_items[field].name +'
' - +"
'+ menu_items[field].name +'
' + +"
" - +"" + +"" +add+ '' +'
' +'
' diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js index 55bfd46b..1668e17f 100755 --- a/app/assets/javascripts/cable.js +++ b/app/assets/javascripts/cable.js @@ -8,7 +8,7 @@ // Temp Disable (function() { this.App || (this.App = {}); - + App.cable = ActionCable.createConsumer(); }).call(this); diff --git a/app/assets/javascripts/channels/bill.js b/app/assets/javascripts/channels/bill.js index 97666e32..7fa2b77e 100755 --- a/app/assets/javascripts/channels/bill.js +++ b/app/assets/javascripts/channels/bill.js @@ -6,15 +6,19 @@ App.order = App.cable.subscriptions.create('BillChannel', { disconnected: function() {}, received: function(data) { - if($('.table_'+data.table.id).hasClass('blue')){ - $('.table_'+data.table.id).removeClass('blue'); - $('.table_'+data.table.id).addClass('red'); - }else{ - $('.table_'+data.table.id).removeClass('orange'); - $('.table_'+data.table.id).addClass('red'); - } - $('.new_text_'+data.table.id).removeClass('hide'); - $('.new_text_'+data.table.id).text('billed'); + var hostname = location.hostname.trim(); + if(data.from == "" || hostname == data.from) + { + if($('.table_'+data.table.id).hasClass('blue')){ + $('.table_'+data.table.id).removeClass('blue'); + $('.table_'+data.table.id).addClass('red'); + }else{ + $('.table_'+data.table.id).removeClass('orange'); + $('.table_'+data.table.id).addClass('red'); + } + $('.new_text_'+data.table.id).removeClass('hide'); + $('.new_text_'+data.table.id).text('billed'); + } } }); diff --git a/app/assets/javascripts/channels/order.js b/app/assets/javascripts/channels/order.js index 9598ed6f..26c7897e 100755 --- a/app/assets/javascripts/channels/order.js +++ b/app/assets/javascripts/channels/order.js @@ -1,6 +1,4 @@ App.order = App.cable.subscriptions.create('OrderChannel', { -// App.messages = App.cable.subscriptions.create('MessagesChannel', { - connected: function() {}, disconnected: function() {}, diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb index 4efdb70d..14561a4e 100755 --- a/app/channels/application_cable/connection.rb +++ b/app/channels/application_cable/connection.rb @@ -1,7 +1,27 @@ module ApplicationCable class Connection < ActionCable::Connection::Base + identified_by :current_subdomain def connect + if ENV["server_mode"] == "cloud" + self.current_subdomain = verified_subdomain + end logger.add_tags "SX-ActionCable" 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 diff --git a/app/channels/order_channel.rb b/app/channels/order_channel.rb index d261e48b..6f899707 100755 --- a/app/channels/order_channel.rb +++ b/app/channels/order_channel.rb @@ -1,5 +1,5 @@ class OrderChannel < ApplicationCable::Channel - def subscribed + def subscribed stream_from "order_channel" end diff --git a/app/controllers/origami/request_bills_controller.rb b/app/controllers/origami/request_bills_controller.rb index 0c50a5da..3d2c90aa 100755 --- a/app/controllers/origami/request_bills_controller.rb +++ b/app/controllers/origami/request_bills_controller.rb @@ -38,10 +38,13 @@ class Origami::RequestBillsController < ApplicationController # Promotion Activation Promotion.promo_activate(@sale) - #bill channel - #if ENV["SERVER_MODE"] != 'cloud' - ActionCable.server.broadcast "bill_channel",table: table - #end + #bill channel + if ENV["SERVER_MODE"] == 'cloud' + from = request.subdomain + "." + request.domain + else + from = "" + end + ActionCable.server.broadcast "bill_channel",table: table, from: from if order.source == "quick_service" result = {:status=> @status, :data => @sale.sale_id } render :json => result.to_json diff --git a/app/models/menu_category.rb b/app/models/menu_category.rb index 218bacb8..21d95770 100755 --- a/app/models/menu_category.rb +++ b/app/models/menu_category.rb @@ -9,7 +9,7 @@ class MenuCategory < ApplicationRecord validates_presence_of :code, :name, :menu, :order_by validates_uniqueness_of :code - default_scope { order('order_by asc') } + default_scope { order('name asc') } scope :active, -> {where("is_available = 1")} def self.destroyCategory(menu_category) diff --git a/app/models/menu_item.rb b/app/models/menu_item.rb index 03e90011..e184cd51 100755 --- a/app/models/menu_item.rb +++ b/app/models/menu_item.rb @@ -16,7 +16,7 @@ class MenuItem < ApplicationRecord validates_presence_of :item_code, :name, :type, :min_qty,:account_id validates_uniqueness_of :item_code - default_scope { order('item_code asc') } + default_scope { order('name asc') } scope :simple_menu_item, -> { where(type: 'SimpleMenuItem') } scope :set_menu_item, -> { where(type: 'SetMenuItem') } diff --git a/app/models/order.rb b/app/models/order.rb index 66ac883f..8a0e52b3 100755 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -71,9 +71,9 @@ class Order < ApplicationRecord BookingOrder.create({:booking_id => booking.booking_id, :order => self}) #Send order to queue one it done! - # if self.source != "quick_service" + if self.source != "quick_service" process_order_queue - # end + end #send order to broadcast job send_order_broadcast(booking) diff --git a/app/models/order_queue_station.rb b/app/models/order_queue_station.rb index 1541828c..70b28c1f 100755 --- a/app/models/order_queue_station.rb +++ b/app/models/order_queue_station.rb @@ -116,6 +116,7 @@ class OrderQueueStation < ApplicationRecord order = Order.find(order_id) order_items = order.order_items + Order.pay_process_order_queue(order_id,table_id) if table_id.to_i > 0 # get dining dining = DiningFacility.find(table_id) diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index e0eb7455..b84bca54 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -20,11 +20,11 @@ class ActionController::Base end else #check for license file - if check_license - current_license(ENV["SX_PROVISION_URL"]) - else - redirect_to activate_path - end + # if check_license + # current_license(ENV["SX_PROVISION_URL"]) + # else + # redirect_to activate_path + # end end end