diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-14 02:32:49 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-14 02:32:49 -0500 |
commit | 2d58224001e502111812aaecbc56fdf618147bf8 (patch) | |
tree | 863c9182dbb92c888f66196cb5cb5459c2125091 /src/filters.cc | |
parent | ee93b5c740abda29045a49e9c791262425e35105 (diff) | |
download | ledger-2d58224001e502111812aaecbc56fdf618147bf8.tar.gz ledger-2d58224001e502111812aaecbc56fdf618147bf8.tar.bz2 ledger-2d58224001e502111812aaecbc56fdf618147bf8.zip |
Break up multiple commodities in equity report
Diffstat (limited to 'src/filters.cc')
-rw-r--r-- | src/filters.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/filters.cc b/src/filters.cc index 811067fc..bef4dc24 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -350,9 +350,9 @@ void collapse_posts::report_subtotal() component_posts.clear(); last_xact = NULL; - last_post = NULL; - subtotal = 0L; - count = 0; + last_post = NULL; + subtotal = 0L; + count = 0; } void collapse_posts::operator()(post_t& post) @@ -364,12 +364,12 @@ void collapse_posts::operator()(post_t& post) report_subtotal(); post.add_to_value(subtotal, amount_expr); - count++; component_posts.push_back(&post); last_xact = post.xact; - last_post = &post; + last_post = &post; + count++; } void related_posts::flush() @@ -648,8 +648,15 @@ void posts_as_equity::report_subtotal() value_t total = 0L; foreach (values_map::value_type& pair, values) { - handle_value(pair.second.value, pair.second.account, &xact, temps, - *handler); + if (pair.second.value.is_balance()) { + foreach (balance_t::amounts_map::value_type amount_pair, + pair.second.value.as_balance().amounts) + handle_value(amount_pair.second, pair.second.account, &xact, temps, + *handler); + } else { + handle_value(pair.second.value, pair.second.account, &xact, temps, + *handler); + } total += pair.second.value; } values.clear(); |