summaryrefslogtreecommitdiff
path: root/src/report.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-10 21:58:43 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-03-10 21:58:43 -0600
commit6ddd935e4a140d77b9f94beeed1c76286c9cc1ca (patch)
treeb06195144a48efdc6c84c559bbc502d418c01d02 /src/report.cc
parent2a4d7e1af0ac18693b0c1ffa39daa4ad51e1492f (diff)
downloadfork-ledger-6ddd935e4a140d77b9f94beeed1c76286c9cc1ca.tar.gz
fork-ledger-6ddd935e4a140d77b9f94beeed1c76286c9cc1ca.tar.bz2
fork-ledger-6ddd935e4a140d77b9f94beeed1c76286c9cc1ca.zip
--percent now plays well with -X and -V
Diffstat (limited to 'src/report.cc')
-rw-r--r--src/report.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/report.cc b/src/report.cc
index bd2df046..2b07efcb 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -162,6 +162,15 @@ void report_t::normalize_options(const string& verb)
terminus);
}
+ if (HANDLED(percent) && HANDLED(market)) {
+ HANDLER(total_)
+ .on("?normalize",
+ "(__tmp = market(parent.total, value_date, exchange);"
+ " ((is_account & parent & __tmp) ?"
+ " percent(scrub(market(total, value_date, exchange)), "
+ " scrub(__tmp)) : 0))");
+ }
+
if (HANDLED(immediate) && HANDLED(market)) {
HANDLER(amount_)
.on("?normalize", "market(amount_expr, value_date, exchange)");