IDEMPIERE-392 Redesign payment button - Fix missing reference in generate model class for column with 'Payment' display type

This commit is contained in:
Elaine Tan 2012-10-30 12:28:51 +08:00
parent 14f2125874
commit 6c71f29822
2 changed files with 12 additions and 2 deletions

View File

@ -35,6 +35,7 @@ import java.util.logging.Level;
import org.adempiere.exceptions.DBException; import org.adempiere.exceptions.DBException;
import org.compiere.Adempiere; import org.compiere.Adempiere;
import org.compiere.model.MPaymentLookup;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
@ -417,12 +418,21 @@ public class ModelClassGenerator
sb.append("\tpublic void set").append(columnName).append(" (").append(dataType).append(" ").append(columnName).append(")").append(NL) sb.append("\tpublic void set").append(columnName).append(" (").append(dataType).append(" ").append(columnName).append(")").append(NL)
.append("\t{").append(NL) .append("\t{").append(NL)
; ;
// List Validation // List Validation
if (AD_Reference_ID != 0 && String.class == clazz) if (AD_Reference_ID != 0 && String.class == clazz)
{ {
String staticVar = addListValidation (sb, AD_Reference_ID, columnName); String staticVar = addListValidation (sb, AD_Reference_ID, columnName);
sb.insert(0, staticVar); sb.insert(0, staticVar);
} }
// Payment Validation
if (displayType == DisplayType.Payment)
{
String staticVar = addListValidation (sb, MPaymentLookup.PAYMENTRULE_AD_Reference_ID, columnName);
sb.insert(0, staticVar);
}
// setValue ("ColumnName", xx); // setValue ("ColumnName", xx);
if (virtualColumn) if (virtualColumn)
{ {

View File

@ -39,7 +39,7 @@ public class MPaymentLookup extends Lookup implements Serializable {
*/ */
private static final long serialVersionUID = -6863672221350217533L; private static final long serialVersionUID = -6863672221350217533L;
private static final int PAYMENT_RULE_REFERENCE_ID = 195; public static final int PAYMENTRULE_AD_Reference_ID = 195;
/** Context */ /** Context */
private Properties m_ctx; private Properties m_ctx;
@ -136,7 +136,7 @@ public class MPaymentLookup extends Lookup implements Serializable {
try try
{ {
pstmt = DB.prepareStatement(sb.toString(), null); pstmt = DB.prepareStatement(sb.toString(), null);
pstmt.setInt(1, PAYMENT_RULE_REFERENCE_ID); pstmt.setInt(1, PAYMENTRULE_AD_Reference_ID);
if (!isBaseLanguage) if (!isBaseLanguage)
pstmt.setString(2, ad_language); pstmt.setString(2, ad_language);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();