summaryrefslogtreecommitdiff
path: root/src/xact.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-03-06 00:26:30 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-03-06 00:27:29 -0400
commit2728e4d55e1c9e84ee5aae4ee8e9c380198d1c99 (patch)
tree5b5e8207db2a37684b2527acad7bccdd770fc1a4 /src/xact.cc
parentdd23edd5cee8e712e13a3b5eefffcc3c57bf9e10 (diff)
downloadfork-ledger-2728e4d55e1c9e84ee5aae4ee8e9c380198d1c99.tar.gz
fork-ledger-2728e4d55e1c9e84ee5aae4ee8e9c380198d1c99.tar.bz2
fork-ledger-2728e4d55e1c9e84ee5aae4ee8e9c380198d1c99.zip
Changed the way that account balances are computed
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