BF [2000582] Error in Tax Correction
https://sourceforge.net/tracker/index.php?func=detail&aid=2000582&group_id=176962&atid=879332
This commit is contained in:
parent
cd3551160d
commit
cb9e7efa69
|
@ -1086,7 +1086,7 @@ class Doc_AllocationTax
|
||||||
} // createEntries
|
} // createEntries
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calc Amount tax / (total-tax) * amt
|
* Calc Amount tax / total * amt
|
||||||
* @param tax tax
|
* @param tax tax
|
||||||
* @param total total
|
* @param total total
|
||||||
* @param amt reduction amt
|
* @param amt reduction amt
|
||||||
|
@ -1101,8 +1101,7 @@ class Doc_AllocationTax
|
||||||
|| amt.signum() == 0)
|
|| amt.signum() == 0)
|
||||||
return Env.ZERO;
|
return Env.ZERO;
|
||||||
//
|
//
|
||||||
BigDecimal devisor = total.subtract(tax);
|
BigDecimal multiplier = tax.divide(total, 10, BigDecimal.ROUND_HALF_UP);
|
||||||
BigDecimal multiplier = tax.divide(devisor, 10, BigDecimal.ROUND_HALF_UP);
|
|
||||||
BigDecimal retValue = multiplier.multiply(amt);
|
BigDecimal retValue = multiplier.multiply(amt);
|
||||||
if (retValue.scale() > precision)
|
if (retValue.scale() > precision)
|
||||||
retValue = retValue.setScale(precision, BigDecimal.ROUND_HALF_UP);
|
retValue = retValue.setScale(precision, BigDecimal.ROUND_HALF_UP);
|
||||||
|
|
Loading…
Reference in New Issue