From 4b58047ecb578d31ddc13337b92699727dacfd32 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 27 Feb 2012 03:56:07 -0600 Subject: Move when Unknown accounts are processed --- src/journal.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/journal.cc') diff --git a/src/journal.cc b/src/journal.cc index 43f6df77..aaa53ea4 100644 --- a/src/journal.cc +++ b/src/journal.cc @@ -123,10 +123,18 @@ account_t * journal_t::register_account(const string& name, post_t * post, if (i != account_aliases.end()) result = (*i).second; } - if (! result) result = master_account->find_account(name); + if (result->name == _("Unknown")) { + foreach (account_mapping_t& value, payees_for_unknown_accounts) { + if (value.first.match(post->xact->payee)) { + result = value.second; + break; + } + } + } + if (! result->has_flags(ACCOUNT_KNOWN)) { if (! post) { if (force_checking) @@ -145,15 +153,6 @@ account_t * journal_t::register_account(const string& name, post_t * post, } } - if (result->name == _("Unknown")) { - foreach (account_mapping_t& value, payees_for_unknown_accounts) { - if (value.first.match(post->xact->payee)) { - result = value.second; - break; - } - } - } - return result; } -- cgit v1.2.3