diff --git a/app/models/dining_facility.rb b/app/models/dining_facility.rb index 15a83de7..8fdeef6c 100755 --- a/app/models/dining_facility.rb +++ b/app/models/dining_facility.rb @@ -67,7 +67,7 @@ class DiningFacility < ApplicationRecord end def get_current_checkout_booking - booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and reserved_by is not null").limit(1) + booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and reserved_by is not null and checkout_by is null").limit(1) if booking.count > 0 then return booking[0] else diff --git a/app/views/reports/credit_payment/index.html.erb b/app/views/reports/credit_payment/index.html.erb index 4e1432bf..9037f03b 100755 --- a/app/views/reports/credit_payment/index.html.erb +++ b/app/views/reports/credit_payment/index.html.erb @@ -65,7 +65,7 @@ $(function(){ var check_arr = []; - + search_by_period(); $('#sel_period').change(function(){ search_by_period(); diff --git a/app/views/reports/payment_method/index.html.erb b/app/views/reports/payment_method/index.html.erb index 9170a31b..2407e50a 100755 --- a/app/views/reports/payment_method/index.html.erb +++ b/app/views/reports/payment_method/index.html.erb @@ -133,7 +133,7 @@