summaryrefslogtreecommitdiff
path: root/src/report.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-09 01:23:38 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-09 02:22:50 -0400
commitfc09b69fb765dc934be10d0544b1366f86f21ee2 (patch)
tree755313686184c4f538c27f12c474266f61d22148 /src/report.h
parent524c98244ec19e6a0368deb1e05c69955bcf2e34 (diff)
downloadfork-ledger-fc09b69fb765dc934be10d0544b1366f86f21ee2.tar.gz
fork-ledger-fc09b69fb765dc934be10d0544b1366f86f21ee2.tar.bz2
fork-ledger-fc09b69fb765dc934be10d0544b1366f86f21ee2.zip
Fixed interaction with -V/X and grouped postings
With -s, -M/Y/D, -n, and a few other flags, postings get "grouped" into meta-transactions that contain more postings than before. In all these cases, -V use the date of the *earliest* posting in that group, which makes little sense and caused breakages with -J. It now uses the latest date. Fixes #197 / 68EAF363-D0FE-4127-866E-A5AEBACB65D6
Diffstat (limited to 'src/report.h')
-rw-r--r--src/report.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/report.h b/src/report.h
index e4eaeaaa..f8fdf507 100644
--- a/src/report.h
+++ b/src/report.h
@@ -586,16 +586,16 @@ public:
"use_direct_amount ? amount :"
" (is_seq(get_at(amount_expr, 0)) ?"
" get_at(get_at(amount_expr, 0), 0) :"
- " market(get_at(amount_expr, 0), date, exchange)"
+ " market(get_at(amount_expr, 0), value_date, exchange)"
" - get_at(amount_expr, 1))");
parent->HANDLER(revalued_total_)
.set_expr(string("--gain"),
- "(market(get_at(total_expr, 0), date, exchange), "
+ "(market(get_at(total_expr, 0), value_date, exchange), "
"get_at(total_expr, 1))");
parent->HANDLER(display_total_)
.set_expr(string("--gain"),
"use_direct_amount ? total_expr :"
- " market(get_at(total_expr, 0), date, exchange)"
+ " market(get_at(total_expr, 0), value_date, exchange)"
" - get_at(total_expr, 1)");
});
@@ -642,9 +642,11 @@ public:
OPTION_(report_t, market, DO() { // -V
parent->HANDLER(revalued).on_only(string("--market"));
parent->HANDLER(display_amount_)
- .set_expr(string("--market"), "market(amount_expr, date, exchange)");
+ .set_expr(string("--market"),
+ "market(amount_expr, value_date, exchange)");
parent->HANDLER(display_total_)
- .set_expr(string("--market"), "market(total_expr, date, exchange)");
+ .set_expr(string("--market"),
+ "market(total_expr, value_date, exchange)");
});
OPTION(report_t, meta_);