order
This commit is contained in:
@@ -36,8 +36,8 @@ class Api::OrdersController < Api::ApiController
|
|||||||
|
|
||||||
#Create Table Booking or Room Booking
|
#Create Table Booking or Room Booking
|
||||||
if !params["booking_id"].nil? && params[:booking_id].to_i > 0
|
if !params["booking_id"].nil? && params[:booking_id].to_i > 0
|
||||||
@order.new_booking = false
|
#@order.new_booking = false
|
||||||
# @order.new_booking = true
|
@order.new_booking = true
|
||||||
@order.booking_id = params[:booking_id]
|
@order.booking_id = params[:booking_id]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class Order < ApplicationRecord
|
|||||||
# option_values : [],
|
# option_values : [],
|
||||||
# sub_order_items : [],
|
# sub_order_items : [],
|
||||||
# }
|
# }
|
||||||
|
|
||||||
def generate
|
def generate
|
||||||
booking = nil
|
booking = nil
|
||||||
|
|
||||||
@@ -200,7 +201,7 @@ class Order < ApplicationRecord
|
|||||||
|
|
||||||
#Process order items and send to order queue
|
#Process order items and send to order queue
|
||||||
def process_order_queue
|
def process_order_queue
|
||||||
#Send to background job for processing
|
#Send to background job for processing
|
||||||
OrderQueueProcessorJob.perform_later(self.id)
|
OrderQueueProcessorJob.perform_later(self.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -220,7 +221,7 @@ class Order < ApplicationRecord
|
|||||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||||
left join order_items on order_items.order_id = orders.id")
|
left join order_items on order_items.order_id = orders.id")
|
||||||
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,"dine_in",true)
|
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,"dine_in",true)
|
||||||
.group("orders.id")
|
.group("orders.id")
|
||||||
end
|
end
|
||||||
#Origami: Cashier : to view order type Room
|
#Origami: Cashier : to view order type Room
|
||||||
def self.get_order_rooms
|
def self.get_order_rooms
|
||||||
|
|||||||
Reference in New Issue
Block a user