IDEMPIERE-392 Redesign payment button - reuse SystemIDs

This commit is contained in:
Carlos Ruiz 2012-10-31 09:37:27 -05:00
parent 18aebedfb7
commit f489fc76e2
5 changed files with 24 additions and 14 deletions

View File

@ -19,6 +19,8 @@
*****************************************************************************/ *****************************************************************************/
package org.adempiere.util; package org.adempiere.util;
import static org.compiere.model.SystemIDs.REFERENCE_PAYMENTRULE;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
@ -35,7 +37,6 @@ 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;
@ -429,7 +430,7 @@ public class ModelClassGenerator
// Payment Validation // Payment Validation
if (displayType == DisplayType.Payment) if (displayType == DisplayType.Payment)
{ {
String staticVar = addListValidation (sb, MPaymentLookup.PAYMENTRULE_AD_Reference_ID, columnName); String staticVar = addListValidation (sb, REFERENCE_PAYMENTRULE, columnName);
sb.insert(0, staticVar); sb.insert(0, staticVar);
} }

View File

@ -13,6 +13,8 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.model; package org.compiere.model;
import static org.compiere.model.SystemIDs.REFERENCE_PAYMENTRULE;
import java.io.Serializable; import java.io.Serializable;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
@ -38,8 +40,6 @@ public class MPaymentLookup extends Lookup implements Serializable {
* *
*/ */
private static final long serialVersionUID = -6863672221350217533L; private static final long serialVersionUID = -6863672221350217533L;
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, PAYMENTRULE_AD_Reference_ID); pstmt.setInt(1, REFERENCE_PAYMENTRULE);
if (!isBaseLanguage) if (!isBaseLanguage)
pstmt.setString(2, ad_language); pstmt.setString(2, ad_language);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();

View File

@ -112,10 +112,11 @@ public class SystemIDs
public final static int REFERENCE_DATATYPE_URL = 40; public final static int REFERENCE_DATATYPE_URL = 40;
public final static int REFERENCE_DATATYPE_YES_NO = 20; public final static int REFERENCE_DATATYPE_YES_NO = 20;
public static final int REFERENCE_AD_USER = 110; public final static int REFERENCE_AD_USER = 110;
public final static int REFERENCE_DOCUMENTACTION = 135; public final static int REFERENCE_DOCUMENTACTION = 135;
public final static int REFERENCE_PAYMENTRULE = 195; public final static int REFERENCE_PAYMENTRULE = 195;
public final static int REFERENCE_POSTING_TYPE = 125; public final static int REFERENCE_POSTING_TYPE = 125;
public final static int REFERENCE_POSTED = 234;
public final static int REFERENCE_YESNO = 319; public final static int REFERENCE_YESNO = 319;
public final static int REFERENCE_WIZARDSTATUS = 200003; public final static int REFERENCE_WIZARDSTATUS = 200003;
@ -134,7 +135,7 @@ public class SystemIDs
public final static int USER_SYSTEM = 0; public final static int USER_SYSTEM = 0;
public final static int WINDOW_ACCOUNTCOMBINATION = 153; public final static int WINDOW_ACCOUNTCOMBINATION = 153;
public static final int WINDOW_CUSTOMERRETURN = 53097; public final static int WINDOW_CUSTOMERRETURN = 53097;
public final static int WINDOW_INVENTORYMOVE = 170; public final static int WINDOW_INVENTORYMOVE = 170;
public final static int WINDOW_LOT = 257; public final static int WINDOW_LOT = 257;
public final static int WINDOW_MATERIALRECEIPT = 184; public final static int WINDOW_MATERIALRECEIPT = 184;
@ -144,7 +145,7 @@ public class SystemIDs
public final static int WINDOW_PRINTFORMAT = 240; public final static int WINDOW_PRINTFORMAT = 240;
public final static int WINDOW_PRODUCTION = 191; public final static int WINDOW_PRODUCTION = 191;
public final static int WINDOW_REQUESTS_ALL = 232; public final static int WINDOW_REQUESTS_ALL = 232;
public static final int WINDOW_RETURNTOVENDOR = 53098; public final static int WINDOW_RETURNTOVENDOR = 53098;
public final static int WINDOW_SHIPMENT_CUSTOMER = 169; public final static int WINDOW_SHIPMENT_CUSTOMER = 169;
public final static int WINDOW_WAREHOUSE_LOCATOR = 139; public final static int WINDOW_WAREHOUSE_LOCATOR = 139;
public final static int WINDOW_WINDOW_TAB_FIELD = 102; public final static int WINDOW_WINDOW_TAB_FIELD = 102;

View File

@ -16,6 +16,10 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.grid.ed; package org.compiere.grid.ed;
import static org.compiere.model.SystemIDs.REFERENCE_DOCUMENTACTION;
import static org.compiere.model.SystemIDs.REFERENCE_PAYMENTRULE;
import static org.compiere.model.SystemIDs.REFERENCE_POSTED;
import java.awt.Color; import java.awt.Color;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
@ -88,13 +92,13 @@ public final class VButton extends CButton
// Special Buttons // Special Buttons
if (columnName.equals("PaymentRule")) if (columnName.equals("PaymentRule"))
{ {
readReference(195); readReference(REFERENCE_PAYMENTRULE);
this.setForeground(Color.blue); this.setForeground(Color.blue);
setIcon(Env.getImageIcon("Payment16.gif")); // 29*14 setIcon(Env.getImageIcon("Payment16.gif")); // 29*14
} }
else if (columnName.equals("DocAction")) else if (columnName.equals("DocAction"))
{ {
readReference(135); readReference(REFERENCE_DOCUMENTACTION);
this.setForeground(Color.blue); this.setForeground(Color.blue);
setIcon(Env.getImageIcon("Process16.gif")); // 16*16 setIcon(Env.getImageIcon("Process16.gif")); // 16*16
} }
@ -109,7 +113,7 @@ public final class VButton extends CButton
} }
else if (columnName.equals("Posted")) else if (columnName.equals("Posted"))
{ {
readReference(234); readReference(REFERENCE_POSTED);
this.setForeground(Color.magenta); this.setForeground(Color.magenta);
setIcon(Env.getImageIcon("InfoAccount16.gif")); // 16*16 setIcon(Env.getImageIcon("InfoAccount16.gif")); // 16*16
} }

View File

@ -17,6 +17,10 @@
package org.adempiere.webui.editor; package org.adempiere.webui.editor;
import static org.compiere.model.SystemIDs.REFERENCE_DOCUMENTACTION;
import static org.compiere.model.SystemIDs.REFERENCE_PAYMENTRULE;
import static org.compiere.model.SystemIDs.REFERENCE_POSTED;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -111,12 +115,12 @@ public class WButtonEditor extends WEditor implements IProcessButton
String columnName = super.getColumnName(); String columnName = super.getColumnName();
if (columnName.equals("PaymentRule")) if (columnName.equals("PaymentRule"))
{ {
readReference(195); readReference(REFERENCE_PAYMENTRULE);
getComponent().setImage("/images/Payment16.png"); // 29*14 getComponent().setImage("/images/Payment16.png"); // 29*14
} }
else if (columnName.equals("DocAction")) else if (columnName.equals("DocAction"))
{ {
readReference(135); readReference(REFERENCE_DOCUMENTACTION);
getComponent().setImage("/images/Process16.png"); // 16*16 getComponent().setImage("/images/Process16.png"); // 16*16
} }
else if (columnName.equals("CreateFrom")) else if (columnName.equals("CreateFrom"))
@ -130,7 +134,7 @@ public class WButtonEditor extends WEditor implements IProcessButton
} }
else if (columnName.equals("Posted")) else if (columnName.equals("Posted"))
{ {
readReference(234); readReference(REFERENCE_POSTED);
getComponent().setImage("/images/InfoAccount16.png"); // 16*16 getComponent().setImage("/images/InfoAccount16.png"); // 16*16
} }