diff options
author | John Wiegley <johnw@newartisans.com> | 2006-08-22 00:52:08 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:33 -0400 |
commit | 04dfda2282bfb3686336600cfafd1d9653369445 (patch) | |
tree | 9ee02db5c2d33290dfa6060475973f7c378ce643 /journal.cc | |
parent | db0ef2e25731a824aa728315f2f7f6e8a41a5ddf (diff) | |
download | fork-ledger-04dfda2282bfb3686336600cfafd1d9653369445.tar.gz fork-ledger-04dfda2282bfb3686336600cfafd1d9653369445.tar.bz2 fork-ledger-04dfda2282bfb3686336600cfafd1d9653369445.zip |
Made separate modules for the csv command, since the prior method was
not fully correct.
Diffstat (limited to 'journal.cc')
-rw-r--r-- | journal.cc | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -281,6 +281,27 @@ entry_t::entry_t(const entry_t& e) (*i)->entry = this; } +bool entry_t::get_state(transaction_t::state_t * state) const +{ + bool first = true; + bool hetero = false; + + for (transactions_list::const_iterator i = transactions.begin(); + i != transactions.end(); + i++) { + if (first) { + *state = (*i)->state; + first = false; + } + else if (*state != (*i)->state) { + hetero = true; + break; + } + } + + return ! hetero; +} + void entry_t::add_transaction(transaction_t * xact) { xact->entry = this; |