summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/annotate.cc3
-rw-r--r--src/commodity.cc2
-rw-r--r--src/filters.cc9
-rw-r--r--src/temps.cc8
-rw-r--r--src/temps.h3
-rw-r--r--test/regress/A560FDAD.test1
6 files changed, 18 insertions, 8 deletions
diff --git a/src/annotate.cc b/src/annotate.cc
index 25f0e582..98635ad7 100644
--- a/src/annotate.cc
+++ b/src/annotate.cc
@@ -328,7 +328,8 @@ annotated_commodity_t::strip_annotations(const keep_details_t& what_to_keep)
if ((keep_price && details.price) ||
(keep_date && details.date) ||
(keep_tag && details.tag) ||
- details.value_expr)
+ (details.value_expr &&
+ ! details.has_flags(ANNOTATION_VALUE_EXPR_CALCULATED)))
{
new_comm = pool().find_or_create
(referent(), annotation_t(keep_price ? details.price : none,
diff --git a/src/commodity.cc b/src/commodity.cc
index 5335d8a8..51b8f29c 100644
--- a/src/commodity.cc
+++ b/src/commodity.cc
@@ -221,6 +221,8 @@ commodity_t& commodity_t::nail_down(const expr_t& expr)
{
annotation_t new_details;
new_details.value_expr = expr;
+ new_details.add_flags(ANNOTATION_VALUE_EXPR_CALCULATED);
+
commodity_t * new_comm =
commodity_pool_t::current_pool->find_or_create(symbol(), new_details);
return *new_comm;
diff --git a/src/filters.cc b/src/filters.cc
index 02dc392b..58e5fcaf 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -340,9 +340,10 @@ namespace {
const bool act_date_p = true,
const value_t& total = value_t(),
const bool direct_amount = false,
- const bool mark_visited = false)
+ const bool mark_visited = false,
+ const bool bidir_link = true)
{
- post_t& post = temps.create_post(*xact, account);
+ post_t& post = temps.create_post(*xact, account, bidir_link);
post.add_flags(ITEM_GENERATED);
// If the account for this post is all virtual, then report the post as
@@ -566,7 +567,9 @@ bool display_filter_posts::output_rounding(post_t& post)
/* date= */ date_t(),
/* act_date_p= */ true,
/* total= */ precise_display_total,
- /* direct_amount= */ true);
+ /* direct_amount= */ true,
+ /* mark_visited= */ false,
+ /* bidir_link= */ false);
}
}
if (show_rounding)
diff --git a/src/temps.cc b/src/temps.cc
index cb471d41..881077f6 100644
--- a/src/temps.cc
+++ b/src/temps.cc
@@ -81,7 +81,8 @@ post_t& temporaries_t::copy_post(post_t& origin, xact_t& xact,
return temp;
}
-post_t& temporaries_t::create_post(xact_t& xact, account_t * account)
+post_t& temporaries_t::create_post(xact_t& xact, account_t * account,
+ bool bidir_link)
{
if (! post_temps)
post_temps = std::list<post_t>();
@@ -93,7 +94,10 @@ post_t& temporaries_t::create_post(xact_t& xact, account_t * account)
temp.account = account;
temp.account->add_post(&temp);
- xact.add_post(&temp);
+ if (bidir_link)
+ xact.add_post(&temp);
+ else
+ temp.xact = &xact;
return temp;
}
diff --git a/src/temps.h b/src/temps.h
index f41c487c..daa1493b 100644
--- a/src/temps.h
+++ b/src/temps.h
@@ -66,7 +66,8 @@ public:
}
post_t& copy_post(post_t& origin, xact_t& xact,
account_t * account = NULL);
- post_t& create_post(xact_t& xact, account_t * account);
+ post_t& create_post(xact_t& xact, account_t * account,
+ bool bidir_link = true);
post_t& last_post() {
return post_temps->back();
}
diff --git a/test/regress/A560FDAD.test b/test/regress/A560FDAD.test
index b30ea086..ee19e71e 100644
--- a/test/regress/A560FDAD.test
+++ b/test/regress/A560FDAD.test
@@ -82,5 +82,4 @@ test reg -X EUR -H
Expenses:Test 304.82 EUR -2606.99 EUR
<Adjustment> -0.01 EUR -2607.00 EUR
Assets:Current 2612.80 EUR 5.80 EUR
- <Adjustment> 0.01 EUR 5.82 EUR
end test