diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java index 93dff64ddf..9809c9e095 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java @@ -1089,9 +1089,9 @@ public class MInvoiceLine extends X_C_InvoiceLine // end MZ if (base.signum() != 0) { - BigDecimal result = getLineNetAmt().multiply(base); - result = result.divide(total, BigDecimal.ROUND_HALF_UP); - lca.setAmt(result.doubleValue(), getPrecision()); + double result = getLineNetAmt().multiply(base).doubleValue(); + result /= total.doubleValue(); + lca.setAmt(result, getPrecision()); } if (!lca.save()){ msgreturn = new StringBuilder("Cannot save line Allocation = ").append(lca); @@ -1212,9 +1212,9 @@ public class MInvoiceLine extends X_C_InvoiceLine // end MZ if (base.signum() != 0) { - BigDecimal result = getLineNetAmt().multiply(base); - result = result.divide(total, BigDecimal.ROUND_HALF_UP); - lca.setAmt(result.doubleValue(), getPrecision()); + double result = getLineNetAmt().multiply(base).doubleValue(); + result /= total.doubleValue(); + lca.setAmt(result, getPrecision()); } if (!lca.save()){ msgreturn = new StringBuilder("Cannot save line Allocation = ").append(lca);