IDEMPIERE-3869 discount / write off tax corrections in allocation post require inverted Debit/Credit logic in certain scenarios; tax rate added to Fact_Acct tax correction postings

This commit is contained in:
Carlos Ruiz 2019-02-17 10:06:53 +01:00
parent 6ef4cff3d2
commit 5d55c6e6ef
1 changed files with 4 additions and 2 deletions

View File

@ -1047,12 +1047,14 @@ class Doc_AllocationTax
for (int i = 0; i < m_facts.size(); i++)
{
MFactAcct factAcct = (MFactAcct)m_facts.get(i);
if (factAcct.getAmtSourceDr().compareTo(total) > 0)
if ( (factAcct.getAmtSourceDr().signum() > 0 && factAcct.getAmtSourceDr().compareTo(total) > 0)
|| (factAcct.getAmtSourceDr().signum() < 0 && factAcct.getAmtSourceDr().compareTo(total) < 0))
{
total = factAcct.getAmtSourceDr();
m_totalIndex = i;
}
if (factAcct.getAmtSourceCr().compareTo(total) > 0)
if ( (factAcct.getAmtSourceCr().signum() > 0 && factAcct.getAmtSourceCr().compareTo(total) > 0)
|| (factAcct.getAmtSourceCr().signum() < 0 && factAcct.getAmtSourceCr().compareTo(total) < 0))
{
total = factAcct.getAmtSourceCr();
m_totalIndex = i;