change dynamic checkin checkout

This commit is contained in:
phyusin
2018-11-20 18:10:48 +06:30
parent cd33da68fa
commit d641a09d41
5 changed files with 155 additions and 51 deletions

View File

@@ -165,7 +165,9 @@ class Sale < ApplicationRecord
booking.sale_id = self.id
if !booking.checkout_at.nil?
if Time.parse(booking.checkout_at).utc < Time.now.utc
booking.checkout_at = Time.now.utc.getlocal
end
else
booking.checkout_at = Time.now.utc.getlocal
end