diff options
-rw-r--r-- | doc/ledger.1 | 3 | ||||
-rw-r--r-- | src/chain.cc | 9 | ||||
-rw-r--r-- | src/report.h | 13 |
3 files changed, 20 insertions, 5 deletions
diff --git a/doc/ledger.1 b/doc/ledger.1 index 62007d37..5598ee8e 100644 --- a/doc/ledger.1 +++ b/doc/ledger.1 @@ -1,4 +1,4 @@ -.Dd February 22, 2009 +.Dd February 23, 2009 .Dt ledger 1 .Sh NAME .Nm ledger @@ -183,6 +183,7 @@ appeared in the original journal file. .It Fl \-related-all .It Fl \-revalued .It Fl \-revalued-only +.It Fl \-revalued-total Ar EXPR .It Fl \-script .It Fl \-set-account Ar EXPR .It Fl \-set-payee Ar EXPR diff --git a/src/chain.cc b/src/chain.cc index 2a494fda..950afc32 100644 --- a/src/chain.cc +++ b/src/chain.cc @@ -78,10 +78,11 @@ xact_handler_ptr chain_xact_handlers(report_t& report, // changes in market value of commodities, which otherwise would affect // the running total unpredictably. if (report.HANDLED(revalued)) - handler.reset(new changed_value_xacts(handler, - report.HANDLER(display_total_).expr, - report, - report.HANDLED(revalued_only))); + handler.reset(new changed_value_xacts + (handler, report.HANDLED(revalued_total_) ? + report.HANDLER(revalued_total_).expr : + report.HANDLER(display_total_).expr, + report, report.HANDLED(revalued_only))); // calc_xacts computes the running total. When this appears will // determine, for example, whether filtered xacts are included or excluded diff --git a/src/report.h b/src/report.h index 0c2be64d..57cef3c5 100644 --- a/src/report.h +++ b/src/report.h @@ -537,6 +537,19 @@ public: OPTION(report_t, related_all); OPTION(report_t, revalued); OPTION(report_t, revalued_only); + + OPTION__ + (report_t, revalued_total_, + expr_t expr; + CTOR(report_t, revalued_total_) {} + void set_expr(const string& str) { + expr = str; + on(str); + } + DO_(args) { + set_expr(args[0].to_string()); + }); + OPTION(report_t, set_account_); OPTION(report_t, set_payee_); OPTION(report_t, set_price_); |