diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java index 6934a93025..a82746bc1a 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java @@ -1049,10 +1049,17 @@ class Doc_AllocationTax total, m_WriteOffAmt, precision); if (amount.signum() != 0) { - fact.createLine (line, m_WriteOffAccount, - as.getC_Currency_ID(), amount, null); - fact.createLine (line, taxAcct, - as.getC_Currency_ID(), null, amount); + if (m_IsSOTrx) { + fact.createLine (line, m_WriteOffAccount, + as.getC_Currency_ID(), amount, null); + 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 @@ -1062,10 +1069,17 @@ class Doc_AllocationTax total, m_WriteOffAmt, precision); if (amount.signum() != 0) { - fact.createLine (line, taxAcct, - as.getC_Currency_ID(), amount, null); - fact.createLine (line, m_WriteOffAccount, - as.getC_Currency_ID(), null, amount); + if(m_IsSOTrx) { + fact.createLine (line, taxAcct, + as.getC_Currency_ID(), amount, null); + 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