summaryrefslogtreecommitdiff
path: root/src/report.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-27 08:04:59 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-27 08:30:59 -0400
commitfd23b56a21ef2374538541599b82bdde3dbe1d18 (patch)
treed652052ec2d68cbf0f1adfc3a657896711b0d683 /src/report.cc
parent88460db2fbb0ab76c0ab3705cc4043e7fb2726d4 (diff)
downloadfork-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.cc12
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':