IDEMPIERE-2753 Discount is not calculated when Price List Price <1

This commit is contained in:
tsvikruha 2015-09-20 22:30:38 +02:00
parent 632c4c6e2d
commit e38b301b75
2 changed files with 4 additions and 4 deletions

View File

@ -624,7 +624,7 @@ public class CalloutInvoice extends CalloutEngine
// calculate Discount
else
{
if (PriceList.intValue() == 0)
if (PriceList.compareTo(Env.ZERO) == 0)
Discount = Env.ZERO;
else
Discount = new BigDecimal ((PriceList.doubleValue() - PriceActual.doubleValue()) / PriceList.doubleValue() * 100.0);
@ -654,7 +654,7 @@ public class CalloutInvoice extends CalloutEngine
mTab.setValue ("PriceEntered", PriceEntered);
mTab.fireDataStatusEEvent ("UnderLimitPrice", "", false);
// Repeat Discount calc
if (PriceList.intValue() != 0)
if (PriceList.compareTo(Env.ZERO) != 0)
{
Discount = BigDecimal.valueOf((PriceList.doubleValue () - PriceActual.doubleValue ()) / PriceList.doubleValue () * 100.0);
if (Discount.scale () > 2)

View File

@ -1148,7 +1148,7 @@ public class CalloutOrder extends CalloutEngine
// calculate Discount
else
{
if (PriceList.intValue() == 0)
if (PriceList.compareTo(Env.ZERO) == 0)
Discount = Env.ZERO;
else
Discount = BigDecimal.valueOf((PriceList.doubleValue() - PriceActual.doubleValue()) / PriceList.doubleValue() * 100.0);
@ -1177,7 +1177,7 @@ public class CalloutOrder extends CalloutEngine
mTab.setValue ("PriceEntered", PriceEntered);
mTab.fireDataStatusEEvent ("UnderLimitPrice", "", false);
// Repeat Discount calc
if (PriceList.intValue() != 0)
if (PriceList.compareTo(Env.ZERO) != 0)
{
Discount = BigDecimal.valueOf((PriceList.doubleValue () - PriceActual.doubleValue ()) / PriceList.doubleValue () * 100.0);
if (Discount.scale () > 2)