mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
handle coupon in refunds
This commit is contained in:
parent
d955f5d3e1
commit
1e0d809db9
@ -147,6 +147,11 @@ class Invoice < ActiveRecord::Base
|
||||
avoir.total += avoir_ii.amount
|
||||
end
|
||||
end
|
||||
# handle coupon
|
||||
unless avoir.coupon_id.nil?
|
||||
discount = avoir.total * avoir.coupon.percent_off / 100
|
||||
avoir.total -= discount
|
||||
end
|
||||
avoir
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user