prevent order append to previous sale

This commit is contained in:
Thein Lin Kyaw
2019-10-07 10:43:43 +06:30
parent a61c4a1932
commit 33670b450e
9 changed files with 244 additions and 466 deletions

View File

@@ -108,10 +108,10 @@ class DiningFacility < ApplicationRecord
return booking
elsif (checkout_at_hr == hr && checkout_at_min <= free_time_min)
return booking
else
else
return nil
end
else
else
return nil
end
end
@@ -135,7 +135,7 @@ class DiningFacility < ApplicationRecord
end
end
end
bookings.each do |booking|
now = Time.now.utc
hr = (now.strftime("%H").to_i).to_int
@@ -164,7 +164,7 @@ class DiningFacility < ApplicationRecord
#if ENV["SERVER_MODE"] != 'cloud'
if ENV["SERVER_MODE"] == 'cloud'
from = request.subdomain + "." + request.domain
else
else
from = ""
end
ActionCable.server.broadcast "check_in_booking_channel",table: table,from:from
@@ -176,7 +176,7 @@ class DiningFacility < ApplicationRecord
if table.length > 0
if ENV["SERVER_MODE"] == 'cloud'
from = request.subdomain + "." + request.domain
else
else
from = ""
end
if ENV["SERVER_MODE"] != 'cloud'
@@ -203,5 +203,5 @@ class DiningFacility < ApplicationRecord
end
return status
end
end