Do not record market values for fixated exchanges
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.
This commit is contained in:
parent
71de29d2d5
commit
fc7e67f403
1 changed files with 7 additions and 1 deletions
|
|
@ -254,7 +254,13 @@ commodity_pool_t::exchange(const amount_t& amount,
|
|||
|
||||
DEBUG("commodity.prices.add", "exchange: per-unit-cost = " << per_unit_cost);
|
||||
|
||||
if (! per_unit_cost.is_realzero())
|
||||
// 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() &&
|
||||
(current_annotation == NULL ||
|
||||
! (current_annotation->price &&
|
||||
current_annotation->has_flags(ANNOTATION_PRICE_FIXATED))))
|
||||
exchange(commodity, per_unit_cost, moment ? *moment : CURRENT_TIME());
|
||||
|
||||
cost_breakdown_t breakdown;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue