summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-09 18:11:58 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-09 18:11:58 -0400
commit8a855f9b447a933daaeb332826dab5956c04fc6f (patch)
treeba8f46f03f92a366c38bde004fa0b63c538d2a20 /src
parent3925240c7b2c7f8a90b4274ff312d6962fd474f7 (diff)
downloadledger-8a855f9b447a933daaeb332826dab5956c04fc6f.tar.gz
ledger-8a855f9b447a933daaeb332826dab5956c04fc6f.tar.bz2
ledger-8a855f9b447a933daaeb332826dab5956c04fc6f.zip
Fix to handling of effective dates in xact_t::date().
Diffstat (limited to 'src')
-rw-r--r--src/xact.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/xact.cc b/src/xact.cc
index b9fb0e2f..5a0a14c8 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -38,12 +38,18 @@ namespace ledger {
date_t xact_t::date() const
{
- // jww (2009-02-06): Why isn't reported_date called here?
+ if (item_t::use_effective_date) {
+ if (_date_eff)
+ return *_date_eff;
+ else if (entry && entry->_date_eff)
+ return *entry->_date_eff;
+ }
+
if (! _date) {
assert(entry);
- return entry->date();
+ return *entry->_date;
}
- return item_t::date();
+ return *_date;
}
optional<date_t> xact_t::effective_date() const