summaryrefslogtreecommitdiff
path: root/src/pool.cc
diff options
context:
space:
mode:
authorJohn Wiegley <jwiegley@gmail.com>2017-10-30 10:26:46 -0700
committerGitHub <noreply@github.com>2017-10-30 10:26:46 -0700
commit3e0877aed95d3628b4f86925c120c0ed08b51b63 (patch)
treec1206dd2dec27a299412a81c19fecca787232293 /src/pool.cc
parenta8a9c1a5284ddb3b497a6ade13901f04b3e33870 (diff)
parent0f70cca098542d49ef7a6180c576cd8be19f7994 (diff)
downloadfork-ledger-3e0877aed95d3628b4f86925c120c0ed08b51b63.tar.gz
fork-ledger-3e0877aed95d3628b4f86925c120c0ed08b51b63.tar.bz2
fork-ledger-3e0877aed95d3628b4f86925c120c0ed08b51b63.zip
Merge pull request #496 from immae/strip_annotation
Strip annotation before adding exchange value
Diffstat (limited to 'src/pool.cc')
-rw-r--r--src/pool.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pool.cc b/src/pool.cc
index 931a1708..e5f5ad36 100644
--- a/src/pool.cc
+++ b/src/pool.cc
@@ -262,6 +262,9 @@ commodity_pool_t::exchange(const amount_t& amount,
if (! cost.has_commodity())
per_unit_cost.clear_commodity();
+ if (cost.has_annotation())
+ per_unit_cost = per_unit_cost.strip_annotations(keep_details_t());
+
DEBUG("commodity.prices.add", "exchange: per-unit-cost = " << per_unit_cost);
// Do not record commodity exchanges where amount's commodity has a