Merge branch 'august_spring' of bitbucket.org:code2lab/sxrestaurant into august_spring

This commit is contained in:
Nweni
2017-08-28 09:37:58 +06:30
25 changed files with 885 additions and 570 deletions

View File

@@ -13,6 +13,7 @@ class Sale < ApplicationRecord
has_many :sale_payments
has_many :sale_orders
has_many :bookings
has_many :product_commissions
scope :open_invoices, -> { where("sale_status = 'new' and receipt_date BETWEEN '#{DateTime.now.utc.end_of_day}' AND '#{DateTime.now.utc.beginning_of_day}'") }
scope :complete_sale, -> { where("sale_status = 'completed' and receipt_date BETWEEN '#{DateTime.now.utc.beginning_of_day}' AND '#{DateTime.now.utc.end_of_day}'") }