summaryrefslogtreecommitdiff
path: root/derive.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-21 17:29:45 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-21 17:34:39 -0400
commitac5cc7796ff61eb116b815b13e4fda3d74bb6020 (patch)
treef862f1595523a80ed31298f2d393fc48f86f4bc7 /derive.cc
parent0a1bce0f8073cb40c0ca51046173d98f267074ea (diff)
parentb1370b654da241ca7674b366e8007d1d6915094e (diff)
downloadfork-ledger-ac5cc7796ff61eb116b815b13e4fda3d74bb6020.tar.gz
fork-ledger-ac5cc7796ff61eb116b815b13e4fda3d74bb6020.tar.bz2
fork-ledger-ac5cc7796ff61eb116b815b13e4fda3d74bb6020.zip
Merged in from master.
Diffstat (limited to 'derive.cc')
-rw-r--r--derive.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/derive.cc b/derive.cc
index fc556ce7..06581f96 100644
--- a/derive.cc
+++ b/derive.cc
@@ -71,10 +71,21 @@ entry_t * derive_new_entry(journal_t& journal,
}
}
- if (journal.basket)
- acct = journal.basket;
- else
- acct = journal.find_account("Equity");
+ acct = NULL;
+
+ if (i != end) {
+ if (! acct)
+ acct = journal.find_account_re(*i);
+ if (! acct)
+ acct = journal.find_account(*i);
+ }
+
+ if (! acct) {
+ if (journal.basket)
+ acct = journal.basket;
+ else
+ acct = journal.find_account("Equity");
+ }
added->add_transaction(new transaction_t(acct));
}