diff options
-rw-r--r-- | src/filters.cc | 6 | ||||
-rw-r--r-- | src/filters.h | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/filters.cc b/src/filters.cc index 6b91aab4..3e481139 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -472,12 +472,10 @@ void collapse_posts::report_subtotal() value_t& collapse_posts::find_totals(account_t* account) { - unsigned short depth=3; - - if (depth == 0) + if (collapse_depth == 0) return totals[_("<Total>")]; - if (account->depth == depth) + if (account->depth == collapse_depth) return totals[account->fullname()]; //else recurse diff --git a/src/filters.h b/src/filters.h index 40e25ac0..be2e0e84 100644 --- a/src/filters.h +++ b/src/filters.h @@ -439,6 +439,7 @@ class collapse_posts : public item_handler<post_t> temporaries_t temps; totals_map totals; bool only_collapse_if_zero; + unsigned short collapse_depth; std::list<post_t *> component_posts; report_t& report; @@ -450,12 +451,14 @@ public: expr_t& _amount_expr, predicate_t _display_predicate, predicate_t _only_predicate, - bool _only_collapse_if_zero = false) + bool _only_collapse_if_zero = false, + unsigned short _collapse_depth = 0) : item_handler<post_t>(handler), amount_expr(_amount_expr), display_predicate(_display_predicate), only_predicate(_only_predicate), count(0), last_xact(NULL), last_post(NULL), - only_collapse_if_zero(_only_collapse_if_zero), report(_report) { + only_collapse_if_zero(_only_collapse_if_zero), + collapse_depth(_collapse_depth), report(_report) { TRACE_CTOR(collapse_posts, "post_handler_ptr, ..."); } virtual ~collapse_posts() { |