diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-01 21:15:11 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-01 21:15:11 -0500 |
commit | 449c7ca790f62b30594e845e0c1bab07c44850af (patch) | |
tree | 1f7c8b0bf422f854de8408bfd6b98fd7c4196e9b | |
parent | 52d1441646969797d4a0582c6344da46f56904e1 (diff) | |
download | fork-ledger-449c7ca790f62b30594e845e0c1bab07c44850af.tar.gz fork-ledger-449c7ca790f62b30594e845e0c1bab07c44850af.tar.bz2 fork-ledger-449c7ca790f62b30594e845e0c1bab07c44850af.zip |
New: --set-reported-account, --set-reported-payee
-rw-r--r-- | src/chain.cc | 11 | ||||
-rw-r--r-- | src/report.cc | 2 | ||||
-rw-r--r-- | src/report.h | 4 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/chain.cc b/src/chain.cc index db52269c..defa2e97 100644 --- a/src/chain.cc +++ b/src/chain.cc @@ -159,6 +159,17 @@ post_handler_ptr chain_post_handlers(report_t& report, handler.reset(new sort_posts(handler, "date")); } + if (report.HANDLED(set_reported_account_)) + handler.reset(new transfer_details(handler, transfer_details::SET_ACCOUNT, + report.session.journal->master, + report.HANDLER(set_reported_account_).str(), + report)); + else if (report.HANDLED(set_reported_payee_)) + handler.reset(new transfer_details(handler, transfer_details::SET_PAYEE, + report.session.journal->master, + report.HANDLER(set_reported_payee_).str(), + report)); + // related_posts will pass along all posts related to the post received. If // the `related_all' handler is on, then all the xact's posts are passed; // meaning that if one post of an xact is to be printed, all the post for diff --git a/src/report.cc b/src/report.cc index 9f15a2d5..60f6955c 100644 --- a/src/report.cc +++ b/src/report.cc @@ -664,6 +664,8 @@ option_t<report_t> * report_t::lookup_option(const char * p) case 's': OPT(set_account_); else OPT(set_payee_); + else OPT(set_reported_account_); + else OPT(set_reported_payee_); else OPT(sort_); else OPT(sort_all_); else OPT(sort_xacts_); diff --git a/src/report.h b/src/report.h index 0fe7d05b..e321cb44 100644 --- a/src/report.h +++ b/src/report.h @@ -284,6 +284,8 @@ public: HANDLER(seed_).report(out); HANDLER(set_account_).report(out); HANDLER(set_payee_).report(out); + HANDLER(set_reported_account_).report(out); + HANDLER(set_reported_payee_).report(out); HANDLER(sort_).report(out); HANDLER(sort_all_).report(out); HANDLER(sort_xacts_).report(out); @@ -805,6 +807,8 @@ public: OPTION(report_t, seed_); OPTION(report_t, set_account_); OPTION(report_t, set_payee_); + OPTION(report_t, set_reported_account_); + OPTION(report_t, set_reported_payee_); OPTION_(report_t, sort_, DO_(args) { // -S on_with(args[0].as_string(), args[1]); |