IDEMPIERE-2753 Discount is not calculated when Price List Price <1 (#119)
Bring one more point of failure discovered by Elaine Tan
This commit is contained in:
parent
2706026b85
commit
fe69eb9dfa
|
@ -818,7 +818,7 @@ public class MProductPricing extends AbstractProductPricing
|
||||||
public BigDecimal getDiscount()
|
public BigDecimal getDiscount()
|
||||||
{
|
{
|
||||||
BigDecimal Discount = Env.ZERO;
|
BigDecimal Discount = Env.ZERO;
|
||||||
if (m_PriceList.intValue() != 0)
|
if (m_PriceList.compareTo(Env.ZERO) != 0)
|
||||||
Discount = BigDecimal.valueOf((m_PriceList.doubleValue() - m_PriceStd.doubleValue())
|
Discount = BigDecimal.valueOf((m_PriceList.doubleValue() - m_PriceStd.doubleValue())
|
||||||
/ m_PriceList.doubleValue() * 100.0);
|
/ m_PriceList.doubleValue() * 100.0);
|
||||||
if (Discount.scale() > 2)
|
if (Discount.scale() > 2)
|
||||||
|
|
Loading…
Reference in New Issue