Fix to handling of effective dates in xact_t::date().

This commit is contained in:
John Wiegley 2009-02-09 18:11:58 -04:00
parent 3925240c7b
commit 8a855f9b44

View file

@ -38,12 +38,18 @@ namespace ledger {
date_t xact_t::date() const 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) { if (! _date) {
assert(entry); assert(entry);
return entry->date(); return *entry->_date;
} }
return item_t::date(); return *_date;
} }
optional<date_t> xact_t::effective_date() const optional<date_t> xact_t::effective_date() const