shop
This commit is contained in:
@@ -11,6 +11,8 @@ class Booking < ApplicationRecord
|
||||
has_many :order_items, :through => :orders
|
||||
scope :active, -> {where("booking_status != 'moved'")}
|
||||
scope :today, -> {where("created_at >= #{Time.now.utc}")}
|
||||
scope :shop, -> { where("bookings.shop_code=?",Shop.current_shop.shop_code) }
|
||||
|
||||
|
||||
def self.sync_booking_records(bookings)
|
||||
if !bookings.nil?
|
||||
@@ -84,7 +86,7 @@ class Booking < ApplicationRecord
|
||||
joins(" LEFT JOIN dining_facilities df ON df.id=bookings.dining_facility_id")
|
||||
.where("booking_id LIKE ? OR checkin_by LIKE ? OR booking_status LIKE? OR checkout_by LIKE? OR sale_id ='#{filter}' OR df.name LIKE ?","%#{filter}%","%#{filter}%","%#{filter}%","%#{filter}%","%#{filter}%")
|
||||
end
|
||||
.order("sale_id DESC")
|
||||
.shop.order("sale_id DESC")
|
||||
end
|
||||
|
||||
def self.get_sync_data(sale_id)
|
||||
|
||||
Reference in New Issue
Block a user