summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/filters.cc11
-rw-r--r--src/filters.h1
2 files changed, 8 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());
}
diff --git a/src/filters.h b/src/filters.h
index 1ef92bbe..d73fff86 100644
--- a/src/filters.h
+++ b/src/filters.h
@@ -576,6 +576,7 @@ class changed_value_posts : public item_handler<post_t>
expr_t& total_expr;
expr_t& display_total_expr;
bool changed_values_only;
+ bool historical_prices_only;
bool for_accounts_report;
bool show_unrealized;
post_t * last_post;