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

@@ -57,13 +57,12 @@ class Order < ApplicationRecord
if self.is_extra_time
if !booking.checkout_at.nil?
new_time = booking.checkout_at + self.extra_time.to_i
booking.update_attributes(checkout_at: new_time)
booking.update(checkout_at: new_time)
end
end
#end extra time
end
booking.save!
self.default_values
# cashier already opened?
@@ -211,7 +210,6 @@ class Order < ApplicationRecord
self.customer = Customer.find(1) if self.customer_id.nil?
self.source = "emenu" if self.source.nil?
self.order_type = "dine-in" if self.order_type.nil?
end
protected