diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-09 15:07:45 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-09 15:07:45 -0400 |
commit | a072b7e2087fcd4dd5cbd1f8b652da2af9585808 (patch) | |
tree | 5c22619df61f23fb9d097d673a40fdc82502b5ce | |
parent | 37a1989ca0b47308acee386f0976cb2da57eeedd (diff) | |
download | fork-ledger-a072b7e2087fcd4dd5cbd1f8b652da2af9585808.tar.gz fork-ledger-a072b7e2087fcd4dd5cbd1f8b652da2af9585808.tar.bz2 fork-ledger-a072b7e2087fcd4dd5cbd1f8b652da2af9585808.zip |
Fixed a case where adding an amount to an integer failed.
-rw-r--r-- | src/value.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/value.cc b/src/value.cc index 724d87fc..d28883a4 100644 --- a/src/value.cc +++ b/src/value.cc @@ -390,6 +390,10 @@ value_t& value_t::operator+=(const value_t& val) as_long_lval() += val.as_long(); return *this; case AMOUNT: + if (val.as_amount().has_commodity()) { + in_place_cast(BALANCE); + return *this += val; + } in_place_cast(AMOUNT); as_amount_lval() += val.as_amount(); return *this; |