summaryrefslogtreecommitdiff
path: root/src/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-01-14 00:32:02 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-01-14 00:32:02 -0400
commit93f884b5f2159bdf6c9b924fc5436a65cd37fc54 (patch)
tree893d54d1e555ef5f715e8fddbfb9b4491aa5c001 /src/textual.cc
parentdc9782e0de6b308747471aa8ca0e7baa0cc72c28 (diff)
downloadfork-ledger-93f884b5f2159bdf6c9b924fc5436a65cd37fc54.tar.gz
fork-ledger-93f884b5f2159bdf6c9b924fc5436a65cd37fc54.tar.bz2
fork-ledger-93f884b5f2159bdf6c9b924fc5436a65cd37fc54.zip
The cleared or pending flag of a transaction overrides the flag for the entire
entry only if it is "more" cleared.
Diffstat (limited to 'src/textual.cc')
-rw-r--r--src/textual.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/textual.cc b/src/textual.cc
index eef2cc27..61cfd09a 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -552,7 +552,9 @@ entry_t * parse_entry(std::istream& in, char * line, account_t * master,
}
if (xact_t * xact = parse_xact(line, master, curr.get())) {
- xact->set_state(state);
+ if ((state == item_t::CLEARED && xact->state() != item_t::CLEARED) ||
+ (state == item_t::PENDING && xact->state() == item_t::UNCLEARED))
+ xact->set_state(state);
xact->beg_pos = beg_pos;
xact->beg_line = beg_line;