Fixed the --gain option for balance reports

This commit is contained in:
John Wiegley 2009-02-25 02:07:57 -04:00
parent 838338e316
commit cdaba43fa7
3 changed files with 3 additions and 0 deletions

View file

@ -86,6 +86,7 @@ and causes an immediate reloading of all journal files in the session.
.Bl -tag -width -indent
.It Fl \-abbrev-len Ar INT
.It Fl \-account Ar STR
.It Fl \-account-amount Ar EXPR
.It Fl \-account-width Ar INT
.It Fl \-actual Pq Fl L
.It Fl \-add-budget

View file

@ -326,6 +326,7 @@ void account_t::calculate_sums(expr_t& amount_expr)
value_t amount(amount_expr.calc(bound_scope));
if (! amount.is_null()) {
DEBUG("account.sums", "Added " << amount << " to " << fullname());
add_or_set_value(xd.total, amount);
xd.total_count += xd.count;
} else {

View file

@ -396,6 +396,7 @@ public:
OPTION_(report_t, gain, DO() { // -G
parent->HANDLER(revalued).on_only();
parent->HANDLER(account_amount_).set_expr("amount | (0, 0)");
parent->HANDLER(amount_).set_expr("(amount, cost)");
// Since we are displaying the amounts of revalued postings, they
// will end up being composite totals, and hence a pair of pairs.