summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-09 01:33:45 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-09 01:33:45 -0400
commit4d8fba5fadaf8db9d7b1e1ab77a2ecc1b894f282 (patch)
treef43a3d93bbcfa243c0dd5ad14ce8cd8a6b3eb692 /src/filters.cc
parent1d4c65b5ca514ae4a3977e7a14aabc088a917c6e (diff)
downloadfork-ledger-4d8fba5fadaf8db9d7b1e1ab77a2ecc1b894f282.tar.gz
fork-ledger-4d8fba5fadaf8db9d7b1e1ab77a2ecc1b894f282.tar.bz2
fork-ledger-4d8fba5fadaf8db9d7b1e1ab77a2ecc1b894f282.zip
Always calculate transaction totals based on the expression for the amount.
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/filters.cc b/src/filters.cc
index a88f21e8..4fcada4b 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -191,15 +191,11 @@ void calc_xacts::operator()(xact_t& xact)
add_or_set_value(xdata.total, last_xact->xdata().total);
if (! xdata.has_flags(XACT_EXT_NO_TOTAL)) {
-#if 0
bind_scope_t bound_scope(*amount_expr.get_context(), xact);
if (xdata.total.is_null())
- xdata.total = amount_expr.calc();
+ xdata.total = amount_expr.calc(bound_scope);
else
- xdata.total += amount_expr.calc();
-#else
- xact.add_to_value(xdata.total);
-#endif
+ xdata.total += amount_expr.calc(bound_scope);
}
item_handler<xact_t>::operator()(xact);