Added some missing calls to add_post

This commit is contained in:
John Wiegley 2009-11-11 04:32:27 -05:00
parent dae24c259b
commit f1b495abfe
2 changed files with 3 additions and 0 deletions

View file

@ -420,6 +420,7 @@ xact_t * draft_t::insert(journal_t& journal)
}
}
}
assert(new_post->account);
if (new_post.get() && ! new_post->amount.is_null()) {
found_commodity = &new_post->amount.commodity();
@ -475,6 +476,7 @@ xact_t * draft_t::insert(journal_t& journal)
}
added->add_post(new_post.release());
added->posts.back()->account->add_post(added->posts.back());
added->posts.back()->set_state(item_t::UNCLEARED);
DEBUG("derive.xact", "Added new posting to derived entry");

View file

@ -107,6 +107,7 @@ namespace {
post->set_state(item_t::CLEARED);
post->pos = event.position;
curr->add_post(post);
event.account->add_post(post);
if (! journal.add_xact(curr.get()))
throw parse_error(_("Failed to record 'out' timelog transaction"));