summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorRahix <rahix@rahix.de>2020-05-12 23:00:24 +0200
committerJohn Wiegley <johnw@newartisans.com>2020-07-21 14:50:01 -0700
commit3c7b8442c20f9a86e7077dc8049d97d1f2b33885 (patch)
tree907c06866baca6fcf56659ad792767d809f81058 /src/filters.cc
parent81e107645ebfcb31c285ce8b2a4ea0cd922174f8 (diff)
downloadfork-ledger-3c7b8442c20f9a86e7077dc8049d97d1f2b33885.tar.gz
fork-ledger-3c7b8442c20f9a86e7077dc8049d97d1f2b33885.tar.bz2
fork-ledger-3c7b8442c20f9a86e7077dc8049d97d1f2b33885.zip
collapse_posts: Use the existing accounts instead of temps
The temps will not have correct depth information attached which means a display predicate involving `depth` will most likely lead to wrong results.
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/filters.cc b/src/filters.cc
index 67b6d35a..6db8af80 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -451,7 +451,7 @@ void collapse_posts::report_subtotal()
foreach (totals_map::value_type& pat, totals) {
handle_value(/* value= */ pat.second,
- /* account= */ &temps.create_account(pat.first),
+ /* account= */ pat.first,
/* xact= */ &xact,
/* temps= */ temps,
/* handler= */ handler,
@@ -473,10 +473,10 @@ void collapse_posts::report_subtotal()
value_t& collapse_posts::find_totals(account_t* account)
{
if (collapse_depth == 0)
- return totals[_("<Total>")];
+ return totals[global_totals_account];
if (account->depth <= collapse_depth)
- return totals[account->fullname()];
+ return totals[account];
//else recurse
return find_totals(account->parent);