diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-16 20:50:20 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-16 20:50:20 -0400 |
commit | 72cdb41727d53cc9e108b70c59d4adf3b8389a58 (patch) | |
tree | 937f635105e540c36a68c3aa18795099b5008f6f /src/filters.cc | |
parent | 15bfeb3cb1d04657d9fc7dc6120e5c460dc0db2b (diff) | |
download | fork-ledger-72cdb41727d53cc9e108b70c59d4adf3b8389a58.tar.gz fork-ledger-72cdb41727d53cc9e108b70c59d4adf3b8389a58.tar.bz2 fork-ledger-72cdb41727d53cc9e108b70c59d4adf3b8389a58.zip |
Added new --set-acount and --set-payee options
These fully generalize the previous --payee-as-account and such options,
which, for example, is now implemented to be the same as saying,
"--set-account payee".
Diffstat (limited to 'src/filters.cc')
-rw-r--r-- | src/filters.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/filters.cc b/src/filters.cc index 65fa92db..1deffffb 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -573,7 +573,19 @@ void transfer_details::operator()(xact_t& xact) temp.add_flags(ITEM_TEMP); entry.add_xact(&temp); - set_details(entry, temp); + bind_scope_t bound_scope(scope, temp); + + switch (which_element) { + case SET_PAYEE: + entry.payee = expr.calc(bound_scope).to_string(); + break; + case SET_ACCOUNT: + temp.account = master->find_account(expr.calc(bound_scope).to_string()); + break; + default: + assert(false); + break; + } item_handler<xact_t>::operator()(temp); } |