diff options
author | Craig Earls <enderw88@gmail.com> | 2014-05-18 08:25:30 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2014-05-18 08:25:30 -0700 |
commit | 8e6cdcc1d13533252b1f6e6088dca966b64e4c88 (patch) | |
tree | 8f8fd4f644f292a25fb79d59961e135cc4b11c3a /src/textual.cc | |
parent | d82c1b4b5531c7be1c1870a07f1836b230a4da27 (diff) | |
parent | 4af2b97921a68a522135f958f1999ec4b63435bb (diff) | |
download | fork-ledger-8e6cdcc1d13533252b1f6e6088dca966b64e4c88.tar.gz fork-ledger-8e6cdcc1d13533252b1f6e6088dca966b64e4c88.tar.bz2 fork-ledger-8e6cdcc1d13533252b1f6e6088dca966b64e4c88.zip |
Merge branch 'master' of https://github.com/ledger/ledger
Diffstat (limited to 'src/textual.cc')
-rw-r--r-- | src/textual.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/textual.cc b/src/textual.cc index 8d4db512..418b6c00 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -1638,24 +1638,23 @@ post_t * instance_t::parse_post(char * line, "line " << context.linenum << ": " << "post amount = " << amt); amount_t diff = amt; - amount_t tot; switch (account_total.type()) { case value_t::AMOUNT: - tot = account_total.as_amount(); + diff -= account_total.as_amount(); break; case value_t::BALANCE: if (optional<amount_t> comm_bal = account_total.as_balance().commodity_amount(amt.commodity())) - tot = *comm_bal; + diff -= *comm_bal; break; default: break; } - diff -= tot; + amount_t tot = amt - diff; DEBUG("post.assign", "line " << context.linenum << ": " << "diff = " << diff); |