summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-15 15:43:13 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-15 15:43:13 -0400
commit5fc1f9dce96379e210c8cb4c553b1094f589d42b (patch)
tree50f97709203f534bfd9d29fbc46d235d5c4564a1
parent94aa8e5a9121a2bb90ad9bb794e274f8011a2da5 (diff)
downloadfork-ledger-5fc1f9dce96379e210c8cb4c553b1094f589d42b.tar.gz
fork-ledger-5fc1f9dce96379e210c8cb4c553b1094f589d42b.tar.bz2
fork-ledger-5fc1f9dce96379e210c8cb4c553b1094f589d42b.zip
Corrected double problem in period reports
xact_t::add_to_value, in cases where the xact had a "compound" total, was adding transaction values to the running total twice.
-rw-r--r--src/xact.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/xact.cc b/src/xact.cc
index b2337329..93e66369 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -316,13 +316,9 @@ void xact_t::add_to_value(value_t& value, expr_t& expr)
if (xdata_ && xdata_->has_flags(XACT_EXT_COMPOUND)) {
add_or_set_value(value, xdata_->value);
}
-
- if (! xdata_ || ! xdata_->has_flags(XACT_EXT_NO_TOTAL)) {
+ else if (! xdata_ || ! xdata_->has_flags(XACT_EXT_NO_TOTAL)) {
bind_scope_t bound_scope(*expr.get_context(), *this);
- if (value.is_null())
- value = amount_t(0L);
-
- value += expr.calc(bound_scope);
+ add_or_set_value(value, expr.calc(bound_scope));
}
}