IDEMPIERE-3281 Wrong Tax Correction posting at Write Off / integrate patch from Anton Fildan

This commit is contained in:
Carlos Ruiz 2017-02-21 11:59:50 +01:00
parent b56a83ff55
commit cbfc3ac88f
1 changed files with 22 additions and 8 deletions

View File

@ -1049,10 +1049,17 @@ class Doc_AllocationTax
total, m_WriteOffAmt, precision); total, m_WriteOffAmt, precision);
if (amount.signum() != 0) if (amount.signum() != 0)
{ {
fact.createLine (line, m_WriteOffAccount, if (m_IsSOTrx) {
as.getC_Currency_ID(), amount, null); fact.createLine (line, m_WriteOffAccount,
fact.createLine (line, taxAcct, as.getC_Currency_ID(), amount, null);
as.getC_Currency_ID(), null, amount); fact.createLine (line, taxAcct,
as.getC_Currency_ID(), null, amount);
} else {
fact.createLine (line, m_WriteOffAccount,
as.getC_Currency_ID(), amount.negate(), null);
fact.createLine (line, taxAcct,
as.getC_Currency_ID(), null, amount.negate());
}
} }
} }
// Original Tax is CR - need to correct it DR // Original Tax is CR - need to correct it DR
@ -1062,10 +1069,17 @@ class Doc_AllocationTax
total, m_WriteOffAmt, precision); total, m_WriteOffAmt, precision);
if (amount.signum() != 0) if (amount.signum() != 0)
{ {
fact.createLine (line, taxAcct, if(m_IsSOTrx) {
as.getC_Currency_ID(), amount, null); fact.createLine (line, taxAcct,
fact.createLine (line, m_WriteOffAccount, as.getC_Currency_ID(), amount, null);
as.getC_Currency_ID(), null, amount); fact.createLine (line, m_WriteOffAccount,
as.getC_Currency_ID(), null, amount);
} else {
fact.createLine (line, taxAcct,
as.getC_Currency_ID(), amount.negate(), null);
fact.createLine (line, m_WriteOffAccount,
as.getC_Currency_ID(), null, amount.negate());
}
} }
} }
} // WriteOff } // WriteOff