diff options
author | John Wiegley <johnw@newartisans.com> | 2012-02-27 03:56:16 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-02-27 03:56:16 -0600 |
commit | 3d8cad77c4fc5f8221fdf0a29766360b47c5f63c (patch) | |
tree | d46df6782722e4210e7bba2e5d9c0050356378ee /src/journal.cc | |
parent | 4b58047ecb578d31ddc13337b92699727dacfd32 (diff) | |
download | fork-ledger-3d8cad77c4fc5f8221fdf0a29766360b47c5f63c.tar.gz fork-ledger-3d8cad77c4fc5f8221fdf0a29766360b47c5f63c.tar.bz2 fork-ledger-3d8cad77c4fc5f8221fdf0a29766360b47c5f63c.zip |
Enable payee mappings
Diffstat (limited to 'src/journal.cc')
-rw-r--r-- | src/journal.cc | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/journal.cc b/src/journal.cc index aaa53ea4..17fcb687 100644 --- a/src/journal.cc +++ b/src/journal.cc @@ -156,9 +156,10 @@ account_t * journal_t::register_account(const string& name, post_t * post, return result; } -string journal_t::register_payee(const string& name, xact_t * xact, - const string& location) +string journal_t::register_payee(const string& name, xact_t *, const string&) { + string payee; + #if 0 std::set<string>::iterator i = known_payees.find(name); @@ -180,18 +181,14 @@ string journal_t::register_payee(const string& name, xact_t * xact, } #endif -#if 0 - foreach (payee_mapping_t& value, context.journal.payee_mappings) { - if (value.first.match(next)) { - xact->payee = value.second; - break; - } + foreach (payee_mapping_t& value, payee_mappings) { + if (value.first.match(name)) { + payee = value.second; + break; } - if (xact->payee.empty()) - xact->payee = next; -#else - return name; -#endif + } + + return payee.empty() ? name : payee; } void journal_t::register_commodity(commodity_t& comm, |