summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-24 21:13:29 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-24 21:13:29 -0400
commit23380aad04c9ed63fb40b4da5371c305964b1fb8 (patch)
tree47e0c54444dc1b53b36559adcb52390707faa259
parenta8a87ab9088d81b548282927c26deebd8a210284 (diff)
downloadfork-ledger-23380aad04c9ed63fb40b4da5371c305964b1fb8.tar.gz
fork-ledger-23380aad04c9ed63fb40b4da5371c305964b1fb8.tar.bz2
fork-ledger-23380aad04c9ed63fb40b4da5371c305964b1fb8.zip
Change behavior if "entry" ends with null account
A final null account (no amount specified) is now taken to be the "from" account, not another "to" account.
-rw-r--r--src/derive.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/derive.cc b/src/derive.cc
index f6b594e0..c428b5a8 100644
--- a/src/derive.cc
+++ b/src/derive.cc
@@ -208,6 +208,11 @@ namespace {
bool has_only_from = true;
bool has_only_to = true;
+ // A single account at the end of the line is the "from" account
+ if (tmpl.posts.size() > 1 &&
+ tmpl.posts.back().account_mask && ! tmpl.posts.back().amount)
+ tmpl.posts.back().from = true;
+
foreach (xact_template_t::post_template_t& post, tmpl.posts) {
if (post.from)
has_only_to = false;