IDEMPIERE-1096 CreateFromStatement not working with currency conversion
This commit is contained in:
parent
8660a34ae5
commit
ab31459efb
|
@ -94,13 +94,13 @@ public abstract class CreateFromBatch extends CreateFrom
|
||||||
throws SQLException
|
throws SQLException
|
||||||
{
|
{
|
||||||
// Get StatementDate
|
// Get StatementDate
|
||||||
Timestamp ts = (Timestamp) getGridTab().getValue("StatementDate");
|
//Timestamp ts = (Timestamp) getGridTab().getValue("StatementDate");
|
||||||
if (ts == null)
|
//if (ts == null)
|
||||||
ts = new Timestamp(System.currentTimeMillis());
|
//ts = new Timestamp(System.currentTimeMillis());
|
||||||
|
|
||||||
int index = 1;
|
int index = 1;
|
||||||
|
|
||||||
pstmt.setTimestamp(index++, ts);
|
//pstmt.setTimestamp(index++, ts);
|
||||||
pstmt.setInt(index++, BankAccount != null ? (Integer) BankAccount : (Integer) getGridTab().getValue("C_BankAccount_ID"));
|
pstmt.setInt(index++, BankAccount != null ? (Integer) BankAccount : (Integer) getGridTab().getValue("C_BankAccount_ID"));
|
||||||
|
|
||||||
if(DocType != null)
|
if(DocType != null)
|
||||||
|
|
|
@ -59,7 +59,7 @@ public abstract class CreateFromStatement extends CreateFromBatch
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
sql.append("SELECT p.DateTrx,p.C_Payment_ID,p.DocumentNo, p.C_Currency_ID,c.ISO_Code, p.PayAmt,");
|
sql.append("SELECT p.DateTrx,p.C_Payment_ID,p.DocumentNo, p.C_Currency_ID,c.ISO_Code, p.PayAmt,");
|
||||||
sql.append("currencyConvert(p.PayAmt,p.C_Currency_ID,ba.C_Currency_ID,?,null,p.AD_Client_ID,p.AD_Org_ID), bp.Name ");
|
sql.append("currencyConvert(p.PayAmt,p.C_Currency_ID,ba.C_Currency_ID,p.DateAcct,p.C_ConversionType_ID,p.AD_Client_ID,p.AD_Org_ID), bp.Name ");
|
||||||
sql.append("FROM C_BankAccount ba");
|
sql.append("FROM C_BankAccount ba");
|
||||||
sql.append(" INNER JOIN C_Payment_v p ON (p.C_BankAccount_ID=ba.C_BankAccount_ID)");
|
sql.append(" INNER JOIN C_Payment_v p ON (p.C_BankAccount_ID=ba.C_BankAccount_ID)");
|
||||||
sql.append(" INNER JOIN C_Currency c ON (p.C_Currency_ID=c.C_Currency_ID)");
|
sql.append(" INNER JOIN C_Currency c ON (p.C_Currency_ID=c.C_Currency_ID)");
|
||||||
|
|
Loading…
Reference in New Issue