diff options
author | John Wiegley <johnw@newartisans.com> | 2009-01-19 22:24:56 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-01-19 22:24:56 -0400 |
commit | d9197fc2e5e5283d114ef9a1821d200b56529428 (patch) | |
tree | 14e38e5f0f29e3b85f085619ff3acb9f247e2ec1 /src/commodity.cc | |
parent | 14b3eb89f58301ecd21489ad380eb533d22a4c71 (diff) | |
download | fork-ledger-d9197fc2e5e5283d114ef9a1821d200b56529428.tar.gz fork-ledger-d9197fc2e5e5283d114ef9a1821d200b56529428.tar.bz2 fork-ledger-d9197fc2e5e5283d114ef9a1821d200b56529428.zip |
Changed COMMODITY_STYLE_NOMARKET TO COMMODITY_NOMARKET.
Diffstat (limited to 'src/commodity.cc')
-rw-r--r-- | src/commodity.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/commodity.cc b/src/commodity.cc index 113c1538..515b3946 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -183,7 +183,7 @@ optional<price_point_t> } #if 0 - if (! has_flags(COMMODITY_STYLE_NOMARKET) && parent().get_quote) { + if (! has_flags(COMMODITY_NOMARKET) && parent().get_quote) { if (optional<amount_t> quote = parent().get_quote (*this, age, moment, (hist && hist->prices.size() > 0 ? @@ -390,7 +390,10 @@ void commodity_t::exchange(commodity_t& commodity, const amount_t& per_unit_cost, const datetime_t& moment) { - if (! commodity.has_flags(COMMODITY_STYLE_NOMARKET)) { + if (! commodity.has_flags(COMMODITY_NOMARKET)) { + DEBUG("commodity.prices", "exchanging commodity " << commodity + << " at per unit cost " << per_unit_cost << " on " << moment); + commodity_t& base_commodity (commodity.annotated ? as_annotated_commodity(commodity).referent() : commodity); @@ -439,7 +442,7 @@ commodity_t::exchange(const amount_t& amount, // (if (and moment (not (commodity-no-market-price-p base-commodity))) // (add-price base-commodity per-unit-cost moment)) - if (moment && ! commodity.has_flags(COMMODITY_STYLE_NOMARKET)) + if (moment && ! commodity.has_flags(COMMODITY_NOMARKET)) base_commodity.add_price(*moment, per_unit_cost); // ;; returns: ANNOTATED-AMOUNT TOTAL-COST BASIS-COST @@ -759,7 +762,7 @@ commodity_pool_t::commodity_pool_t() : default_commodity(NULL) { TRACE_CTOR(commodity_pool_t, ""); null_commodity = create(""); - null_commodity->add_flags(COMMODITY_BUILTIN | COMMODITY_STYLE_NOMARKET); + null_commodity->add_flags(COMMODITY_BUILTIN | COMMODITY_NOMARKET); } commodity_t * commodity_pool_t::create(const string& symbol) |