diff --git a/app/controllers/api/sound_effect_controller.rb b/app/controllers/api/sound_effect_controller.rb index e53e69b9..97dc3db5 100644 --- a/app/controllers/api/sound_effect_controller.rb +++ b/app/controllers/api/sound_effect_controller.rb @@ -22,7 +22,7 @@ class Api::SoundEffectController < Api::ApiController end ActionCable.server.broadcast "sound_effect_channel",data: {status: params[:status], message: params[:message]},shop_code: shop_code,from:from,audio:audio else - render :json => { :status => true, :message => "Something wrongs!" } + render :json => { :status => false, :message => "Something wrongs!" } end end #sound effect / alarm api for doemal side calling diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 330c5c1f..13de03e6 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base #before_action :check_installation protect_from_forgery with: :exception - helper_method :shop_detail + helper_method :shop_detail, :order_reservation, :bank_integration # lookup domain for db from provision # before_action :set_locale # helper_method :current_company,:current_login_employee,:current_user diff --git a/app/controllers/concerns/login_verification.rb b/app/controllers/concerns/login_verification.rb index 590fdcbc..78864e34 100755 --- a/app/controllers/concerns/login_verification.rb +++ b/app/controllers/concerns/login_verification.rb @@ -3,7 +3,7 @@ module LoginVerification included do before_action :authenticate_session_token - helper_method :current_company, :current_login_employee, :current_user, :get_cashier + helper_method :current_company, :current_login_employee, :current_user, :get_cashier, :order_reservation, :bank_integration end #this is base api base controller to need to inherit. @@ -30,6 +30,38 @@ module LoginVerification @cashier = Employee.where("role = 'cashier' AND token_session <> ''") end + #check order reservation used + def order_reservation + order_reserve = Lookup.collection_of('order_reservation') + status = false + if !order_reserve.empty? + order_reserve.each do |order| + if order[0] == 'OrderReservation' + if order[1] == '1' + status = true + end + end + end + end + return status + end + + #check bank integration used + def bank_integration + bank_integration = Lookup.collection_of('bank_integration') + status = false + if !bank_integration.empty? + bank_integration.each do |bank| + if bank[0] == 'Bank Integration' + if bank[1] == '1' + status = true + end + end + end + end + return status + end + protected # Authenticate the user with token based authentication def authenticate diff --git a/app/views/layouts/_left_sidebar.html.erb b/app/views/layouts/_left_sidebar.html.erb index a4340f0e..69021cc2 100644 --- a/app/views/layouts/_left_sidebar.html.erb +++ b/app/views/layouts/_left_sidebar.html.erb @@ -119,9 +119,11 @@ <% end %> <% if can? :manage, OrderReservation %> -
  • - <%= t("views.right_panel.detail.order_reservation") %> -
  • + <% if order_reservation %> +
  • + <%= t("views.right_panel.detail.order_reservation") %> +
  • + <% end %> <% end %> @@ -141,9 +143,11 @@
  • Product Sale
  • + <% if order_reservation %>
  • - Order Reservation + <%= t("views.right_panel.detail.order_reservation") %>
  • + <% end %>
  • Receipt