summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-09-18 02:33:51 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-09-18 02:33:51 -0400
commit18879bbe85cdef7a60d0692e17b9c835c81e77fc (patch)
tree6b1f842611c09609d235fe68381483cdb2e5e348 /textual.cc
parenta2bbd7dc8fa3e5ae07bb662689bb107945aacf2e (diff)
downloadfork-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.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/textual.cc b/textual.cc
index 57cb0089..e95d0eff 100644
--- a/textual.cc
+++ b/textual.cc
@@ -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