summaryrefslogtreecommitdiff
path: root/src/entry.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-09 17:40:47 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-09 17:40:47 -0400
commit5419e74378134d34894c8f25d54e8a28482ff5a8 (patch)
treedb0a1964cd68c47a53f16b7c76b46ea4727aa390 /src/entry.cc
parentd2453088c461c6fde7542c591616eb42f93e15cf (diff)
parentd83e2f34874c46833143e7c1981ca707f88c16ab (diff)
downloadledger-5419e74378134d34894c8f25d54e8a28482ff5a8.tar.gz
ledger-5419e74378134d34894c8f25d54e8a28482ff5a8.tar.bz2
ledger-5419e74378134d34894c8f25d54e8a28482ff5a8.zip
Merge branch 'master' into v2.7a
Diffstat (limited to 'src/entry.cc')
-rw-r--r--src/entry.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/entry.cc b/src/entry.cc
index b43970e9..1a906cc4 100644
--- a/src/entry.cc
+++ b/src/entry.cc
@@ -320,6 +320,21 @@ bool entry_base_t::finalize()
}
}
+ // Add the final calculated totals each to their related account
+
+ if (dynamic_cast<entry_t *>(this)) {
+ foreach (xact_t * xact, xacts) {
+ account_t::xdata_t& xdata(xact->account->xdata());
+
+ // jww (2008-08-09): For now, this feature only works for
+ // non-specific commodities.
+ if (xdata.value.is_null())
+ xdata.value = xact->amount.strip_annotations();
+ else
+ xdata.value += xact->amount.strip_annotations();
+ }
+ }
+
return true;
}