commission in sale edit

This commit is contained in:
Zin Lin Phyo
2017-08-25 13:44:22 +06:30
parent 283c59c5dc
commit b4eb27b8a9
16 changed files with 417 additions and 422 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}'") }