diff options
-rw-r--r-- | src/textual.cc | 3 | ||||
-rw-r--r-- | src/xact.cc | 2 | ||||
-rw-r--r-- | src/xact.h | 15 |
3 files changed, 7 insertions, 13 deletions
diff --git a/src/textual.cc b/src/textual.cc index cbd67352..c2976ee1 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -524,6 +524,7 @@ void instance_t::automated_xact_directive(char * line) journal.auto_xacts.push_back(ae.get()); + ae->journal = &journal; ae->pos = position_t(); ae->pos->pathname = pathname; ae->pos->beg_pos = pos; @@ -559,6 +560,7 @@ void instance_t::period_xact_directive(char * line) if (parse_posts(account_stack.front(), *pe.get())) { reveal_context = true; + pe->journal = &journal; if (pe->finalize()) { extend_xact_base(&journal, *pe.get(), true); @@ -574,6 +576,7 @@ void instance_t::period_xact_directive(char * line) pe.release(); } else { + pe->journal = NULL; throw parse_error(_("Period transaction failed to balance")); } } diff --git a/src/xact.cc b/src/xact.cc index 1ab54bdf..34b8c340 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -457,7 +457,7 @@ bool xact_t::valid() const DEBUG("ledger.validate", "xact_t: ! _date"); return false; } - if (! journal) { + if (! has_flags(ITEM_GENERATED | ITEM_TEMP) && ! journal) { DEBUG("ledger.validate", "xact_t: ! journal"); return false; } @@ -79,7 +79,9 @@ public: virtual bool remove_post(post_t * post); virtual bool finalize(); - virtual bool valid() const = 0; + virtual bool valid() const { + return true; + } #if defined(HAVE_BOOST_SERIALIZATION) private: @@ -179,9 +181,6 @@ public: } virtual void extend_xact(xact_base_t& xact, bool post); - virtual bool valid() const { - return true; - } #if defined(HAVE_BOOST_SERIALIZATION) private: @@ -262,14 +261,6 @@ class period_xact_t : public xact_base_t TRACE_DTOR(period_xact_t); } - virtual bool valid() const { - if (! period.is_valid()) { - DEBUG("ledger.validate", "period_xact_t: ! period.is_valid()"); - return false; - } - return true; - } - #if defined(HAVE_BOOST_SERIALIZATION) private: /** Serialization. */ |