diff options
author | John Wiegley <johnw@newartisans.com> | 2006-03-19 21:10:51 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 05:48:44 -0400 |
commit | 86a6af697433cd81fa842e6340a0ae2d8cb459a0 (patch) | |
tree | 5e09346d6f299c31b4206922d15b845a580f3762 /journal.cc | |
parent | 80c472733baf078ac275c02adf0bafff82803464 (diff) | |
download | fork-ledger-86a6af697433cd81fa842e6340a0ae2d8cb459a0.tar.gz fork-ledger-86a6af697433cd81fa842e6340a0ae2d8cb459a0.tar.bz2 fork-ledger-86a6af697433cd81fa842e6340a0ae2d8cb459a0.zip |
*** no comment ***
Diffstat (limited to 'journal.cc')
-rw-r--r-- | journal.cc | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -264,7 +264,7 @@ auto_entry_t::~auto_entry_t() delete predicate; } -void auto_entry_t::extend_entry(entry_base_t& entry) +void auto_entry_t::extend_entry(entry_base_t& entry, bool post) { transactions_list initial_xacts(entry.transactions.begin(), entry.transactions.end()); @@ -277,10 +277,15 @@ void auto_entry_t::extend_entry(entry_base_t& entry) t != transactions.end(); t++) { amount_t amt; - if ((*t)->amount.commodity().symbol.empty()) + if (! (*t)->amount.commodity()) { + if (! post) + continue; amt = (*i)->amount * (*t)->amount; - else + } else { + if (post) + continue; amt = (*t)->amount; + } account_t * account = (*t)->account; std::string fullname = account->fullname(); @@ -458,7 +463,9 @@ bool journal_t::add_entry(entry_t * entry) { entry->journal = this; - if (! run_hooks(entry_finalize_hooks, *entry) || ! entry->finalize()) { + if (! run_hooks(entry_finalize_hooks, *entry, false) || + ! entry->finalize() || + ! run_hooks(entry_finalize_hooks, *entry, true)) { entry->journal = NULL; return false; } |