summaryrefslogtreecommitdiff
path: root/derive.cc
diff options
context:
space:
mode:
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));
}