summaryrefslogtreecommitdiff
path: root/src/journal.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-02-27 03:56:07 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-02-27 03:56:07 -0600
commit4b58047ecb578d31ddc13337b92699727dacfd32 (patch)
treea534d7acbb92d5f71e2b60c9ab31355e1e4f89c4 /src/journal.cc
parent4dd536c670c69a2c65d30281b32597d6e708ff8c (diff)
downloadfork-ledger-4b58047ecb578d31ddc13337b92699727dacfd32.tar.gz
fork-ledger-4b58047ecb578d31ddc13337b92699727dacfd32.tar.bz2
fork-ledger-4b58047ecb578d31ddc13337b92699727dacfd32.zip
Move when Unknown accounts are processed
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;
}