summaryrefslogtreecommitdiff
path: root/walk.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-13 17:29:46 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-13 17:29:46 -0400
commit0c8dff61edf2db560c92c25468520cd1bc773d77 (patch)
tree59727c6f574ab9ebe3081d7ed4616efb9d80dd04 /walk.cc
parent6944e5950a90b17d53a6efe87c71512085d4e1f7 (diff)
downloadfork-ledger-0c8dff61edf2db560c92c25468520cd1bc773d77.tar.gz
fork-ledger-0c8dff61edf2db560c92c25468520cd1bc773d77.tar.bz2
fork-ledger-0c8dff61edf2db560c92c25468520cd1bc773d77.zip
fixed problem with writing binary amounts
Diffstat (limited to 'walk.cc')
-rw-r--r--walk.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/walk.cc b/walk.cc
index a13ba06c..ce7ddd8a 100644
--- a/walk.cc
+++ b/walk.cc
@@ -20,8 +20,12 @@ void sort_transactions::flush()
void calc_transactions::operator()(transaction_t * xact)
{
- if (last_xact)
+ if (last_xact) {
xact->total += last_xact->total;
+ xact->index = last_xact->index + 1;
+ } else {
+ xact->index = 0;
+ }
if (inverted) {
xact->amount.negate();
@@ -29,7 +33,6 @@ void calc_transactions::operator()(transaction_t * xact)
}
xact->total += *xact;
- xact->index = last_xact ? last_xact->index + 1 : 0;
(*handler)(xact);