diff options
author | johannes@debussy <johannes@debussy> | 2013-11-05 11:57:00 +0100 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2020-07-21 14:50:01 -0700 |
commit | 5e10e0c94aa764e3933e19bd40b7cd35ff6d37f0 (patch) | |
tree | 1d3d22c3073d063226ca42d1014dccdb6b6f2044 /src/filters.h | |
parent | 315d428f6a3b1965b10d2477cccc71f85548490c (diff) | |
download | fork-ledger-5e10e0c94aa764e3933e19bd40b7cd35ff6d37f0.tar.gz fork-ledger-5e10e0c94aa764e3933e19bd40b7cd35ff6d37f0.tar.bz2 fork-ledger-5e10e0c94aa764e3933e19bd40b7cd35ff6d37f0.zip |
first try for implementing --depth for register
Diffstat (limited to 'src/filters.h')
-rw-r--r-- | src/filters.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/filters.h b/src/filters.h index 5c517c95..40e25ac0 100644 --- a/src/filters.h +++ b/src/filters.h @@ -426,6 +426,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; @@ -434,7 +437,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; @@ -453,17 +456,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(); @@ -485,7 +484,7 @@ public: last_post = NULL; temps.clear(); - create_accounts(); + totals.clear(); component_posts.clear(); item_handler<post_t>::clear(); |