From 2faf5ba3860b985cbb4d0b21283735719091dfee Mon Sep 17 00:00:00 2001 From: phyusin Date: Fri, 8 Dec 2017 10:40:57 +0630 Subject: [PATCH] change checkout fun: in UI --- app/models/dining_facility.rb | 4 ++-- app/views/origami/home/index.html.erb | 4 ++-- app/views/origami/home/show.html.erb | 4 ++-- app/views/origami/rooms/show.html.erb | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/models/dining_facility.rb b/app/models/dining_facility.rb index 1b0f3fbe..15a83de7 100755 --- a/app/models/dining_facility.rb +++ b/app/models/dining_facility.rb @@ -82,10 +82,10 @@ class DiningFacility < ApplicationRecord hr = (now.strftime("%H").to_i).to_int min = (now.strftime("%M").to_i).to_int if !booking.checkout_at.nil? - checkout_at = booking.checkout_at.utc + checkout_at = booking.checkout_at.utc checkout_at_hr = (checkout_at.utc.strftime("%H").to_i).to_int checkout_at_min = (checkout_at.utc.strftime("%M").to_i).to_int - checkout_at_min -= min + # checkout_at_min -= min if (checkout_at_hr <= hr) && (checkout_at_min <= 15) return booking else diff --git a/app/views/origami/home/index.html.erb b/app/views/origami/home/index.html.erb index 346a1fce..939b969a 100755 --- a/app/views/origami/home/index.html.erb +++ b/app/views/origami/home/index.html.erb @@ -41,7 +41,7 @@ <% @tables.each do |table| %> <% if table.status == 'occupied' %> <% if table.get_booking.nil? %> - <% if table.get_current_checkout_booking.nil? %> + <% if table.get_checkout_booking.nil? %>
<% else %>
@@ -52,7 +52,7 @@
<% else %> - <% if table.get_current_checkout_booking.nil? %> + <% if table.get_checkout_booking.nil? %>
<% else %>
diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index df38a590..780ace0b 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -40,7 +40,7 @@ <% @tables.each do |table| %> <% if table.status == 'occupied' %> <% if table.get_booking.nil? %> - <% if table.get_current_checkout_booking.nil? %> + <% if table.get_checkout_booking.nil? %>
<% else %>
@@ -52,7 +52,7 @@
<% else %> - <% if table.get_current_checkout_booking.nil? %> + <% if table.get_checkout_booking.nil? %>
<% else %>
diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index cbf43601..0b65eae4 100755 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -40,7 +40,7 @@ <% @tables.each do |table| %> <% if table.status == 'occupied' %> <% if table.get_booking.nil? %> - <% if table.get_current_checkout_booking.nil? %> + <% if table.get_checkout_booking.nil? %>
<% else %>
@@ -51,7 +51,7 @@
<% else %> - <% if table.get_current_checkout_booking.nil? %> + <% if table.get_checkout_booking.nil? %>
<% else %>