summaryrefslogtreecommitdiff
path: root/src/derive.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-03-02 04:56:18 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-03-02 04:56:18 -0400
commit25f106d299d0b067e257843e398acc15d66ac49b (patch)
treec0131fd03f0f449967ae837c1c260764e44f02f5 /src/derive.cc
parentce206a392a4b5929f2f22b7d976abb552db83062 (diff)
downloadfork-ledger-25f106d299d0b067e257843e398acc15d66ac49b.tar.gz
fork-ledger-25f106d299d0b067e257843e398acc15d66ac49b.tar.bz2
fork-ledger-25f106d299d0b067e257843e398acc15d66ac49b.zip
The entry command always creates uncleared items
Diffstat (limited to 'src/derive.cc')
-rw-r--r--src/derive.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/derive.cc b/src/derive.cc
index 6abb22e1..4730af00 100644
--- a/src/derive.cc
+++ b/src/derive.cc
@@ -255,6 +255,8 @@ namespace {
else
added->_date = tmpl.date;
+ added->set_state(item_t::UNCLEARED);
+
if (matching) {
added->payee = matching->payee;
added->code = matching->code;
@@ -270,8 +272,10 @@ namespace {
if (tmpl.posts.empty()) {
if (matching) {
- foreach (post_t * post, matching->posts)
+ foreach (post_t * post, matching->posts) {
added->add_post(new post_t(*post));
+ added->posts.back()->set_state(item_t::UNCLEARED);
+ }
} else {
throw_(std::runtime_error,
_("No accounts, and no past transaction matching '%1'")
@@ -368,6 +372,7 @@ namespace {
}
added->add_post(new_post.release());
+ added->posts.back()->set_state(item_t::UNCLEARED);
}
}