diff options
-rw-r--r-- | src/report.cc | 10 | ||||
-rw-r--r-- | src/report.h | 3 | ||||
-rw-r--r-- | src/session.cc | 6 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/report.cc b/src/report.cc index 553fe0f8..ce414446 100644 --- a/src/report.cc +++ b/src/report.cc @@ -272,6 +272,11 @@ value_t report_t::get_total_expr(call_scope_t& scope) return total_expr.calc(scope); } +value_t report_t::get_display_total(call_scope_t& scope) +{ + return display_total.calc(scope); +} + namespace { value_t print_balance(call_scope_t& args) { @@ -474,6 +479,11 @@ expr_t::ptr_op_t report_t::lookup(const string& name) } break; + case 'd': + if (std::strcmp(p, "display_total") == 0) + return MAKE_FUNCTOR(report_t::get_display_total); + break; + case 'o': if (std::strncmp(p, "opt_", 4) == 0) { p = p + 4; diff --git a/src/report.h b/src/report.h index 104bd428..bfed30b9 100644 --- a/src/report.h +++ b/src/report.h @@ -104,6 +104,7 @@ public: expr_t amount_expr; expr_t total_expr; + expr_t display_total; unsigned long budget_flags; @@ -139,6 +140,7 @@ public: explicit report_t(session_t& _session) : amount_expr("amount"), total_expr("total"), + display_total("total_expr"), head_entries(0), tail_entries(0), @@ -675,6 +677,7 @@ public: value_t get_amount_expr(call_scope_t& scope); value_t get_total_expr(call_scope_t& scope); + value_t get_display_total(call_scope_t& scope); value_t option_amount_data(call_scope_t&) { // j format_string = session.plot_amount_format; diff --git a/src/session.cc b/src/session.cc index 961261e8..ccc3aa34 100644 --- a/src/session.cc +++ b/src/session.cc @@ -72,16 +72,16 @@ void release_session_context() session_t::session_t() : register_format ("%-.9(date) %-.20(payee) %-.23(account) %!12(print_balance(amount_expr, 12, 67)) " - "%!12(print_balance(total_expr, 12, 80, true))\n%/" + "%!12(print_balance(display_total, 12, 80, true))\n%/" "%31|%-.23(account) %!12(print_balance(amount_expr, 12, 67)) " - "%!12(print_balance(total_expr, 12, 80, true))\n"), + "%!12(print_balance(display_total, 12, 80, true))\n"), wide_register_format ("%-.9D %-.35P %-.39A %22.108t %!22.132T\n%/" "%48|%-.38A %22.108t %!22.132T\n"), print_format ("%(date)%(cleared ? \" *\" : (uncleared ? \"\" : \" !\"))%(code ? \" (\" + code + \")\" : \"\") %(payee)\n %-34(account) %12(amount)\n%/ %-34(account) %12(amount)%(note ? \" ; \" + note : \"\")\n%/\n"), balance_format - ("%20(total_expr) %(depth_spacer)%-(partial_account)\n"), + ("%20(display_total) %(depth_spacer)%-(partial_account)\n"), equity_format ("\n%D %Y%C%P\n%/ %-34W %12t\n"), plot_amount_format |