From fd23b56a21ef2374538541599b82bdde3dbe1d18 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 27 Oct 2009 08:04:59 -0400 Subject: Added a new "cleared" report This is a balance report with three columns: Current balance | Cleared balance | Last cleared date --- src/report.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/report.cc') 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 + (new format_accounts(*this, report_format(HANDLER(cleared_format_))), + *this, "#cleared")); + } break; case 'e': -- cgit v1.2.3