diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-07 09:49:17 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-07 09:49:17 -0400 |
commit | be6cef93c479056169ab499d03ea212ff22db435 (patch) | |
tree | fba78156e5187bd690f519846427284cdc0b0193 /src/balance.cc | |
parent | ae8ab8106218167036ef386159450b56c328f1b9 (diff) | |
download | fork-ledger-be6cef93c479056169ab499d03ea212ff22db435.tar.gz fork-ledger-be6cef93c479056169ab499d03ea212ff22db435.tar.bz2 fork-ledger-be6cef93c479056169ab499d03ea212ff22db435.zip |
A further simplification of -V and -X
With -X COMM, all values are computed in terms of COMM, regardless.
With -V, only secondary commodities will ever be computed, never
primaries. Further, if a secondary commodities has an associated price,
the valuation is done in terms of that price's commodity.
Diffstat (limited to 'src/balance.cc')
-rw-r--r-- | src/balance.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/balance.cc b/src/balance.cc index bfcd4a35..a8bc649d 100644 --- a/src/balance.cc +++ b/src/balance.cc @@ -185,16 +185,14 @@ balance_t& balance_t::operator/=(const amount_t& amt) } optional<balance_t> -balance_t::value(const bool primary_only, - const optional<datetime_t>& moment, +balance_t::value(const optional<datetime_t>& moment, const optional<commodity_t&>& in_terms_of) const { balance_t temp; bool resolved = false; foreach (const amounts_map::value_type& pair, amounts) { - if (optional<amount_t> val = pair.second.value(primary_only, moment, - in_terms_of)) { + if (optional<amount_t> val = pair.second.value(moment, in_terms_of)) { temp += *val; resolved = true; } else { |