diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-07 10:32:24 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-07 10:32:24 -0600 |
commit | b1107f85ae07a85124e58a0e379ec2d9ab47d119 (patch) | |
tree | a44d0e10642cc8989b64c2ea89c4bbbf98eb3774 /src | |
parent | 7bb83173dae617b8e754fff8e52390ff9664873b (diff) | |
download | fork-ledger-b1107f85ae07a85124e58a0e379ec2d9ab47d119.tar.gz fork-ledger-b1107f85ae07a85124e58a0e379ec2d9ab47d119.tar.bz2 fork-ledger-b1107f85ae07a85124e58a0e379ec2d9ab47d119.zip |
Removed value_t::price and balance_t::price
Diffstat (limited to 'src')
-rw-r--r-- | src/balance.cc | 10 | ||||
-rw-r--r-- | src/balance.h | 2 | ||||
-rw-r--r-- | src/py_balance.cc | 2 | ||||
-rw-r--r-- | src/py_value.cc | 3 | ||||
-rw-r--r-- | src/report.cc | 7 | ||||
-rw-r--r-- | src/report.h | 1 | ||||
-rw-r--r-- | src/value.cc | 12 | ||||
-rw-r--r-- | src/value.h | 2 |
8 files changed, 1 insertions, 38 deletions
diff --git a/src/balance.cc b/src/balance.cc index 4fba7344..08368dd8 100644 --- a/src/balance.cc +++ b/src/balance.cc @@ -202,16 +202,6 @@ balance_t::value(const optional<datetime_t>& moment, return resolved ? temp : optional<balance_t>(); } -balance_t balance_t::price() const -{ - balance_t temp; - - foreach (const amounts_map::value_type& pair, amounts) - temp += pair.second.price(); - - return temp; -} - optional<amount_t> balance_t::commodity_amount(const optional<const commodity_t&>& commodity) const { diff --git a/src/balance.h b/src/balance.h index 57e6ace4..921f87ef 100644 --- a/src/balance.h +++ b/src/balance.h @@ -387,8 +387,6 @@ public: value(const optional<datetime_t>& moment = none, const optional<commodity_t&>& in_terms_of = none) const; - balance_t price() const; - /** * Truth tests. An balance may be truth test in two ways: * diff --git a/src/py_balance.cc b/src/py_balance.cc index 6c9ccb24..38941832 100644 --- a/src/py_balance.cc +++ b/src/py_balance.cc @@ -201,8 +201,6 @@ void export_balance() .def("value", py_value_1, args("in_terms_of")) .def("value", py_value_2, args("in_terms_of", "moment")) - .def("price", &balance_t::price) - .def("__nonzero__", &balance_t::is_nonzero) .def("is_nonzero", &balance_t::is_nonzero) .def("is_zero", &balance_t::is_zero) diff --git a/src/py_value.cc b/src/py_value.cc index 949f2a49..78301acd 100644 --- a/src/py_value.cc +++ b/src/py_value.cc @@ -266,8 +266,7 @@ void export_value() .def("value", py_value_1, args("in_terms_of")) .def("value", py_value_2, args("in_terms_of", "moment")) - .def("value", &value_t::value, value_overloads()) - .def("price", &value_t::price) + //.def("value", &value_t::value, value_overloads()) .def("exchange_commodities", &value_t::exchange_commodities, exchange_commodities_overloads()) diff --git a/src/report.cc b/src/report.cc index b86f77eb..52e8c888 100644 --- a/src/report.cc +++ b/src/report.cc @@ -731,11 +731,6 @@ value_t report_t::fn_percent(call_scope_t& args) (args.get<amount_t>(0) / args.get<amount_t>(1)).number()); } -value_t report_t::fn_price(call_scope_t& args) -{ - return args[0].price(); -} - value_t report_t::fn_commodity(call_scope_t& args) { return string_value(args.get<amount_t>(0).commodity().symbol()); @@ -1278,8 +1273,6 @@ expr_t::ptr_op_t report_t::lookup(const symbol_t::kind_t kind, return WRAP_FUNCTOR(fn_false); else if (is_eq(p, "percent")) return MAKE_FUNCTOR(report_t::fn_percent); - else if (is_eq(p, "price")) - return MAKE_FUNCTOR(report_t::fn_price); else if (is_eq(p, "print")) return MAKE_FUNCTOR(report_t::fn_print); break; diff --git a/src/report.h b/src/report.h index 03eee78b..9541da43 100644 --- a/src/report.h +++ b/src/report.h @@ -169,7 +169,6 @@ public: value_t fn_format_date(call_scope_t& scope); value_t fn_ansify_if(call_scope_t& scope); value_t fn_percent(call_scope_t& scope); - value_t fn_price(call_scope_t& scope); value_t fn_commodity(call_scope_t& scope); value_t fn_lot_date(call_scope_t& scope); value_t fn_lot_price(call_scope_t& scope); diff --git a/src/value.cc b/src/value.cc index 2446c97a..de491e6c 100644 --- a/src/value.cc +++ b/src/value.cc @@ -1427,18 +1427,6 @@ value_t value_t::value(const optional<datetime_t>& moment, return NULL_VALUE; } -value_t value_t::price() const -{ - switch (type()) { - case AMOUNT: - return as_amount().price(); - case BALANCE: - return as_balance().price(); - default: - return *this; - } -} - value_t value_t::exchange_commodities(const std::string& commodities, const bool add_prices, const optional<datetime_t>& moment) diff --git a/src/value.h b/src/value.h index 1e4d0ce9..df075843 100644 --- a/src/value.h +++ b/src/value.h @@ -480,8 +480,6 @@ public: value_t value(const optional<datetime_t>& moment = none, const optional<commodity_t&>& in_terms_of = none) const; - value_t price() const; - value_t exchange_commodities(const std::string& commodities, const bool add_prices = false, const optional<datetime_t>& moment = none); |