[FIX] account: don't use Math.sign which is ES6

This commit is contained in:
Aaron Bohy
2017-04-11 19:44:38 +02:00
parent abce447401
commit 52d88e77d4
@@ -719,10 +719,11 @@ var StatementModel = BasicModel.extend({
'is_tax': values.is_tax,
'__focus': '__focus' in values ? values.__focus : true,
};
prop.base_amount = Math.sign(prop.base_amount) *
field_utils.parse.monetary(
field_utils.format.monetary(Math.abs(prop.base_amount), {}, line)
);
if (prop.base_amount) {
var sign = prop.base_amount < 0 ? -1 : 1;
var amount = field_utils.format.monetary(Math.abs(prop.base_amount), {}, line);
prop.base_amount = sign * field_utils.parse.monetary(amount);
}
prop.amount = prop.base_amount;
return prop;
},