Fixes bug 0009378: Bankstatement with charge amount and different accounting date in lines and header is not properly posted
authorEduardo Argal Guibert <eduardo.argal@openbravo.com>
Mon, 08 Jun 2009 17:11:40 +0200
changeset 3985 78a6268b22c5
parent 3984 90b4171ab320
child 3986 d7fc5e28a753
Fixes bug 0009378: Bankstatement with charge amount and different accounting date in lines and header is not properly posted
src/org/openbravo/erpCommon/ad_forms/DocBank.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocBank.java	Mon Jun 08 15:38:03 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocBank.java	Mon Jun 08 17:11:40 2009 +0200
@@ -278,7 +278,7 @@
             line.m_C_Currency_ID, TrxAmt.negate().toString(), Fact_Acct_Group_ID, nextSeqNo(SeqNo),
             DocumentType, conn);
       // Charge DR (Charge)
-      fact.createLine(new DocLine_Bank(DocumentType, Record_ID, line.m_TrxLine_ID), new Account(
+      fact.createLine(lineAux, new Account(
           conn, DocLineBankData.selectChargeAccount(conn, C_BankAccount_ID, as.m_C_AcctSchema_ID)),
           line.m_C_Currency_ID, ChargeAmt.toString(), "", Fact_Acct_Group_ID, nextSeqNo(SeqNo),
           DocumentType, conn);
@@ -294,11 +294,11 @@
        */
       //
       if (ConvertChargeAmt.signum() > 0) // >0 loss
-        fact.createLine(new DocLine_Bank(DocumentType, Record_ID, line.m_TrxLine_ID), getAccount(
+        fact.createLine(lineAux, getAccount(
             AcctServer.ACCTTYPE_ConvertChargeLossAmt, as, conn), line.m_C_Currency_ID,
             line.convertChargeAmt, "", Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
       else
-        fact.createLine(new DocLine_Bank(DocumentType, Record_ID, line.m_TrxLine_ID), getAccount(
+        fact.createLine(lineAux, getAccount(
             AcctServer.ACCTTYPE_ConvertChargeGainAmt, as, conn), line.m_C_Currency_ID, "",
             ConvertChargeAmt.negate().toString(), Fact_Acct_Group_ID, nextSeqNo(SeqNo),
             DocumentType, conn);