diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-26 00:56:47 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-26 03:16:39 -0400 |
commit | d58797e98c82ced16fbc0a213fd104fb72a9de08 (patch) | |
tree | cecde49eece8edc80e334f74895e0861a56c0fdb /src/report.h | |
parent | 74e569e220bee08d6c9eda59b5e4021748344994 (diff) | |
download | fork-ledger-d58797e98c82ced16fbc0a213fd104fb72a9de08.tar.gz fork-ledger-d58797e98c82ced16fbc0a213fd104fb72a9de08.tar.bz2 fork-ledger-d58797e98c82ced16fbc0a213fd104fb72a9de08.zip |
The -B, -G, -V reports now show rounding amounts
This way, if the running total is off by a penny or two due to rounding
of one or more commodities in the account, the user will see it.
This commit also reorganizes the testing code a bit, which I did after
adding the ninth test series (ConfirmTests), to validate the new
rounding code.
Diffstat (limited to 'src/report.h')
-rw-r--r-- | src/report.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/report.h b/src/report.h index 6839de0e..1d867c68 100644 --- a/src/report.h +++ b/src/report.h @@ -245,7 +245,7 @@ public: OPTION(report_t, base); OPTION_(report_t, basis, DO() { // -B - parent->HANDLER(revalued).off(); + parent->HANDLER(revalued).on_only(); parent->HANDLER(amount_).set_expr("rounded(cost)"); }); @@ -401,15 +401,17 @@ public: // Since we are displaying the amounts of revalued postings, they // will end up being composite totals, and hence a pair of pairs. parent->HANDLER(display_amount_) - .set_expr("is_seq(get_at(amount_expr, 0)) ?" - " get_at(get_at(amount_expr, 0), 0) :" - " market(get_at(amount_expr, 0), date, exchange) -" - " get_at(amount_expr, 1)"); + .set_expr("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)" + " - get_at(amount_expr, 1))"); parent->HANDLER(revalued_total_) .set_expr("(market(get_at(total_expr, 0), date, exchange), " "get_at(total_expr, 1))"); parent->HANDLER(display_total_) - .set_expr("market(get_at(total_expr, 0), date, exchange)" + .set_expr("use_direct_amount ? total_expr :" + " market(get_at(total_expr, 0), date, exchange)" " - get_at(total_expr, 1)"); }); |