diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-27 08:04:59 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-27 08:30:59 -0400 |
commit | fd23b56a21ef2374538541599b82bdde3dbe1d18 (patch) | |
tree | d652052ec2d68cbf0f1adfc3a657896711b0d683 /src/report.cc | |
parent | 88460db2fbb0ab76c0ab3705cc4043e7fb2726d4 (diff) | |
download | fork-ledger-fd23b56a21ef2374538541599b82bdde3dbe1d18.tar.gz fork-ledger-fd23b56a21ef2374538541599b82bdde3dbe1d18.tar.bz2 fork-ledger-fd23b56a21ef2374538541599b82bdde3dbe1d18.zip |
Added a new "cleared" report
This is a balance report with three columns:
Current balance | Cleared balance | Last cleared date
Diffstat (limited to 'src/report.cc')
-rw-r--r-- | src/report.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/report.cc b/src/report.cc index 2f932115..7f31b615 100644 --- a/src/report.cc +++ b/src/report.cc @@ -721,11 +721,21 @@ expr_t::ptr_op_t report_t::lookup(const string& name) break; case 'c': - if (is_eq(q, "csv")) + if (is_eq(q, "csv")) { return WRAP_FUNCTOR (reporter<> (new format_posts(*this, report_format(HANDLER(csv_format_))), *this, "#csv")); + } + else if (is_eq(q, "cleared")) { + HANDLER(amount_).set_expr(string("#cleared"), + "(amount, cleared ? amount : 0)"); + + return expr_t::op_t::wrap_functor + (reporter<account_t, acct_handler_ptr, &report_t::accounts_report> + (new format_accounts(*this, report_format(HANDLER(cleared_format_))), + *this, "#cleared")); + } break; case 'e': |