summaryrefslogtreecommitdiff
path: root/src/filters.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2015-08-04 14:33:03 -0700
committerJohn Wiegley <johnw@newartisans.com>2015-08-04 14:33:03 -0700
commita3e946f90f902600819f64217c8cd98c72bb21ba (patch)
treed7f0de1c234b457ce608c38d71040bca4cff43eb /src/filters.h
parent947a46ebebd141e928a9fcebb584e34df4e210a7 (diff)
parentfbba9adc16c515632a5009d2ec88c9fcab532676 (diff)
downloadledger-a3e946f90f902600819f64217c8cd98c72bb21ba.tar.gz
ledger-a3e946f90f902600819f64217c8cd98c72bb21ba.tar.bz2
ledger-a3e946f90f902600819f64217c8cd98c72bb21ba.zip
Merge remote-tracking branch 'origin/master' into next
Diffstat (limited to 'src/filters.h')
-rw-r--r--src/filters.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/filters.h b/src/filters.h
index 1404b38e..9b745235 100644
--- a/src/filters.h
+++ b/src/filters.h
@@ -421,6 +421,9 @@ public:
class collapse_posts : public item_handler<post_t>
{
+
+ typedef std::map<string,value_t> totals_map;
+
expr_t& amount_expr;
predicate_t display_predicate;
predicate_t only_predicate;
@@ -429,7 +432,7 @@ class collapse_posts : public item_handler<post_t>
xact_t * last_xact;
post_t * last_post;
temporaries_t temps;
- account_t * totals_account;
+ totals_map totals;
bool only_collapse_if_zero;
std::list<post_t *> component_posts;
report_t& report;
@@ -448,17 +451,13 @@ public:
only_predicate(_only_predicate), count(0),
last_xact(NULL), last_post(NULL),
only_collapse_if_zero(_only_collapse_if_zero), report(_report) {
- create_accounts();
TRACE_CTOR(collapse_posts, "post_handler_ptr, ...");
}
virtual ~collapse_posts() {
TRACE_DTOR(collapse_posts);
handler.reset();
}
-
- void create_accounts() {
- totals_account = &temps.create_account(_("<Total>"));
- }
+ value_t& find_totals(account_t* account);
virtual void flush() {
report_subtotal();
@@ -480,7 +479,7 @@ public:
last_post = NULL;
temps.clear();
- create_accounts();
+ totals.clear();
component_posts.clear();
item_handler<post_t>::clear();