Show real balance in invoices view

This commit is contained in:
Martin Lensment 2015-04-15 14:00:18 +03:00
parent 8768c0e1d6
commit 99aecc476f
5 changed files with 14 additions and 3 deletions

View file

@ -13,6 +13,11 @@ class Invoice < ActiveRecord::Base
account_activity.present?
end
def paid_at
# TODO: Cache this?
account_activity.try(:bank_transaction).try(:paid_at)
end
def to_s
I18n.t('invoice_no', no: id)
end