Fixed a case where adding an amount to an integer failed.
This commit is contained in:
parent
37a1989ca0
commit
a072b7e208
1 changed files with 4 additions and 0 deletions
|
|
@ -390,6 +390,10 @@ value_t& value_t::operator+=(const value_t& val)
|
||||||
as_long_lval() += val.as_long();
|
as_long_lval() += val.as_long();
|
||||||
return *this;
|
return *this;
|
||||||
case AMOUNT:
|
case AMOUNT:
|
||||||
|
if (val.as_amount().has_commodity()) {
|
||||||
|
in_place_cast(BALANCE);
|
||||||
|
return *this += val;
|
||||||
|
}
|
||||||
in_place_cast(AMOUNT);
|
in_place_cast(AMOUNT);
|
||||||
as_amount_lval() += val.as_amount();
|
as_amount_lval() += val.as_amount();
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue