mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-18 07:52:23 +01:00
(bug) fix comput the wallet amount that dont apply coupon
This commit is contained in:
parent
dbe4570c30
commit
0ee45f8404
@ -79,13 +79,13 @@ class WalletService
|
||||
# @param user {User} the customer
|
||||
# @param coupon {Coupon|String} Coupon object or code
|
||||
##
|
||||
def self.wallet_amount_debit(payment, user, coupon = nil)
|
||||
def self.wallet_amount_debit(payment, user)
|
||||
total = if payment.is_a? PaymentSchedule
|
||||
payment.payment_schedule_items.first.amount
|
||||
else
|
||||
payment.total
|
||||
end
|
||||
total = CouponService.new.apply(total, coupon, user.id) if coupon
|
||||
total = CouponService.new.apply(total, payment.coupon, user.id) if payment.coupon
|
||||
|
||||
wallet_amount = (user.wallet.amount * 100).to_i
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user