Implemented Bug551 Automatic Transactions are cleared base on parent

This commit is contained in:
Craig Earls 2012-10-23 13:07:39 -07:00
parent b1661b6c90
commit 14dcb27777

View file

@ -780,6 +780,14 @@ void auto_xact_t::extend_xact(xact_base_t& xact, parse_context_t& context)
// the automated xact's one.
post_t * new_post = new post_t(account, amt);
new_post->copy_details(*post);
// A Cleared transaction implies all of its automatic posting are cleared
// CPR 2012/10/23
if(xact.state() == item_t::CLEARED){
DEBUG("xact.extend.cleared", "CLEARED");
new_post->set_state(item_t::CLEARED);
}
new_post->add_flags(ITEM_GENERATED);
new_post->account =
journal->register_account(account->fullname(), new_post,