diff options
author | John Wiegley <johnw@newartisans.com> | 2004-09-24 05:33:12 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-09-24 05:33:12 -0400 |
commit | 2f16a8213264a9428b31228373a5aae7605f5575 (patch) | |
tree | 311a9bf3a6346a4652baad28d344e2285f2be8e9 | |
parent | c5d519447e913fe2320f39d8a57e320c3c0b6e41 (diff) | |
download | fork-ledger-2f16a8213264a9428b31228373a5aae7605f5575.tar.gz fork-ledger-2f16a8213264a9428b31228373a5aae7605f5575.tar.bz2 fork-ledger-2f16a8213264a9428b31228373a5aae7605f5575.zip |
fixed an obscure "print" bug
-rw-r--r-- | format.cc | 19 | ||||
-rwxr-xr-x | main.py | 13 |
2 files changed, 18 insertions, 14 deletions
@@ -324,24 +324,22 @@ void format_t::format(std::ostream& out, const details_t& details) const disp = stream.str(); use_disp = true; } else { - unsigned int xacts_real_count = 0; + unsigned int xacts_count = 0; transaction_t * first = NULL; transaction_t * last = NULL; for (transactions_list::const_iterator i = details.entry->transactions.begin(); i != details.entry->transactions.end(); - i++) - if (! ((*i)->flags & TRANSACTION_AUTO)) { - xacts_real_count++; + i++) { + xacts_count++; - if (! first) - first = *i; - last = *i; - } + if (! first) + first = *i; + last = *i; + } - use_disp = (xacts_real_count == 2 && - details.xact == last && + use_disp = (xacts_count == 2 && details.xact == last && first->amount == - last->amount); } @@ -558,7 +556,6 @@ void export_format() #if 0 def("partial_account_name", partial_account_name); #endif - def("display_account", display_account); } @@ -262,11 +262,18 @@ if config.predicate: # simple walk in C++, using `walk_entries'. if 1: - walk_entries (journal, handler) + if command == "e": + walk_transactions (new_entry, handler) + else: + walk_entries (journal, handler) else: - for entry in journal: - for xact in entry: + if command == "e": + for xact in new_entry: handler (xact) + else: + for entry in journal: + for xact in entry: + handler (xact) # Flush the handlers, causing them to output whatever data is still # pending. |