From 025c9acda9b113df37e9ceaff69a028b181baf66 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 20 Jul 2008 20:31:53 -0400 Subject: When using the "entry" command with an unknown payee, get the draw account correct if one is specified. Fixes #203. --- derive.cc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'derive.cc') 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)); } -- cgit v1.2.3