summaryrefslogtreecommitdiff
path: root/src/journal.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal.cc')
-rw-r--r--src/journal.cc19
1 files changed, 9 insertions, 10 deletions
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;
}