summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2015-08-04 14:54:13 -0700
committerJohn Wiegley <johnw@newartisans.com>2015-08-04 14:54:13 -0700
commit977e33d39e2c896ac632f84230139af8da189b9b (patch)
tree3505d81e4ff8366b0a8dc8c9d874248b2604dda9 /src/filters.cc
parentfbba9adc16c515632a5009d2ec88c9fcab532676 (diff)
parent69de980aebf83e83971eb2b791e8676a0141f00a (diff)
downloadfork-ledger-977e33d39e2c896ac632f84230139af8da189b9b.tar.gz
fork-ledger-977e33d39e2c896ac632f84230139af8da189b9b.tar.bz2
fork-ledger-977e33d39e2c896ac632f84230139af8da189b9b.zip
Merge pull request #423 from ledger/revert-216-master
Revert "--depth for register"
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc33
1 files changed, 7 insertions, 26 deletions
diff --git a/src/filters.cc b/src/filters.cc
index fd30c966..2f97a0e5 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -448,20 +448,16 @@ void collapse_posts::report_subtotal()
DEBUG("filters.collapse", "Pseudo-xact date = " << *xact._date);
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);