mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-19 13:54:25 +01:00
fix bug: dont get plan object in compute amount of wallet in reservation
This commit is contained in:
parent
909c204af5
commit
7650ec5a5a
@ -355,6 +355,7 @@ class Reservation < ActiveRecord::Base
|
||||
def get_wallet_amount_debit
|
||||
total = self.invoice.invoice_items.map(&:amount).map(&:to_i).reduce(:+) or 0
|
||||
if plan_id.present?
|
||||
plan = Plan.find(plan_id)
|
||||
total += plan.amount
|
||||
end
|
||||
wallet_amount = (user.wallet.amount * 100).to_i
|
||||
|
Loading…
x
Reference in New Issue
Block a user