fix dining charges for room

This commit is contained in:
Yan
2017-11-09 11:51:49 +06:30
parent 845adf7d19
commit 66ae94c3e2
3 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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