update zone json
This commit is contained in:
@@ -20,7 +20,7 @@ class Origami::HomeController < BaseOrigamiController
|
||||
@tables = Table.unscoped.all.active.order('status desc')
|
||||
@rooms = Room.unscoped.all.active.order('status desc')
|
||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||
@orders = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
@orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
|
||||
@status_order = ""
|
||||
@status_sale = ""
|
||||
|
||||
@@ -179,14 +179,5 @@ class DiningFacility < ApplicationRecord
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def get_current_booking_status
|
||||
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}'").limit(1) #and checkout_at is null
|
||||
if booking.count > 0 then
|
||||
return booking[0]
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@ if @zones
|
||||
#List all tables
|
||||
json.tables zone.tables do |table|
|
||||
if table.is_active
|
||||
booking = table.get_current_booking_status
|
||||
booking = table.get_current_booking
|
||||
json.id table.id
|
||||
json.name table.name
|
||||
json.status table.status
|
||||
@@ -18,7 +18,7 @@ if @zones
|
||||
|
||||
json.rooms zone.rooms do |room|
|
||||
if room.is_active
|
||||
booking = room.get_current_booking_status
|
||||
booking = room.get_current_booking
|
||||
json.id room.id
|
||||
json.name room.name
|
||||
json.status room.status
|
||||
@@ -32,7 +32,7 @@ if @zones
|
||||
else #list all tables and rooms with out zones
|
||||
json.tables @all_tables do |table|
|
||||
if table.is_active
|
||||
booking = table.get_current_booking_status
|
||||
booking = table.get_current_booking
|
||||
json.id table.id
|
||||
json.name table.name
|
||||
json.status table.status
|
||||
@@ -44,7 +44,7 @@ else #list all tables and rooms with out zones
|
||||
|
||||
json.rooms @all_rooms do |room|
|
||||
if room.is_active
|
||||
booking = room.get_current_booking_status
|
||||
booking = room.get_current_booking
|
||||
json.id room.id
|
||||
json.name room.name
|
||||
json.status room.status
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
<div class="card-block">
|
||||
<%
|
||||
order_status = ""
|
||||
sale_order = SaleOrder.find_by_order_id(order)
|
||||
sale_order = order.sale_orders.first
|
||||
if sale_order
|
||||
unless sale_order.sale_id.nil?
|
||||
sale = Sale.find(sale_order.sale_id)
|
||||
|
||||
Reference in New Issue
Block a user