update close receipt for member discount

This commit is contained in:
Aung Myo
2017-08-11 15:39:08 +06:30
parent 2c7a641d47
commit 79ca1428b9
7 changed files with 74 additions and 24 deletions

View File

@@ -125,6 +125,12 @@ class ShiftSale < ApplicationRecord
query = query.where("sales.shift_sale_id =? and sale_status = 'completed'", shift.id)
.group("acc.title").order("acc.id")
end
end
def self.get_total_member_discount(shift)
query = Sale.select("SUM(sales.total_discount) as member_discount")
.where("shift_sale_id =? and sale_status = 'completed' and discount_type = 'member_discount'", shift.id)
end
end