diff options
Diffstat (limited to 'src/filters.cc')
-rw-r--r-- | src/filters.cc | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/src/filters.cc b/src/filters.cc index ef713f1f..b6530c04 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -449,19 +449,15 @@ void collapse_posts::report_subtotal() DEBUG("filters.collapse", "earliest date = " << earliest_date); DEBUG("filters.collapse", "latest date = " << latest_date); - foreach (totals_map::value_type& pat, totals) { - handle_value(/* value= */ pat.second, - /* account= */ &temps.create_account(pat.first), - /* xact= */ &xact, - /* temps= */ temps, - /* handler= */ handler, - /* date= */ latest_date, - /* act_date_p= */ false); - } - + handle_value(/* value= */ subtotal, + /* account= */ totals_account, + /* xact= */ &xact, + /* temps= */ temps, + /* handler= */ handler, + /* date= */ latest_date, + /* act_date_p= */ false); } - totals.clear(); component_posts.clear(); last_xact = NULL; @@ -470,20 +466,6 @@ void collapse_posts::report_subtotal() count = 0; } -value_t& collapse_posts::find_totals(account_t* account) -{ - unsigned short depth=3; - - if(depth==0) - return totals[_("<Total>")]; - - if(account->depth==depth) - return totals[account->fullname()]; - - //else recurse - return find_totals(account->parent); -} - void collapse_posts::operator()(post_t& post) { // If we've reached a new xact, report on the subtotal @@ -493,7 +475,6 @@ void collapse_posts::operator()(post_t& post) report_subtotal(); post.add_to_value(subtotal, amount_expr); - post.add_to_value(find_totals(post.account), amount_expr); component_posts.push_back(&post); |