mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Fix incorrect totals calculation when family has loan payments (#1984)
* Fix income totals calculation error when loan payments exist * Include transaction totals in totals query
This commit is contained in:
parent
b8a3ca7732
commit
f363fd4a4e
4 changed files with 8 additions and 5 deletions
|
@ -18,7 +18,7 @@ class IncomeStatement
|
|||
total_expense = result.select { |t| t.classification == "expense" }.sum(&:total)
|
||||
|
||||
ScopeTotals.new(
|
||||
transactions_count: transactions_scope.count,
|
||||
transactions_count: result.sum(&:transactions_count),
|
||||
income_money: Money.new(total_income, family.currency),
|
||||
expense_money: Money.new(total_expense, family.currency),
|
||||
missing_exchange_rates?: result.any?(&:missing_exchange_rates?)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue