Fixed a case where adding an amount to an integer failed.

This commit is contained in:
John Wiegley 2009-02-09 15:07:45 -04:00
parent 37a1989ca0
commit a072b7e208

View file

@ -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;