diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-21 15:55:03 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-21 15:55:03 -0400 |
commit | 000bfe1cece3ecbfee8f07a46d1f0b000dbbc983 (patch) | |
tree | 6d2c666097900fff421da6a57b41f0a7c43a39b7 /walk.cc | |
parent | 225acd14e57a0a476ce022a7c5703a8f1cee34ef (diff) | |
download | fork-ledger-000bfe1cece3ecbfee8f07a46d1f0b000dbbc983.tar.gz fork-ledger-000bfe1cece3ecbfee8f07a46d1f0b000dbbc983.tar.bz2 fork-ledger-000bfe1cece3ecbfee8f07a46d1f0b000dbbc983.zip |
only compute the cost when it differs from the amount
Diffstat (limited to 'walk.cc')
-rw-r--r-- | walk.cc | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -29,7 +29,8 @@ void calc_transactions::operator()(transaction_t * xact) if (inverted) { xact->amount.negate(); - xact->cost.negate(); + if (xact->cost) + xact->cost->negate(); } if (! (xact->dflags & TRANSACTION_NO_TOTAL)) @@ -39,7 +40,8 @@ void calc_transactions::operator()(transaction_t * xact) if (inverted) { xact->amount.negate(); - xact->cost.negate(); + if (xact->cost) + xact->cost->negate(); } last_xact = xact; @@ -64,7 +66,6 @@ void collapse_transactions::report_cumulative_subtotal() total_xact->entry = last_entry; total_xact->amount = (*i).second; - total_xact->cost = (*i).second; (*handler)(total_xact); } @@ -161,7 +162,6 @@ void subtotal_transactions::flush(const char * spec_fmt) xact->entry = entry; xact->amount = (*j).second; - xact->cost = (*j).second; (*handler)(xact); } |