From 72cdb41727d53cc9e108b70c59d4adf3b8389a58 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 16 Feb 2009 20:50:20 -0400 Subject: 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". --- src/filters.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/filters.cc') 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::operator()(temp); } -- cgit v1.2.3