check table status for late data and check pending showing when there is no item in origami
This commit is contained in:
@@ -369,6 +369,7 @@ class SalePayment < ApplicationRecord
|
||||
def table_update_status(sale_obj)
|
||||
status = true
|
||||
booking = Booking.find_by_sale_id(sale_obj.id)
|
||||
|
||||
if booking
|
||||
table = DiningFacility.find(booking.dining_facility_id)
|
||||
bookings = table.bookings
|
||||
@@ -377,12 +378,15 @@ class SalePayment < ApplicationRecord
|
||||
if tablebooking.sale_id
|
||||
if tablebooking.sale.sale_status != 'completed' && tablebooking.sale.sale_status != 'void'
|
||||
status = false
|
||||
else
|
||||
status = true
|
||||
end
|
||||
else
|
||||
status = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if status
|
||||
table.status = "available"
|
||||
table.save
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
end
|
||||
|
||||
if @status_order == 'order' && @status_sale != 'sale'
|
||||
unless @order_items.nil?
|
||||
unless @order_items.nil? || @order_items.empty?
|
||||
count = 0
|
||||
@order_items.each do |order_item|
|
||||
count += 1
|
||||
@@ -306,7 +306,7 @@
|
||||
|
||||
<%
|
||||
if @status_sale == 'sale'
|
||||
unless @order_items.nil?
|
||||
unless @order_items.nil? || @order_items.empty?
|
||||
%>
|
||||
Pending New Order
|
||||
<table class="table table-striped">
|
||||
|
||||
Reference in New Issue
Block a user