diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-30 05:29:34 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-30 05:29:34 -0400 |
commit | 305c6159afe727c6e6f2f49c37789922df1a5a98 (patch) | |
tree | 7ec61636d9b3439314ee8f22ccffe733d6d94462 /textual.cc | |
parent | a54030a486676cca8068538d2701d5beda8c04fa (diff) | |
download | fork-ledger-305c6159afe727c6e6f2f49c37789922df1a5a98.tar.gz fork-ledger-305c6159afe727c6e6f2f49c37789922df1a5a98.tar.bz2 fork-ledger-305c6159afe727c6e6f2f49c37789922df1a5a98.zip |
small fixes
Diffstat (limited to 'textual.cc')
-rw-r--r-- | textual.cc | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -148,14 +148,21 @@ bool finalize_entry(entry_t * entry) value_t balance; + bool first = true; for (transactions_list::const_iterator x = entry->transactions.begin(); x != entry->transactions.end(); x++) if (! ((*x)->flags & TRANSACTION_VIRTUAL) || ((*x)->flags & TRANSACTION_BALANCE)) { amount_t * p = (*x)->cost ? (*x)->cost : &(*x)->amount; - if (*p) - balance += *p; + if (*p) { + if (first) { + balance = *p; + first = false; + } else { + balance += *p; + } + } } // If one transaction of a two-line transaction is of a different |