This commit is contained in:
Myat Zin Wai Maw
2019-12-13 10:12:08 +06:30
parent 79598c0126
commit f45849de49
39 changed files with 123 additions and 1121 deletions

View File

@@ -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)