diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/output.cc | 3 | ||||
-rw-r--r-- | src/report.cc | 15 | ||||
-rw-r--r-- | src/report.h | 2 |
3 files changed, 14 insertions, 6 deletions
diff --git a/src/output.cc b/src/output.cc index cc4845a3..f53e60c9 100644 --- a/src/output.cc +++ b/src/output.cc @@ -228,7 +228,8 @@ format_accounts::mark_accounts(account_t& account, const bool flat) if ((! flat && to_display > 1) || ((flat || to_display != 1 || account.has_xflags(ACCOUNT_EXT_VISITED)) && - (report.HANDLED(empty) || report.fn_display_total(call_scope)) && + (report.HANDLED(empty) || + report.display_value(report.fn_display_total(call_scope))) && disp_pred(bound_scope))) { account.xdata().add_flags(ACCOUNT_EXT_TO_DISPLAY); DEBUG("account.display", "Marking account as TO_DISPLAY"); diff --git a/src/report.cc b/src/report.cc index da7c11f5..df37f9dc 100644 --- a/src/report.cc +++ b/src/report.cc @@ -428,6 +428,15 @@ void report_t::commodities_report(post_handler_ptr handler) session.journal->clear_xdata(); } +value_t report_t::display_value(const value_t& val) +{ + value_t temp(val.strip_annotations(what_to_keep())); + if (HANDLED(base)) + return temp; + else + return temp.unreduced(); +} + value_t report_t::fn_amount_expr(call_scope_t& scope) { return HANDLER(amount_).expr.calc(scope); @@ -533,11 +542,7 @@ value_t report_t::fn_print(call_scope_t& args) value_t report_t::fn_scrub(call_scope_t& args) { - value_t temp(args.value().strip_annotations(what_to_keep())); - if (HANDLED(base)) - return temp; - else - return temp.unreduced(); + return display_value(args.value()); } value_t report_t::fn_rounded(call_scope_t& args) diff --git a/src/report.h b/src/report.h index 7e52933a..e0073193 100644 --- a/src/report.h +++ b/src/report.h @@ -134,6 +134,8 @@ public: void accounts_report(acct_handler_ptr handler); void commodities_report(post_handler_ptr handler); + value_t display_value(const value_t& val); + value_t fn_amount_expr(call_scope_t& scope); value_t fn_total_expr(call_scope_t& scope); value_t fn_display_amount(call_scope_t& scope); |