summaryrefslogtreecommitdiff
path: root/src/report.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-06-21 18:07:27 +0100
committerJohn Wiegley <johnw@newartisans.com>2009-06-21 18:07:27 +0100
commit521b935aa8ef68ac3a8a1fe1a37eed39b41eec95 (patch)
treeb7e482b7ea2d7725387046fdd6523e0f15f1dfa3 /src/report.h
parent7287aad336161eb9a143f188c92d462e62051374 (diff)
downloadfork-ledger-521b935aa8ef68ac3a8a1fe1a37eed39b41eec95.tar.gz
fork-ledger-521b935aa8ef68ac3a8a1fe1a37eed39b41eec95.tar.bz2
fork-ledger-521b935aa8ef68ac3a8a1fe1a37eed39b41eec95.zip
Restored --percent option, added baseline test
Diffstat (limited to 'src/report.h')
-rw-r--r--src/report.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/report.h b/src/report.h
index cad4b5ba..c091487b 100644
--- a/src/report.h
+++ b/src/report.h
@@ -155,6 +155,7 @@ public:
value_t fn_join(call_scope_t& scope);
value_t fn_format_date(call_scope_t& scope);
value_t fn_ansify_if(call_scope_t& scope);
+ value_t fn_percent(call_scope_t& scope);
#if 0
value_t fn_now(call_scope_t&) {
@@ -248,7 +249,7 @@ public:
HANDLER(pager_).report(out);
HANDLER(payee_as_account).report(out);
HANDLER(pending).report(out);
- HANDLER(percentage).report(out);
+ HANDLER(percent).report(out);
HANDLER(period_).report(out);
HANDLER(period_sort_).report(out);
HANDLER(plot_amount_format_).report(out);
@@ -582,7 +583,11 @@ public:
parent->HANDLER(limit_).on(string("--pending"), "pending");
});
- OPTION(report_t, percentage); // -%
+ OPTION_(report_t, percent, DO() { // -%
+ parent->HANDLER(total_)
+ .set_expr(string("--percent"),
+ "is_account&parent&parent.total&percent(total, parent.total)");
+ });
OPTION__
(report_t, period_, // -p