summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--derive.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/derive.cc b/derive.cc
index 296d9957..1b74578f 100644
--- a/derive.cc
+++ b/derive.cc
@@ -72,10 +72,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));
}