diff options
author | John Wiegley <johnw@newartisans.com> | 2004-09-18 02:33:51 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-09-18 02:33:51 -0400 |
commit | 18879bbe85cdef7a60d0692e17b9c835c81e77fc (patch) | |
tree | 6b1f842611c09609d235fe68381483cdb2e5e348 /textual.cc | |
parent | a2bbd7dc8fa3e5ae07bb662689bb107945aacf2e (diff) | |
download | fork-ledger-18879bbe85cdef7a60d0692e17b9c835c81e77fc.tar.gz fork-ledger-18879bbe85cdef7a60d0692e17b9c835c81e77fc.tar.bz2 fork-ledger-18879bbe85cdef7a60d0692e17b9c835c81e77fc.zip |
some changes in the way formatting strings are handled; for simplicity
Diffstat (limited to 'textual.cc')
-rw-r--r-- | textual.cc | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -152,7 +152,7 @@ bool finalize_entry(entry_t * entry) value_t balance; - bool first = true; + bool no_amounts = true; for (transactions_list::const_iterator x = entry->transactions.begin(); x != entry->transactions.end(); x++) @@ -160,15 +160,19 @@ bool finalize_entry(entry_t * entry) ((*x)->flags & TRANSACTION_BALANCE)) { amount_t * p = (*x)->cost ? (*x)->cost : &(*x)->amount; if (*p) { - if (first) { + if (no_amounts) { balance = *p; - first = false; + no_amounts = false; } else { balance += *p; } } } + // If it's a null entry, then let the user have their fun + if (no_amounts) + return true; + // If one transaction of a two-line transaction is of a different // commodity than the others, and it has no per-unit price, // determine its price by dividing the unit count into the value of |