summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/filters.cc11
-rw-r--r--src/filters.h1
-rw-r--r--test/regress/14DB77E7.test2
-rw-r--r--test/regress/9E0E606D.test19
4 files changed, 28 insertions, 5 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;
diff --git a/test/regress/14DB77E7.test b/test/regress/14DB77E7.test
index ee155afb..4d8734f9 100644
--- a/test/regress/14DB77E7.test
+++ b/test/regress/14DB77E7.test
@@ -13,6 +13,6 @@ P 2011-02-01 EUR 0.8576 GBP
test reg income:adse -X GBP -H
11-Jan-31 AdSense earnings Income:AdSense -11.00 EUR -11.00 EUR
-11-Feb-01 Commodities revalued <Revalued> -9.43 GBP -9.43 GBP
+11-Feb-28 Commodities revalued <Revalued> -9.43 GBP -9.43 GBP
11-Feb-28 AdSense earnings Income:AdSense -8.58 GBP -18.01 GBP
end test
diff --git a/test/regress/9E0E606D.test b/test/regress/9E0E606D.test
new file mode 100644
index 00000000..86b8e36f
--- /dev/null
+++ b/test/regress/9E0E606D.test
@@ -0,0 +1,19 @@
+D 1000.00 GBP
+
+P 2011-02-01 EUR 0.8576 GBP
+P 2011-03-01 EUR 0.8612 GBP
+P 2011-04-01 EUR 0.8510 GBP
+
+2011-01-31 * AdSense earnings
+ Assets:Receivable:AdSense 11.00 EUR
+ Income:AdSense
+
+2011-02-28 * AdSense earnings
+ Assets:Receivable:AdSense 10.00 EUR
+ Income:AdSense
+
+test reg income:ad -X GBP -H
+11-Jan-31 AdSense earnings Income:AdSense -11.00 EUR -11.00 EUR
+11-Feb-28 Commodities revalued <Revalued> -9.43 GBP -9.43 GBP
+11-Feb-28 AdSense earnings Income:AdSense -8.58 GBP -18.01 GBP
+end test