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/chain.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/chain.cc')
-rw-r--r-- | src/chain.cc | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/chain.cc b/src/chain.cc index 64881c6f..1d24aafb 100644 --- a/src/chain.cc +++ b/src/chain.cc @@ -195,16 +195,36 @@ xact_handler_ptr chain_xact_handlers(report_t& report, report)); } - if (report.HANDLED(comm_as_payee)) - handler.reset(new set_comm_as_payee(handler)); + if (report.HANDLED(set_account_)) + handler.reset(new transfer_details(handler, transfer_details::SET_ACCOUNT, + report.session.master.get(), + report.HANDLER(set_account_).str(), + report)); + else if (report.HANDLED(set_payee_)) + handler.reset(new transfer_details(handler, transfer_details::SET_PAYEE, + report.session.master.get(), + report.HANDLER(set_payee_).str(), + report)); + else if (report.HANDLED(comm_as_payee)) + handler.reset(new transfer_details(handler, transfer_details::SET_PAYEE, + report.session.master.get(), + expr_t("commodity"), report)); else if (report.HANDLED(code_as_payee)) - handler.reset(new set_code_as_payee(handler)); + handler.reset(new transfer_details(handler, transfer_details::SET_PAYEE, + report.session.master.get(), + expr_t("code"), report)); else if (report.HANDLED(payee_as_account)) - handler.reset(new set_payee_as_account(handler, report.session.master.get())); + handler.reset(new transfer_details(handler, transfer_details::SET_ACCOUNT, + report.session.master.get(), + expr_t("payee"), report)); else if (report.HANDLED(comm_as_account)) - handler.reset(new set_comm_as_account(handler, report.session.master.get())); + handler.reset(new transfer_details(handler, transfer_details::SET_ACCOUNT, + report.session.master.get(), + expr_t("commodity"), report)); else if (report.HANDLED(code_as_account)) - handler.reset(new set_code_as_account(handler, report.session.master.get())); + handler.reset(new transfer_details(handler, transfer_details::SET_ACCOUNT, + report.session.master.get(), + expr_t("code"), report)); return handler; } |