summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2014-12-01 15:09:48 -0600
committerJohn Wiegley <johnw@newartisans.com>2014-12-01 15:09:48 -0600
commita953fe6cbcd7ad7700137a382eacc3ed2e6c9abf (patch)
tree7d2334f5714f02f391cbc05d37b9519d9d0c671c
parenta32913d7acd174b2245f6a73eb55cc267c415960 (diff)
parent3e1f6670fc4d9629098779062b80a8d868709f43 (diff)
downloadfork-ledger-a953fe6cbcd7ad7700137a382eacc3ed2e6c9abf.tar.gz
fork-ledger-a953fe6cbcd7ad7700137a382eacc3ed2e6c9abf.tar.bz2
fork-ledger-a953fe6cbcd7ad7700137a382eacc3ed2e6c9abf.zip
Merge pull request #336 from csrhodes/master
support date as well as datetime in Balance.value()
-rw-r--r--src/py_balance.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/py_balance.cc b/src/py_balance.cc
index dec08a51..ff6e75f8 100644
--- a/src/py_balance.cc
+++ b/src/py_balance.cc
@@ -56,6 +56,11 @@ namespace {
const datetime_t& moment) {
return balance.value(moment, in_terms_of);
}
+ boost::optional<balance_t> py_value_2d(const balance_t& balance,
+ const commodity_t * in_terms_of,
+ const date_t& moment) {
+ return balance.value(datetime_t(moment), in_terms_of);
+ }
boost::optional<amount_t>
py_commodity_amount_0(const balance_t& balance) {
@@ -200,6 +205,7 @@ void export_balance()
.def("value", py_value_0)
.def("value", py_value_1, args("in_terms_of"))
.def("value", py_value_2, args("in_terms_of", "moment"))
+ .def("value", py_value_2d, args("in_terms_of", "moment"))
.def("__nonzero__", &balance_t::is_nonzero)
.def("is_nonzero", &balance_t::is_nonzero)