update member discount

This commit is contained in:
Aung Myo
2017-09-14 17:36:00 +06:30
parent 90681cddcc
commit e878a6387e
14 changed files with 1055 additions and 932 deletions

View File

@@ -5,9 +5,10 @@ class Origami::MpuController < BaseOrigamiController
# limit mpu_amount
sale_data = Sale.find_by_sale_id(@sale_id)
total = sale_data.grand_total
total = sale_data.grand_total
@mpucount = 0
others = 0
others = 0
sale_data.sale_payments.each do |sale_payment|
if sale_payment.payment_method == "mpu"
@mpucount = @mpucount + sale_payment.payment_amount
@@ -17,6 +18,9 @@ class Origami::MpuController < BaseOrigamiController
end
@can_mpu = total - @mpucount - others
@member_discount = MembershipSetting.find_by_discount(1)
@sub_total = sale_data.total_amount
@membership_id = sale_data.customer.membership_id
end
def create