summaryrefslogtreecommitdiff
path: root/src/account.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-09 14:53:29 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-09 14:53:29 -0400
commit02110394b45fdf4121f00f3484f0caeacb7c404e (patch)
tree61feecac387c78bbcc7c0b0c894c0b8aa4d26d31 /src/account.cc
parent3ee3b8f327fa1943dba4ef6043559186b26f86b4 (diff)
downloadfork-ledger-02110394b45fdf4121f00f3484f0caeacb7c404e.tar.gz
fork-ledger-02110394b45fdf4121f00f3484f0caeacb7c404e.tar.bz2
fork-ledger-02110394b45fdf4121f00f3484f0caeacb7c404e.zip
Use the report's amount_expr everywhere that computes an xact's amount.
Diffstat (limited to 'src/account.cc')
-rw-r--r--src/account.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/account.cc b/src/account.cc
index b6681c54..339d1ef4 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -246,13 +246,12 @@ bool account_t::valid() const
return true;
}
-void account_t::calculate_sums(expr_t& amount_expr,
- scope_t& scope)
+void account_t::calculate_sums(expr_t& amount_expr)
{
xdata_t& xd(xdata());
foreach (accounts_map::value_type& pair, accounts) {
- (*pair.second).calculate_sums(amount_expr, scope);
+ (*pair.second).calculate_sums(amount_expr);
xdata_t& child_xd((*pair.second).xdata());
if (! child_xd.total.is_null()) {
@@ -264,10 +263,8 @@ void account_t::calculate_sums(expr_t& amount_expr,
}
}
- bind_scope_t bound_scope(scope, *this);
- call_scope_t args(bound_scope);
-
- value_t amount(amount_expr.calc(args));
+ bind_scope_t bound_scope(*amount_expr.get_context(), *this);
+ value_t amount(amount_expr.calc(bound_scope));
if (! amount.is_null()) {
add_or_set_value(xd.total, amount);