summaryrefslogtreecommitdiff
path: root/src/pool.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2014-05-08 19:22:17 +0000
committerJohn Wiegley <johnw@newartisans.com>2014-05-08 14:28:07 -0500
commitbd8a1a67560f1ff8c443351b55b4731f1be04126 (patch)
tree71b94cf5fef51f2b3e76ba8b41e02e2fa6613f8d /src/pool.cc
parent55ecb9fb62437a8a3a53cfd019392bcbf78f3214 (diff)
downloadfork-ledger-bd8a1a67560f1ff8c443351b55b4731f1be04126.tar.gz
fork-ledger-bd8a1a67560f1ff8c443351b55b4731f1be04126.tar.bz2
fork-ledger-bd8a1a67560f1ff8c443351b55b4731f1be04126.zip
Use the POST_COST_VIRTUAL flag when exchange commodities
Fixes #999
Diffstat (limited to 'src/pool.cc')
-rw-r--r--src/pool.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pool.cc b/src/pool.cc
index 4526ac0c..71bfab72 100644
--- a/src/pool.cc
+++ b/src/pool.cc
@@ -267,7 +267,8 @@ commodity_pool_t::exchange(const amount_t& amount,
// Do not record commodity exchanges where amount's commodity has a
// fixated price, since this does not establish a market value for the
// base commodity.
- if (! per_unit_cost.is_realzero() &&
+ if (add_price &&
+ ! per_unit_cost.is_realzero() &&
(current_annotation == NULL ||
! (current_annotation->price &&
current_annotation->has_flags(ANNOTATION_PRICE_FIXATED))) &&