summaryrefslogtreecommitdiff
path: root/src/xact.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-03-06 02:52:14 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-03-06 02:52:14 -0400
commit4a0f5f9034dc24c7ae5f0464d407f4cf2279558b (patch)
treeb7a4fa4659d366b34e8ecb25267ec2ea9c11f93c /src/xact.cc
parent80c51bf0a524ed80c0c248374a75e7fc392e1a3d (diff)
parentaff490534a8e7826d89bbc75c6885b4a6bff4d17 (diff)
downloadfork-ledger-4a0f5f9034dc24c7ae5f0464d407f4cf2279558b.tar.gz
fork-ledger-4a0f5f9034dc24c7ae5f0464d407f4cf2279558b.tar.bz2
fork-ledger-4a0f5f9034dc24c7ae5f0464d407f4cf2279558b.zip
Merge branch 'next'
Diffstat (limited to 'src/xact.cc')
-rw-r--r--src/xact.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/xact.cc b/src/xact.cc
index 8fb1d14c..0ad223a1 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -306,7 +306,7 @@ bool xact_base_t::finalize()
throw_(balance_error, _("Transaction does not balance"));
}
- // Add the final calculated totals each to their related account
+ // Add a pointer to each posting to their related accounts
if (dynamic_cast<xact_t *>(this)) {
bool all_null = true;
@@ -314,19 +314,15 @@ bool xact_base_t::finalize()
foreach (post_t * post, posts) {
if (! post->amount.is_null()) {
all_null = false;
-
post->amount.in_place_reduce();
-
- add_or_set_value(post->account->xdata().self_details.total,
- post->amount);
-
- DEBUG("xact.finalize.totals",
- "Total for " << post->account->fullname() << " + "
- << post->amount << ": "
- << post->account->xdata().self_details.total);
} else {
some_null = true;
}
+
+ post->account->add_post(post);
+
+ post->xdata().add_flags(POST_EXT_VISITED);
+ post->account->xdata().add_flags(ACCOUNT_EXT_VISITED);
}
if (all_null)
return false; // ignore this xact completely