From 4d8fba5fadaf8db9d7b1e1ab77a2ecc1b894f282 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 9 Feb 2009 01:33:45 -0400 Subject: [PATCH] Always calculate transaction totals based on the expression for the amount. --- src/filters.cc | 8 ++------ 1 file 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::operator()(xact);