summaryrefslogtreecommitdiff
path: root/journal.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 /journal.cc
parent0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c (diff)
downloadfork-ledger-539370ff1b37772e9f11439f652ffd3583beeedb.tar.gz
fork-ledger-539370ff1b37772e9f11439f652ffd3583beeedb.tar.bz2
fork-ledger-539370ff1b37772e9f11439f652ffd3583beeedb.zip
More refactoring
Diffstat (limited to 'journal.cc')
-rw-r--r--journal.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/journal.cc b/journal.cc
index 1bf31dd6..db914412 100644
--- a/journal.cc
+++ b/journal.cc
@@ -22,16 +22,16 @@ transaction_t::~transaction_t()
if (cost) delete cost;
}
-ptime transaction_t::actual_date() const
+moment_t transaction_t::actual_date() const
{
- if (_date.is_not_a_date_time() && entry)
+ if (! is_valid_moment(_date) && entry)
return entry->actual_date();
return _date;
}
-ptime transaction_t::effective_date() const
+moment_t transaction_t::effective_date() const
{
- if (_date_eff.is_not_a_date_time() && entry)
+ if (! is_valid_moment(_date_eff) && entry)
return entry->effective_date();
return _date_eff;
}
@@ -181,7 +181,7 @@ bool entry_base_t::finalize()
! (*x)->amount.commodity().annotated)
(*x)->amount.annotate_commodity
(per_unit_cost.abs(),
- entry ? entry->actual_date() : ptime(),
+ entry ? entry->actual_date() : moment_t(),
entry ? entry->code : "");
(*x)->cost = new amount_t(- (per_unit_cost * (*x)->amount.number()));
@@ -310,7 +310,7 @@ void entry_t::add_transaction(transaction_t * xact)
bool entry_t::valid() const
{
- if (_date.is_not_a_date_time() || ! journal) {
+ if (! is_valid_moment(_date) || ! journal) {
DEBUG_PRINT("ledger.validate", "entry_t: ! _date || ! journal");
return false;
}