1003628 Incorrect Landed Cost Allocation calculation. Fixed rounding issue.

This commit is contained in:
Heng Sin Low 2013-12-18 16:36:04 +08:00
parent d186c35265
commit cd58305761
1 changed files with 6 additions and 6 deletions

View File

@ -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);