mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-04-10 00:53:51 +02: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
|
avoir.total += avoir_ii.amount
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
# handle coupon
|
||||||
|
unless avoir.coupon_id.nil?
|
||||||
|
discount = avoir.total * avoir.coupon.percent_off / 100
|
||||||
|
avoir.total -= discount
|
||||||
|
end
|
||||||
avoir
|
avoir
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user