mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-25 08:09:38 +02:00
Skip account valuation on entry balance_after_entry (#1435)
This commit is contained in:
parent
3b928775a8
commit
a113d573d6
3 changed files with 16 additions and 3 deletions
|
@ -60,6 +60,8 @@ class Account::Entry < ApplicationRecord
|
|||
else
|
||||
new_balance = prior_balance
|
||||
entries_on_entry_date.each do |e|
|
||||
next if e.account_valuation?
|
||||
|
||||
change = e.amount
|
||||
change = account.liability? ? change : -change
|
||||
new_balance += change
|
||||
|
@ -79,7 +81,7 @@ class Account::Entry < ApplicationRecord
|
|||
end
|
||||
|
||||
def entries_on_entry_date
|
||||
account.entries.where(date: date).order(created_at: :desc)
|
||||
account.entries.where(date: date).order(created_at: :asc)
|
||||
end
|
||||
|
||||
class << self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue