Fix big [ 1713532 ] Accounting error introduced by "Allow Negative Posting"
This commit is contained in:
parent
c2190a8733
commit
c3eb997ab4
|
@ -272,15 +272,15 @@ public final class Fact
|
|||
line.setDocumentInfo(m_doc, null);
|
||||
line.setPostingType(m_postingType);
|
||||
|
||||
// Account
|
||||
line.setAccount(m_acctSchema, m_acctSchema.getSuspenseBalancing_Acct());
|
||||
|
||||
// Amount
|
||||
if (diff.signum() < 0) // negative balance => DR
|
||||
line.setAmtSource(m_doc.getC_Currency_ID(), diff.abs(), Env.ZERO);
|
||||
else // positive balance => CR
|
||||
line.setAmtSource(m_doc.getC_Currency_ID(), Env.ZERO, diff);
|
||||
|
||||
// Account
|
||||
line.setAccount(m_acctSchema, m_acctSchema.getSuspenseBalancing_Acct());
|
||||
|
||||
// Convert
|
||||
line.convert();
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue