fixed -G report
This commit is contained in:
parent
a5d9e21065
commit
24e8977b57
3 changed files with 10 additions and 4 deletions
1
ledger.h
1
ledger.h
|
|
@ -34,6 +34,7 @@ namespace ledger {
|
|||
|
||||
#define TRANSACTION_HANDLED 0x10
|
||||
#define TRANSACTION_DISPLAYED 0x20
|
||||
#define TRANSACTION_NO_TOTAL 0x40
|
||||
|
||||
class entry_t;
|
||||
class account_t;
|
||||
|
|
|
|||
2
main.cc
2
main.cc
|
|
@ -407,7 +407,7 @@ OPT_BEGIN(gain, "G", false) {
|
|||
show_revalued =
|
||||
show_revalued_only = true;
|
||||
|
||||
value_expr = "c";
|
||||
value_expr = "a";
|
||||
total_expr = "G";
|
||||
} OPT_END(gain);
|
||||
|
||||
|
|
|
|||
5
walk.cc
5
walk.cc
|
|
@ -32,6 +32,7 @@ void calc_transactions::operator()(transaction_t * xact)
|
|||
xact->cost.negate();
|
||||
}
|
||||
|
||||
if (! (xact->dflags & TRANSACTION_NO_TOTAL))
|
||||
xact->total += *xact;
|
||||
|
||||
(*handler)(xact);
|
||||
|
|
@ -102,8 +103,12 @@ void changed_value_transactions::operator()(transaction_t * xact)
|
|||
xact_temps.push_back(temp_xact);
|
||||
|
||||
temp_xact->amount = (*i).second;
|
||||
if (changed_values_only) {
|
||||
temp_xact->dflags |= TRANSACTION_NO_TOTAL;
|
||||
} else {
|
||||
temp_xact->total = (*i).second;
|
||||
temp_xact->total.negate();
|
||||
}
|
||||
|
||||
(*handler)(temp_xact);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue