1
0
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:
Peng DU 2016-07-21 12:57:13 +02:00
parent 909c204af5
commit 7650ec5a5a

View File

@ -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