Integrate Teo Sarca BUG ID [ 1623598 ] Payment Selection Line problem when selecting invoice

This commit is contained in:
Carlos Ruiz 2006-12-30 05:49:10 +00:00
parent 2ee298efe3
commit b1a650743f
1 changed files with 10 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/****************************************************************************** /******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution * * Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it * * This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published * * under the terms version 2 of the GNU General Public License as published *
@ -13,6 +13,7 @@
* For the text or an alternative of this public license, you may reach us * * For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html * * or via info@compiere.org or http://www.compiere.org/license.html *
* Contributor(s): Teo Sarca
*****************************************************************************/ *****************************************************************************/
package org.compiere.model; package org.compiere.model;
@ -28,6 +29,9 @@ import org.compiere.util.*;
* *
* @author Jorg Janke * @author Jorg Janke
* @version $Id: CalloutPaySelection.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $ * @version $Id: CalloutPaySelection.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $
*
* globalqss - integrate Teo Sarca bug fix
* [ 1623598 ] Payment Selection Line problem when selecting invoice
*/ */
public class CalloutPaySelection extends CalloutEngine public class CalloutPaySelection extends CalloutEngine
{ {
@ -88,7 +92,8 @@ public class CalloutPaySelection extends CalloutEngine
if (C_Invoice_ID == 0) if (C_Invoice_ID == 0)
return ""; return "";
int C_BankAccount_ID = Env.getContextAsInt(ctx, WindowNo, "C_BankAccount_ID"); int C_BankAccount_ID = Env.getContextAsInt(ctx, WindowNo, "C_BankAccount_ID");
Timestamp PayDate = Env.getContextAsDate(ctx, "PayDate"); Timestamp PayDate = Env.getContextAsDate(ctx, WindowNo, "PayDate");
/* ARHIPAC: TEO: BEGIN: END ------------------------------------------------------------------------------------------ */
if (PayDate == null) if (PayDate == null)
PayDate = new Timestamp(System.currentTimeMillis()); PayDate = new Timestamp(System.currentTimeMillis());
setCalloutActive(true); setCalloutActive(true);
@ -104,9 +109,9 @@ public class CalloutPaySelection extends CalloutEngine
try try
{ {
PreparedStatement pstmt = DB.prepareStatement(sql, null); PreparedStatement pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, C_Invoice_ID); pstmt.setInt(2, C_Invoice_ID);
pstmt.setInt(2, C_BankAccount_ID); pstmt.setInt(3, C_BankAccount_ID);
pstmt.setTimestamp(3, PayDate); pstmt.setTimestamp(1, PayDate);
ResultSet rs = pstmt.executeQuery(); ResultSet rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {