add to existing
This commit is contained in:
@@ -29,11 +29,8 @@ class Origami::SalesController < BaseOrigamiController
|
|||||||
sale_data = []
|
sale_data = []
|
||||||
table = DiningFacility.find(dining)
|
table = DiningFacility.find(dining)
|
||||||
existing_booking = Booking.find_by_sale_id(sale_id)
|
existing_booking = Booking.find_by_sale_id(sale_id)
|
||||||
table.bookings.active.where("DATE_FORMAT(created_at,'%Y-%m-%d') = '#{DateTime.now.strftime('%Y-%m-%d')}' OR DATE_FORMAT(created_at,'%Y-%m-%d') = '#{Date.today.prev_day}' ").each do |booking|
|
table.bookings.active.where("DATE_FORMAT(created_at,'%Y-%m-%d') = '#{DateTime.now.strftime('%Y-%m-%d')}' OR DATE_FORMAT(created_at,'%Y-%m-%d') = '#{Date.today.prev_day}' ").each do |booking|
|
||||||
# if !booking.checkout_at.nil?
|
if booking.sale_id.nil?
|
||||||
# existing_booking.update_attributes(checkout_at: checkout_at)
|
|
||||||
# end
|
|
||||||
if booking.sale_id.nil?
|
|
||||||
order_array = []
|
order_array = []
|
||||||
booking.booking_orders.each do |booking_order|
|
booking.booking_orders.each do |booking_order|
|
||||||
|
|
||||||
@@ -60,8 +57,7 @@ class Origami::SalesController < BaseOrigamiController
|
|||||||
booking.save
|
booking.save
|
||||||
|
|
||||||
order_array.push(order.order_id)
|
order_array.push(order.order_id)
|
||||||
|
end
|
||||||
end
|
|
||||||
|
|
||||||
receipt_no = Sale.find(sale_id).receipt_no
|
receipt_no = Sale.find(sale_id).receipt_no
|
||||||
action_by = current_user.name
|
action_by = current_user.name
|
||||||
@@ -77,10 +73,6 @@ class Origami::SalesController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# if !sale_data.empty?
|
|
||||||
# InventoryJob.perform_now(self.id)
|
|
||||||
# InventoryDefinition.calculate_product_count(nil,sale_data)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user