mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Fix query when account has zero income and expense (#1112)
* Reproduce error * Apply fix * Remove uneeded helper
This commit is contained in:
parent
793a6027a3
commit
37ae51f68a
2 changed files with 9 additions and 9 deletions
|
@ -46,7 +46,8 @@ class Family < ApplicationRecord
|
|||
.where("account_entries.date <= ?", period.date_range.end)
|
||||
.where("account_entries.marked_as_transfer = ?", false)
|
||||
.where("account_entries.entryable_type = ?", "Account::Transaction")
|
||||
.group("id")
|
||||
.group("accounts.id")
|
||||
.having("SUM(ABS(account_entries.amount)) > 0")
|
||||
.to_a
|
||||
|
||||
results.each do |r|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue