From 66ae94c3e25bce7e29a5d2ad7b87e229ccbe564d Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 9 Nov 2017 11:51:49 +0630 Subject: [PATCH] fix dining charges for room --- app/controllers/application_controller.rb | 4 ++-- app/controllers/settings/dining_charges_controller.rb | 2 +- app/models/dining_charge.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 949276cd..ce00dda9 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception # lookup domain for db from provision - before_action :lookup_domain, :set_locale + before_action :lookup_domain, :set_locale helper_method :current_company,:current_login_employee,:current_user # alias_method :current_user, :current_login_employee,:current_user @@ -93,7 +93,7 @@ class ApplicationController < ActionController::Base end private - def check_installation + def check_license if current_company.nil? redirect_to install_path end diff --git a/app/controllers/settings/dining_charges_controller.rb b/app/controllers/settings/dining_charges_controller.rb index 763f5086..0f71d85c 100755 --- a/app/controllers/settings/dining_charges_controller.rb +++ b/app/controllers/settings/dining_charges_controller.rb @@ -62,7 +62,7 @@ class Settings::DiningChargesController < ApplicationController if @table format.html { redirect_to settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully updated.' } else - format.html { redirect_to settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully updated.' } + format.html { redirect_to settings_zone_room_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully updated.' } end format.json { render :show, status: :ok, location: @dining_charge } else diff --git a/app/models/dining_charge.rb b/app/models/dining_charge.rb index 2d687850..6eddbad4 100755 --- a/app/models/dining_charge.rb +++ b/app/models/dining_charge.rb @@ -35,7 +35,7 @@ class DiningCharge < ApplicationRecord result = dining_minutes / charge_block if result.to_i < 1 # for dining minute is under charge_block - return result.to_i,chargesObj.unit_price + return 1, result.to_i,chargesObj.unit_price elsif result.to_i >= 1 solid_price = result * chargesObj.unit_price