summaryrefslogtreecommitdiff
path: root/balance.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-04-20 02:13:48 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:28 -0400
commit539370ff1b37772e9f11439f652ffd3583beeedb (patch)
tree69e8b0a0aee571d7335eae4c6693829745de1484 /balance.cc
parent0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c (diff)
downloadledger-539370ff1b37772e9f11439f652ffd3583beeedb.tar.gz
ledger-539370ff1b37772e9f11439f652ffd3583beeedb.tar.bz2
ledger-539370ff1b37772e9f11439f652ffd3583beeedb.zip
More refactoring
Diffstat (limited to 'balance.cc')
-rw-r--r--balance.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/balance.cc b/balance.cc
index 71daf0f7..be2d348c 100644
--- a/balance.cc
+++ b/balance.cc
@@ -33,7 +33,7 @@ amount_t balance_t::amount(const commodity_t& commodity) const
return amount_t();
}
-balance_t balance_t::value(const ptime& moment) const
+balance_t balance_t::value(const moment_t& moment) const
{
balance_t temp;
@@ -57,18 +57,18 @@ balance_t balance_t::price() const
return temp;
}
-ptime balance_t::date() const
+moment_t balance_t::date() const
{
- ptime temp;
+ moment_t temp;
for (amounts_map::const_iterator i = amounts.begin();
i != amounts.end();
i++) {
- ptime tdate = (*i).second.date();
- if (temp.is_not_a_date_time() && ! tdate.is_not_a_date_time())
+ moment_t tdate = (*i).second.date();
+ if (! is_valid_moment(temp) && is_valid_moment(tdate))
temp = tdate;
else if (temp != tdate)
- return ptime();
+ return moment_t();
}
return temp;
}