Fix big [ 1713532 ] Accounting error introduced by "Allow Negative Posting"

This commit is contained in:
Carlos Ruiz 2007-05-05 18:00:44 +00:00
parent c2190a8733
commit c3eb997ab4
1 changed files with 3 additions and 3 deletions

View File

@ -272,15 +272,15 @@ public final class Fact
line.setDocumentInfo(m_doc, null); line.setDocumentInfo(m_doc, null);
line.setPostingType(m_postingType); line.setPostingType(m_postingType);
// Account
line.setAccount(m_acctSchema, m_acctSchema.getSuspenseBalancing_Acct());
// Amount // Amount
if (diff.signum() < 0) // negative balance => DR if (diff.signum() < 0) // negative balance => DR
line.setAmtSource(m_doc.getC_Currency_ID(), diff.abs(), Env.ZERO); line.setAmtSource(m_doc.getC_Currency_ID(), diff.abs(), Env.ZERO);
else // positive balance => CR else // positive balance => CR
line.setAmtSource(m_doc.getC_Currency_ID(), Env.ZERO, diff); line.setAmtSource(m_doc.getC_Currency_ID(), Env.ZERO, diff);
// Account
line.setAccount(m_acctSchema, m_acctSchema.getSuspenseBalancing_Acct());
// Convert // Convert
line.convert(); line.convert();
// //