IDEMPIERE-455 Discover and fix FindBugs problems / DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE

This commit is contained in:
Carlos Ruiz 2013-04-09 17:52:50 -05:00
parent 6b108cff55
commit 16094d84d5
1 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
private static final long serialVersionUID = 8726957992840702609L; private static final long serialVersionUID = 8726957992840702609L;
/** Tolerance Gain and Loss */ /** Tolerance Gain and Loss */
private static final BigDecimal TOLERANCE = new BigDecimal (0.02); private static final BigDecimal TOLERANCE = BigDecimal.valueOf(0.02);
/** /**
* Get Allocations of Payment * Get Allocations of Payment
@ -1045,7 +1045,7 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
// allocation as a percentage of the invoice // allocation as a percentage of the invoice
double multiplier = allocAmt.doubleValue() / invoice.getGrandTotal().doubleValue(); double multiplier = allocAmt.doubleValue() / invoice.getGrandTotal().doubleValue();
// Reduce Orig Invoice Accounted // Reduce Orig Invoice Accounted
invAmtAccted = invAmtAccted.multiply(new BigDecimal(multiplier)); invAmtAccted = invAmtAccted.multiply(BigDecimal.valueOf(multiplier));
// Difference based on percentage of Orig Invoice // Difference based on percentage of Orig Invoice
openBalanceDiff = openBalanceDiff.add(invAmtAccted).subtract(allocAmtAccted); // gain is negative openBalanceDiff = openBalanceDiff.add(invAmtAccted).subtract(allocAmtAccted); // gain is negative
// ignore Tolerance // ignore Tolerance