From 2728e4d55e1c9e84ee5aae4ee8e9c380198d1c99 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 6 Mar 2009 00:26:30 -0400 Subject: Changed the way that account balances are computed --- src/textual.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/textual.cc') diff --git a/src/textual.cc b/src/textual.cc index 1c3bcb02..3652176a 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -1013,25 +1013,24 @@ post_t * instance_t::parse_post(char * line, DEBUG("textual.parse", "line " << linenum << ": " << "POST assign: parsed amt = " << *post->assigned_amount); - account_t::xdata_t& xdata(post->account->xdata()); - amount_t& amt(*post->assigned_amount); + amount_t& amt(*post->assigned_amount); + value_t account_total(post->account->self_total(false)); DEBUG("post.assign", "line " << linenum << ": " - "account balance = " << xdata.self_details.total); + "account balance = " << account_total); DEBUG("post.assign", "line " << linenum << ": " "post amount = " << amt); amount_t diff; - switch (xdata.self_details.total.type()) { + switch (account_total.type()) { case value_t::AMOUNT: - diff = amt - xdata.self_details.total.as_amount(); + diff = amt - account_total.as_amount(); break; case value_t::BALANCE: if (optional comm_bal = - xdata.self_details.total.as_balance() - .commodity_amount(amt.commodity())) + account_total.as_balance().commodity_amount(amt.commodity())) diff = amt - *comm_bal; else diff = amt; -- cgit v1.2.3