summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-18 02:33:25 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-03-18 02:33:25 -0500
commit20edb3a34069b33ec83846c3026138d8fa432c97 (patch)
tree626bd28a8dfb369a871c2f609c28e43f775447b1 /src/filters.cc
parent47d7f5a43b286b3c736e21480d84caf75cea885f (diff)
downloadfork-ledger-20edb3a34069b33ec83846c3026138d8fa432c97.tar.gz
fork-ledger-20edb3a34069b33ec83846c3026138d8fa432c97.tar.bz2
fork-ledger-20edb3a34069b33ec83846c3026138d8fa432c97.zip
Fixed bug relating to historical pricing
Fixes #681
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/filters.cc b/src/filters.cc
index 6fedd7ce..749efc77 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -593,6 +593,7 @@ changed_value_posts::changed_value_posts
report.HANDLER(display_total_).expr),
display_total_expr(report.HANDLER(display_total_).expr),
changed_values_only(report.HANDLED(revalued_only)),
+ historical_prices_only(report.HANDLED(historical)),
for_accounts_report(_for_accounts_report),
show_unrealized(_show_unrealized), last_post(NULL),
display_filter(_display_filter)
@@ -624,9 +625,11 @@ changed_value_posts::changed_value_posts
void changed_value_posts::flush()
{
if (last_post && last_post->date() <= report.terminus.date()) {
- if (! for_accounts_report)
- output_intermediate_prices(*last_post, report.terminus.date());
- output_revaluation(*last_post, report.terminus.date());
+ if (! historical_prices_only) {
+ if (! for_accounts_report)
+ output_intermediate_prices(*last_post, report.terminus.date());
+ output_revaluation(*last_post, report.terminus.date());
+ }
last_post = NULL;
}
item_handler<post_t>::flush();
@@ -807,7 +810,7 @@ void changed_value_posts::output_intermediate_prices(post_t& post,
void changed_value_posts::operator()(post_t& post)
{
if (last_post) {
- if (! for_accounts_report)
+ if (! for_accounts_report && ! historical_prices_only)
output_intermediate_prices(*last_post, post.value_date());
output_revaluation(*last_post, post.value_date());
}