IDEMPIERE-236 Centralization of hardcoded IDs / massive upload (integrated into iDempiere by CarlosRuiz - globalqss)

This commit is contained in:
Nicolas Micoud 2012-04-23 22:31:14 -05:00
parent 4173cb21a9
commit 57bc9b5d0b
73 changed files with 385 additions and 223 deletions

View File

@ -23,6 +23,7 @@ import org.compiere.model.GridWindow;
import org.compiere.model.GridWindowVO;
import org.compiere.model.MConversionRate;
import org.compiere.model.MUOMConversion;
import org.compiere.model.SystemIDs;
import org.compiere.util.Env;
import org.compiere.util.Login;
@ -32,7 +33,7 @@ import org.compiere.util.Login;
* @author Jorg Janke
* @version $Id: Base.java,v 1.5 2006/09/21 20:44:54 jjanke Exp $
*/
class Base
class Base implements SystemIDs
{
/**
* Base Test
@ -52,7 +53,7 @@ class Base
// *******************************************************************
// Table=100, Shipper=142, Window=102, Reference=101
int AD_Window_ID = 102;
int AD_Window_ID = WINDOW_WINDOW_TAB_FIELD;
long startTime = System.currentTimeMillis();
GridWindowVO vo = GridWindowVO.create(Env.getCtx(), 1, AD_Window_ID);
GridWindow w = new GridWindow(vo);

View File

@ -24,6 +24,7 @@ import java.util.Properties;
import java.util.logging.Level;
import org.compiere.model.I_AD_ImpFormat;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_AD_ImpFormat;
import org.compiere.model.X_I_GLJournal;
import org.compiere.util.CLogger;
@ -39,7 +40,7 @@ import org.compiere.util.Env;
* @version $Id: ImpFormat.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
*/
public final class ImpFormat
public final class ImpFormat implements SystemIDs
{
/**
* Format
@ -150,24 +151,24 @@ public final class ImpFormat
m_tableUniqueChild = "H_Commodity1"; // Vendor No may not be unique !
m_tableUniqueParent = "H_PartnrID"; // Makes it unique
}
else if (m_AD_Table_ID == 532) // I_Product
else if (m_AD_Table_ID == TABLE_I_PRODUCT) // I_Product
{
m_tableUnique1 = "UPC"; // UPC = unique
m_tableUnique2 = "Value";
m_tableUniqueChild = "VendorProductNo"; // Vendor No may not be unique !
m_tableUniqueParent = "BPartner_Value"; // Makes it unique
}
else if (m_AD_Table_ID == 533) // I_BPartner
else if (m_AD_Table_ID == TABLE_I_BPARTNER) // I_BPartner
{
// gody: 20070113 to allow multiple contacts per BP
// m_tableUnique1 = "Value"; // the key
}
else if (m_AD_Table_ID == 534) // I_ElementValue
else if (m_AD_Table_ID == TABLE_I_ELEMENTVALUE) // I_ElementValue
{
m_tableUniqueParent = "ElementName"; // the parent key
m_tableUniqueChild = "Value"; // the key
}
else if (m_AD_Table_ID == 535) // I_ReportLine
else if (m_AD_Table_ID == TABLE_I_REPORTLINE) // I_ReportLine
{
m_tableUniqueParent = "ReportLineSetName"; // the parent key
m_tableUniqueChild = "Name"; // the key

View File

@ -39,7 +39,7 @@ import org.compiere.util.Env;
* @see http://sourceforge.net/tracker/?func=detail&atid=879335&aid=1877902&group_id=176962 to FR [1877902]
* @version $Id: GridFieldVO.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $
*/
public class GridFieldVO implements Serializable
public class GridFieldVO implements Serializable, SystemIDs
{
/**
*
@ -351,7 +351,7 @@ public class GridFieldVO implements Serializable
vo.ColumnName += "By";
vo.displayType = isTimestamp ? DisplayType.DateTime : DisplayType.Table;
if (!isTimestamp)
vo.AD_Reference_Value_ID = 110; // AD_User Table Reference
vo.AD_Reference_Value_ID = REFERENCE_AD_USER; // AD_User Table Reference
vo.IsDisplayed = false;
vo.IsMandatory = false;
vo.IsReadOnly = false;

View File

@ -85,7 +85,7 @@ import org.compiere.util.ValueNamePair;
* https://sourceforge.net/tracker/?func=detail&aid=2910368&group_id=176962&atid=879332
*/
public class GridTable extends AbstractTableModel
implements Serializable
implements Serializable, SystemIDs
{
/**
* generated
@ -1434,7 +1434,7 @@ public class GridTable extends AbstractTableModel
boolean specialZeroUpdate = false;
if (!m_inserting // not inserting, updating a record
&& manualCmd // in a manual way (pushing the save button)
&& (Env.getAD_User_ID(m_ctx) == 0 || Env.getAD_User_ID(m_ctx) == 100) // user must know what is doing -> just allowed to System or SuperUser (Hardcoded)
&& (Env.getAD_User_ID(m_ctx) == USER_SYSTEM || Env.getAD_User_ID(m_ctx) == USER_SUPERUSER) // user must know what is doing -> just allowed to System or SuperUser (Hardcoded)
&& getKeyID(m_rowChanged) == 0) { // the record being changed has ID = 0
String tablename = getTableName(); // just the allowed tables (HardCoded)
if (tablename.equals("AD_Org") ||

View File

@ -41,7 +41,7 @@ import org.compiere.util.Language;
* <li>BF [ 2695078 ] Country is not translated on invoice
*/
public final class MCountry extends X_C_Country
implements Comparator, Serializable
implements Comparator, Serializable, SystemIDs
{
/**
*
@ -124,7 +124,7 @@ public final class MCountry extends X_C_Country
// Country code of Client Language
if (lang != null && lang.getCountryCode().equals(c.getCountryCode()))
s_default = c;
if (c.getC_Country_ID() == 100) // USA
if (c.getC_Country_ID() == COUNTRY_US) // USA
usa = c;
}
rs.close();

View File

@ -38,7 +38,7 @@ import org.compiere.util.CLogger;
* <li>BF [ 2861194 ] EntityType is not using normal PO framework for getting IDs
* https://sourceforge.net/tracker/?func=detail&aid=2861194&group_id=176962&atid=879332
*/
public class MEntityType extends X_AD_EntityType
public class MEntityType extends X_AD_EntityType implements SystemIDs
{
/**
*
@ -219,7 +219,7 @@ public class MEntityType extends X_AD_EntityType
if (!newRecord)
{
int id = getAD_EntityType_ID();
boolean systemMaintained = (id == 10 || id == 20); // C/D
boolean systemMaintained = (id == ENTITYTYPE_DICTIONARY || id == ENTITYTYPE_ADEMPIERE); // C/D
if (systemMaintained)
{
log.saveError("Error", "You cannot modify a System maintained entity");

View File

@ -40,7 +40,7 @@ import org.compiere.util.Env;
* @version $Id: MRegion.java,v 1.3 2006/07/30 00:58:36 jjanke Exp $
*/
public final class MRegion extends X_C_Region
implements Comparator, Serializable
implements Comparator, Serializable, SystemIDs
{
/**
*
@ -236,7 +236,7 @@ public final class MRegion extends X_C_Region
* Please make sure that the file is converted via the Java utility
* native2ascii - i.e. all seven bit code with /u0000 unicode stuff
*/
int C_Country_ID = 216; // Japan
int C_Country_ID = COUNTRY_JAPAN; // Japan
MCountry country = new MCountry(Env.getCtx(), C_Country_ID, null);
// Hokkaido
MRegion temp = new MRegion (country, "\u5317\u6d77\u9053");

View File

@ -38,7 +38,7 @@ import org.compiere.util.TimeUtil;
* @author Jorg Janke
* @version $Id: MRequest.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $
*/
public class MRequest extends X_R_Request
public class MRequest extends X_R_Request implements SystemIDs
{
/**
*
@ -1212,7 +1212,7 @@ public class MRequest extends X_R_Request
if (X_AD_User.NOTIFICATIONTYPE_Notice.equals(NotificationType)
|| X_AD_User.NOTIFICATIONTYPE_EMailPlusNotice.equals(NotificationType))
{
int AD_Message_ID = 834;
int AD_Message_ID = MESSAGE_REQUESTUPDATE;
MNote note = new MNote(getCtx(), AD_Message_ID, AD_User_ID,
X_R_Request.Table_ID, getR_Request_ID(),
subject, message.toString(), get_TrxName());

View File

@ -54,7 +54,7 @@ import org.compiere.util.Trace;
* @contributor KittiU - FR [ 3062553 ] - Duplicated action in DocAction list for Multiple Role Users
* @version $Id: MRole.java,v 1.5 2006/08/09 16:38:47 jjanke Exp $
*/
public final class MRole extends X_AD_Role
public final class MRole extends X_AD_Role implements SystemIDs
{
/**
*
@ -246,10 +246,10 @@ public final class MRole extends X_AD_Role
public static final boolean SQL_NOTQUALIFIED = false;
/** The AD_User_ID of the SuperUser */
public static final int SUPERUSER_USER_ID = 100;
public static final int SUPERUSER_USER_ID = USER_SUPERUSER;
/** The AD_User_ID of the System Administrator */
public static final int SYSTEM_USER_ID = 0;
public static final int SYSTEM_USER_ID = USER_SYSTEM;
private static final String ROLE_KEY = "org.compiere.model.DefaultRole";

View File

@ -46,7 +46,7 @@ import org.compiere.util.Trx;
* @author Carlos Ruiz - globalqss
* <li>Setup correctly IsSOTrx for return documents
*/
public final class MSetup
public final class MSetup implements SystemIDs
{
/**
* Constructor
@ -1058,7 +1058,7 @@ public final class MSetup
sqlCmd.append("(C_TaxCategory_ID,").append(m_stdColumns).append(",");
sqlCmd.append(" Name,IsDefault) VALUES (");
sqlCmd.append(C_TaxCategory_ID).append(",").append(m_stdValues).append(", ");
if (C_Country_ID == 100) // US
if (C_Country_ID == COUNTRY_US) // US
sqlCmd.append("'Sales Tax','Y')");
else
sqlCmd.append(defaultEntry).append("'Y')");

View File

@ -16,6 +16,8 @@
*****************************************************************************/
package org.compiere.model;
import org.compiere.util.DisplayType;
/**
* List all hardcoded ID used in the code
* @author Carlos Ruiz, Nicolas Micoud, ...
@ -23,9 +25,113 @@ package org.compiere.model;
public interface SystemIDs
{
public final static int COLUMN_AD_WF_ACTIVITY_AD_USER_ID = 10443;
public final static int COLUMN_C_BANKSTATEMENT_C_BANKACCOUNT_ID = 4917;
public final static int COLUMN_C_PERIOD_AD_ORG_ID = 839;
public final static int COLUMN_C_INVOICE_C_BPARTNER_ID = 3499;
public final static int COLUMN_C_INVOICE_C_CURRENCY_ID = 3505;
public final static int COLUMN_C_INVOICELINE_M_PRODUCT_ID = 3840;
public final static int COLUMN_C_PAYMENT_V_TENDERTYPE = 8416;
public final static int COLUMN_C_PAYSELECTIONCHECK_C_PAYSELECTION_ID = 7670;
public final static int COLUMN_FACT_ACCT_C_ACCTSCHEMA_ID = 2513;
public final static int COLUMN_FACT_ACCT_M_PRODUCT_ID = 2527;
public final static int COLUMN_M_MOVEMENTLINE_M_ATTRIBUTESETINSTANCE_ID = 8851;
public final static int COLUMN_M_PRODUCT_M_ATTRIBUTESETINSTANCE_ID = 8418;
public final static int COLUMN_S_RESOURCE_S_RESOURCETYPE_ID = 6851;
public final static int COLUMN_S_RESOURCEASSIGNMENT_S_RESOURCE_ID = 6826;
public final static int COUNTRY_US = 100;
public final static int COUNTRY_JAPAN = 216;
public final static int ENTITYTYPE_ADEMPIERE = 20;
public final static int ENTITYTYPE_DICTIONARY = 10;
public final static int FORM_PAYMENT_PRINT_EXPORT = 106;
public final static int FORM_ARCHIVEVIEWER = 118;
public final static int MENU_NOTICE = 233;
public final static int MESSAGE_REQUESTUPDATE = 834;
public final static int MESSAGE_WORKFLOWRESULT = 753;
public final static int PRINTFORMAT_STATEMENTOFACCOUNT = 134;
public final static int PROCESS_AD_WORKFLOW_DOCVALUE = 305;
public final static int PROCESS_AD_CHANGELOG_UNDO = 306;
public final static int PROCESS_AD_CHANGELOG_REDO = 307;
public final static int PROCESS_AD_NATIVE_SEQUENCE_ENABLE = 53156;
public final static int PROCESS_C_INVOICE_GENERATE = 119;
public final static int PROCESS_C_INVOICE_GENERATE_MANUAL = 134;
public final static int PROCESS_C_INVOICE_GENERATERMA_MANUAL = 52002;
public final static int PROCESS_C_PAYSELECTION_CREATEPAYMENT = 155;
public final static int PROCESS_M_INOUT_GENERATE = 118;
public final static int PROCESS_M_INOUT_GENERATE_MANUAL = 199;
public final static int PROCESS_M_INOUT_GENERATERMA_MANUAL = 52001;
public final static int PROCESS_RPT_C_ORDER = 110;
public final static int PROCESS_RPT_C_PAYMENT = 313;
public final static int PROCESS_RPT_M_INOUT = 117;
public final static int PROCESS_RPT_C_INVOICE = 116;
public final static int PROCESS_RPT_C_PROJECT = 217;
public final static int PROCESS_RPT_C_RFQRESPONSE = 276;
public final static int PROCESS_RPT_C_DUNNING = 159;
public final static int PROCESS_RPT_FINREPORT = 202;
public final static int PROCESS_RPT_FINSTATEMENT = 204;
public final static int REFERENCE_DATATYPE_ACCOUNT = DisplayType.Account; //25
public final static int REFERENCE_DATATYPE_INTEGER = 11;
public final static int REFERENCE_DATATYPE_LIST = 17;
public final static int REFERENCE_DATATYPE_TEXT = 14;
public final static int REFERENCE_DATATYPE_MEMO = 34;
public final static int REFERENCE_DATATYPE_AMOUNT = 12;
public final static int REFERENCE_DATATYPE_DATE = 15;
public final static int REFERENCE_DATATYPE_DATETIME = 16;
public final static int REFERENCE_DATATYPE_ID = 13;
public final static int REFERENCE_DATATYPE_STRING = 10;
public final static int REFERENCE_DATATYPE_NUMBER = 22;
public final static int REFERENCE_DATATYPE_YES_NO = 20;
public final static int REFERENCE_DATATYPE_BUTTON = 28;
public final static int REFERENCE_DATATYPE_TABLE = 18;
public final static int REFERENCE_DATATYPE_TABLEDIR = 19;
public final static int REFERENCE_DATATYPE_SEARCH = 30;
public final static int REFERENCE_DATATYPE_QUANTITY = 29;
public final static int REFERENCE_DATATYPE_PRODUCTATTRIBUTE = 35;
public final static int REFERENCE_DATATYPE_LOCATOR = 31;
public final static int REFERENCE_DATATYPE_LOCATION = 21;
public final static int REFERENCE_DATATYPE_COLOR = 27;
public static final int REFERENCE_AD_USER = 110;
public final static int REFERENCE_DOCUMENTACTION = 135;
public final static int REFERENCE_PAYMENTRULE = 195;
public final static int REFERENCE_POSTING_TYPE = 125;
public final static int REFERENCE_YESNO = 319;
public final static int TABLE_AD_TABLE = 100;
public final static int TABLE_AD_WF_PROCESS = 645;
public final static int TABLE_AD_WF_ACTIVITY = 644;
public final static int TABLE_I_PRODUCT = 532;
public final static int TABLE_I_BPARTNER = 533;
public final static int TABLE_I_ELEMENTVALUE = 534;
public final static int TABLE_I_REPORTLINE = 535;
public final static int TABLE_T_REPORT = 544;
public final static int TREE_MENUPRIMARY = 10;
public final static int USER_SUPERUSER = 100;
public final static int USER_SYSTEM = 0;
public final static int WINDOW_ACCOUNTCOMBINATION = 153;
public static final int WINDOW_CUSTOMERRETURN = 53097;
public final static int WINDOW_INVENTORYMOVE = 170;
public final static int WINDOW_LOT = 257;
public final static int WINDOW_MATERIALRECEIPT = 184;
public final static int WINDOW_MATERIALTRANSACTIONS_INDIRECTUSER = 223;
public final static int WINDOW_MY_REQUESTS = 237;
public final static int WINDOW_PHYSICALINVENTORY = 168;
public final static int WINDOW_PRINTFORMAT = 240;
public final static int WINDOW_PRODUCTION = 191;
public final static int WINDOW_REQUESTS_ALL = 232;
public static final int WINDOW_RETURNTOVENDOR = 53098;
public final static int WINDOW_SHIPMENT_CUSTOMER = 169;
public final static int WINDOW_WAREHOUSE_LOCATOR = 139;
public final static int WINDOW_WINDOW_TAB_FIELD = 102;
}

View File

@ -68,6 +68,7 @@ import org.compiere.model.MProject;
import org.compiere.model.MQuery;
import org.compiere.model.MRfQResponse;
import org.compiere.model.PrintInfo;
import org.compiere.model.SystemIDs;
import org.compiere.print.layout.LayoutEngine;
import org.compiere.process.ProcessInfo;
import org.compiere.util.CLogger;
@ -78,7 +79,7 @@ import org.compiere.util.Ini;
import org.compiere.util.Language;
import org.compiere.util.Util;
import org.eevolution.model.MDDOrder;
import org.eevolution.model.X_PP_Order; // to be changed by MPPOrder
import org.eevolution.model.X_PP_Order;
/**
* Report Engine.
@ -104,7 +105,7 @@ import org.eevolution.model.X_PP_Order; // to be changed by MPPOrder
*
* FR 2872010 - Dunning Run for a complete Dunning (not just level) - Developer: Carlos Ruiz - globalqss - Sponsor: Metas
*/
public class ReportEngine implements PrintServiceAttributeListener
public class ReportEngine implements PrintServiceAttributeListener, SystemIDs
{
/**
* Constructor
@ -1567,7 +1568,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
{
org.compiere.Adempiere.startupEnvironment(true);
//
int AD_Table_ID = 100;
int AD_Table_ID = TABLE_AD_TABLE;
MQuery q = new MQuery("AD_Table");
q.addRestriction("AD_Table_ID", "<", 108);
//

View File

@ -21,6 +21,7 @@ import java.math.BigDecimal;
import java.util.Properties;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
/**
@ -88,7 +89,7 @@ public interface DocAction
public static final String STATUS_WaitingConfirmation = "WC";
/** DocAction Ref_List values **/
public static final int AD_REFERENCE_ID = 135;
public static final int AD_REFERENCE_ID = SystemIDs.REFERENCE_DOCUMENTACTION;
/**
* Set Doc Status

View File

@ -25,6 +25,7 @@ import java.util.logging.Level;
import org.compiere.model.MAcctSchemaElement;
import org.compiere.model.MReportCube;
import org.compiere.model.SystemIDs;
import org.compiere.print.MPrintFormat;
import org.compiere.print.MPrintFormatItem;
import org.compiere.process.ProcessInfoParameter;
@ -45,7 +46,7 @@ import org.compiere.util.TimeUtil;
*
* @version $Id: FinReport.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $
*/
public class FinReport extends SvrProcess
public class FinReport extends SvrProcess implements SystemIDs
{
/** Period Parameter */
private int p_C_Period_ID = 0;
@ -1177,7 +1178,7 @@ public class FinReport extends SvrProcess
// Create New
if (createNew)
{
int AD_Table_ID = 544; // T_Report
int AD_Table_ID = TABLE_T_REPORT; // T_Report
pf = MPrintFormat.createFromTable(Env.getCtx(), AD_Table_ID);
AD_PrintFormat_ID = pf.getAD_PrintFormat_ID();
m_report.setAD_PrintFormat_ID(AD_PrintFormat_ID);

View File

@ -27,6 +27,7 @@ import java.util.logging.Level;
import org.compiere.model.MAcctSchemaElement;
import org.compiere.model.MElementValue;
import org.compiere.model.MPeriod;
import org.compiere.model.SystemIDs;
import org.compiere.print.MPrintFormat;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess;
@ -52,7 +53,7 @@ import org.compiere.util.Msg;
* <li>FR [2857076] User Element 1 and 2 completion - https://sourceforge.net/tracker/?func=detail&aid=2857076&group_id=176962&atid=879335
*
*/
public class FinStatement extends SvrProcess
public class FinStatement extends SvrProcess implements SystemIDs
{
/** AcctSchame Parameter */
private int p_C_AcctSchema_ID = 0;
@ -273,7 +274,7 @@ public class FinStatement extends SvrProcess
createBalanceLine();
createDetailLines();
int AD_PrintFormat_ID = 134;
int AD_PrintFormat_ID = PRINTFORMAT_STATEMENTOFACCOUNT;
if (Ini.isClient())
getProcessInfo().setTransientObject (MPrintFormat.get (getCtx(), AD_PrintFormat_ID, false));
else

View File

@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.compiere.model.DocWorkflowMgr;
import org.compiere.model.PO;
import org.compiere.model.SystemIDs;
import org.compiere.process.ProcessInfo;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
@ -35,7 +36,7 @@ import org.compiere.util.Evaluator;
* @author Jorg Janke
* @version $Id: DocWorkflowManager.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $
*/
public class DocWorkflowManager implements DocWorkflowMgr
public class DocWorkflowManager implements DocWorkflowMgr, SystemIDs
{
/**
* Get Document Workflow Manager
@ -119,7 +120,7 @@ public class DocWorkflowManager implements DocWorkflowMgr
// Start Workflow
log.fine(logic);
int AD_Process_ID = 305; // HARDCODED
int AD_Process_ID = PROCESS_AD_WORKFLOW_DOCVALUE; // HARDCODED
ProcessInfo pi = new ProcessInfo (wf.getName(), AD_Process_ID,
AD_Table_ID, document.get_ID());
pi.setAD_User_ID (Env.getAD_User_ID(document.getCtx()));

View File

@ -51,6 +51,7 @@ import org.compiere.model.MUser;
import org.compiere.model.MUserRoles;
import org.compiere.model.PO;
import org.compiere.model.Query;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_AD_WF_Activity;
import org.compiere.print.ReportEngine;
import org.compiere.process.DocAction;
@ -72,7 +73,7 @@ import org.compiere.util.Util;
* @author Jorg Janke
* @version $Id: MWFActivity.java,v 1.4 2006/07/30 00:51:05 jjanke Exp $
*/
public class MWFActivity extends X_AD_WF_Activity implements Runnable
public class MWFActivity extends X_AD_WF_Activity implements Runnable, SystemIDs
{
/**
*
@ -1048,7 +1049,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable
throw new IllegalStateException("Cannot create Report AD_Process_ID=" + m_node.getAD_Process_ID());
File report = re.getPDF();
// Notice
int AD_Message_ID = 753; // HARDCODED WorkflowResult
int AD_Message_ID = MESSAGE_WORKFLOWRESULT; // HARDCODED WorkflowResult
MNote note = new MNote(getCtx(), AD_Message_ID, getAD_User_ID(), trx.getTrxName());
note.setTextMsg(m_node.getName(true));
note.setDescription(m_node.getDescription(true));

View File

@ -29,6 +29,7 @@ import org.compiere.model.MSequence;
import org.compiere.model.MSysConfig;
import org.compiere.model.MTable;
import org.compiere.model.Query;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_AD_Table;
import org.compiere.process.ProcessInfo;
import org.compiere.process.SvrProcess;
@ -42,7 +43,7 @@ import org.compiere.util.Env;
* @author Victor Perez, e-Evolution, S.C.
* @author Teo Sarca, teo.sarca@gmail.com
*/
public class EnableNativeSequence extends SvrProcess
public class EnableNativeSequence extends SvrProcess implements SystemIDs
{
/**
@ -128,7 +129,7 @@ public class EnableNativeSequence extends SvrProcess
CLogMgt.setLevel(Level.INFO);
Properties ctx = Env.getCtx();
int AD_Process_ID = 53156; // HARDCODED
int AD_Process_ID = PROCESS_AD_NATIVE_SEQUENCE_ENABLE; // HARDCODED
MPInstance pinstance = new MPInstance(ctx, AD_Process_ID, -1);
pinstance.saveEx();

View File

@ -28,6 +28,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.compiere.model.PO;
import org.compiere.model.POInfo;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_AD_Package_Imp_Detail;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
@ -36,7 +37,7 @@ import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
public abstract class AbstractElementHandler implements ElementHandler {
public abstract class AbstractElementHandler implements ElementHandler, SystemIDs {
protected CLogger log = CLogger.getCLogger("PackIn");
@ -203,10 +204,10 @@ public abstract class AbstractElementHandler implements ElementHandler {
sqlD = new StringBuffer("SELECT MAX(AD_PACKAGE_IMP_DETAIL_ID) FROM AD_PACKAGE_IMP_DETAIL");
int idDetail = DB.getSQLValue(getTrxName(ctx),sqlD.toString())+1;
if (referenceID == 10 || referenceID == 14 || referenceID == 34 || referenceID == 17)
if (referenceID == REFERENCE_DATATYPE_STRING || referenceID == REFERENCE_DATATYPE_TEXT || referenceID == REFERENCE_DATATYPE_MEMO || referenceID == REFERENCE_DATATYPE_LIST)
if (from != null && from.get_Value(i)!= null)
colValue = from.get_Value(i).toString().replaceAll("'","''");
else if (referenceID == 20|| referenceID == 28)
else if (referenceID == REFERENCE_DATATYPE_YES_NO|| referenceID == REFERENCE_DATATYPE_BUTTON)
if (from != null && from.get_Value(i)!= null)
colValue = from.get_Value(i).toString().replaceAll("'","''");
else

View File

@ -25,6 +25,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.logging.Level;
import org.compiere.model.SystemIDs;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess;
import org.compiere.util.DB;
@ -36,7 +37,7 @@ import org.compiere.util.Env;
* @author Robert Klein
*
*/
public class PackRoll extends SvrProcess {
public class PackRoll extends SvrProcess implements SystemIDs {
/** Package from Record */
private int m_AD_Package_Imp_ID = 0;
private String m_Processing = null;
@ -258,14 +259,14 @@ public class PackRoll extends SvrProcess {
// Update columns that are Strings adjusting
// for single quotes
if (v_AD_Reference_ID == 10
|| v_AD_Reference_ID == 14
|| v_AD_Reference_ID == 34
|| v_AD_Reference_ID == 17
|| v_AD_Reference_ID == REFERENCE_DATATYPE_TEXT
|| v_AD_Reference_ID == REFERENCE_DATATYPE_MEMO
|| v_AD_Reference_ID == REFERENCE_DATATYPE_LIST
// Carlos Ruiz globalqss, special
// treatment for EntityType
// it's a Table reference but must
// be treated as String
|| (v_AD_Reference_ID == 18 && columnName
|| (v_AD_Reference_ID == REFERENCE_DATATYPE_TABLE && columnName
.equalsIgnoreCase("EntityType")))
if (rs2.getObject("ColValue")
.toString().equals("null")) {
@ -285,8 +286,8 @@ public class PackRoll extends SvrProcess {
+ " = " + recordID);
}
// Update true/false columns
else if (v_AD_Reference_ID == 20
|| v_AD_Reference_ID == 28) {
else if (v_AD_Reference_ID == REFERENCE_DATATYPE_YES_NO
|| v_AD_Reference_ID == REFERENCE_DATATYPE_BUTTON) {
sqlC = new StringBuffer("UPDATE "
+ tableName
+ " SET "
@ -301,15 +302,15 @@ public class PackRoll extends SvrProcess {
}
// Update columns that are Strings adjusting
// for single quotes
else if (v_AD_Reference_ID == 13
|| v_AD_Reference_ID == 18
|| v_AD_Reference_ID == 19
|| v_AD_Reference_ID == 21
|| v_AD_Reference_ID == 25
|| v_AD_Reference_ID == 27
|| v_AD_Reference_ID == 30
|| v_AD_Reference_ID == 31
|| v_AD_Reference_ID == 35)
else if (v_AD_Reference_ID == REFERENCE_DATATYPE_ID
|| v_AD_Reference_ID == REFERENCE_DATATYPE_TABLE
|| v_AD_Reference_ID == REFERENCE_DATATYPE_TABLEDIR
|| v_AD_Reference_ID == REFERENCE_DATATYPE_LOCATION
|| v_AD_Reference_ID == REFERENCE_DATATYPE_ACCOUNT
|| v_AD_Reference_ID == REFERENCE_DATATYPE_COLOR
|| v_AD_Reference_ID == REFERENCE_DATATYPE_SEARCH
|| v_AD_Reference_ID == REFERENCE_DATATYPE_LOCATOR
|| v_AD_Reference_ID == REFERENCE_DATATYPE_PRODUCTATTRIBUTE)
sqlC = new StringBuffer("UPDATE "
+ tableName
+ " SET "
@ -321,10 +322,10 @@ public class PackRoll extends SvrProcess {
+ " WHERE " + columnIDName
+ " = " + recordID);
// Update columns that are numbers
else if (v_AD_Reference_ID == 11
|| v_AD_Reference_ID == 12
|| v_AD_Reference_ID == 22
|| v_AD_Reference_ID == 29)
else if (v_AD_Reference_ID == REFERENCE_DATATYPE_INTEGER
|| v_AD_Reference_ID == REFERENCE_DATATYPE_AMOUNT
|| v_AD_Reference_ID == REFERENCE_DATATYPE_NUMBER
|| v_AD_Reference_ID == REFERENCE_DATATYPE_QUANTITY)
sqlC = new StringBuffer("UPDATE "
+ tableName
+ " SET "
@ -336,8 +337,8 @@ public class PackRoll extends SvrProcess {
+ " WHERE " + columnIDName
+ " = " + recordID);
// Update columns that are dates
else if (v_AD_Reference_ID == 15
|| v_AD_Reference_ID == 16)
else if (v_AD_Reference_ID == REFERENCE_DATATYPE_DATE
|| v_AD_Reference_ID == REFERENCE_DATATYPE_DATETIME)
// TODO Develop portable code to update
// date columns
;// ignore

View File

@ -27,6 +27,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_AD_Menu;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -34,7 +35,7 @@ import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
public class MenuElementHandler extends AbstractElementHandler {
public class MenuElementHandler extends AbstractElementHandler implements SystemIDs {
public void startElement(Properties ctx, Element element)
throws SAXException {
@ -197,7 +198,7 @@ public class MenuElementHandler extends AbstractElementHandler {
int idBackup = DB.getNextID(Env
.getAD_Client_ID(ctx), "AD_Package_Imp_Backup",
getTrxName(ctx));
if (referenceID == 20 || referenceID == 28)
if (referenceID == REFERENCE_DATATYPE_YES_NO || referenceID == REFERENCE_DATATYPE_BUTTON)
if (rs1.getObject(q).equals("Y"))
colValue = "true";
else

View File

@ -29,6 +29,7 @@ import javax.swing.JPopupMenu;
import org.compiere.apps.form.ArchiveViewer;
import org.compiere.apps.form.FormFrame;
import org.compiere.model.MBPartner;
import org.compiere.model.SystemIDs;
import org.compiere.swing.CMenuItem;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
@ -43,7 +44,7 @@ import org.compiere.util.Msg;
* @author Jorg Janke
* @version $Id: AArchive.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $
*/
public class AArchive implements ActionListener
public class AArchive implements ActionListener, SystemIDs
{
/**
* Constructor
@ -165,7 +166,7 @@ public class AArchive implements ActionListener
*/
public void actionPerformed (ActionEvent e)
{
int AD_Form_ID = 118; // ArchiveViewer
int AD_Form_ID = FORM_ARCHIVEVIEWER; // ArchiveViewer
FormFrame ff = new FormFrame(m_graphicsconfig);
ff.openForm(AD_Form_ID);
ArchiveViewer av = (ArchiveViewer)ff.getFormPanel();

View File

@ -51,6 +51,7 @@ import org.compiere.interfaces.Server;
import org.compiere.model.MMenu;
import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.model.SystemIDs;
import org.compiere.process.DocumentEngine;
import org.compiere.swing.CButton;
import org.compiere.swing.CFrame;
@ -74,7 +75,7 @@ import org.compiere.util.Splash;
* @see FR [ 1966328 ] New Window Info to MRP and CRP into View http://sourceforge.net/tracker/index.php?func=detail&aid=1966328&group_id=176962&atid=879335
*
*/
public final class AEnv
public final class AEnv implements SystemIDs
{
// Array of active Windows
private static ArrayList<Container> s_windows = new ArrayList<Container>(20);
@ -795,12 +796,12 @@ public final class AEnv
if (s_workflow == null)
{
s_workflow = Boolean.FALSE;
int AD_Table_ID = 645; // AD_WF_Process
int AD_Table_ID = TABLE_AD_WF_PROCESS; // AD_WF_Process
if (MRole.getDefault().isTableAccess (AD_Table_ID, true)) // RO
s_workflow = Boolean.TRUE;
else
{
AD_Table_ID = 644; // AD_WF_Activity
AD_Table_ID = TABLE_AD_WF_ACTIVITY; // AD_WF_Activity
if (MRole.getDefault().isTableAccess (AD_Table_ID, true)) // RO
s_workflow = Boolean.TRUE;
else

View File

@ -168,7 +168,7 @@ public final class AMenu extends CFrame
+ " INNER JOIN AD_Role r ON (ci.AD_Client_ID=r.AD_Client_ID) "
+ "WHERE AD_Role_ID=?", AD_Role_ID);
if (AD_Tree_ID <= 0)
AD_Tree_ID = 10; // Menu
AD_Tree_ID = TREE_MENUPRIMARY; // Menu
treePanel.initTree(AD_Tree_ID);
// Translate
@ -656,7 +656,7 @@ public final class AMenu extends CFrame
+ " INNER JOIN AD_TABLE t ON (t.AD_Window_ID=m.AD_Window_ID) "
+ "WHERE t.AD_Table_ID=?", 389);
if (m_note_Menu_ID == 0)
m_note_Menu_ID = 233; // fallback HARDCODED
m_note_Menu_ID = MENU_NOTICE; // fallback HARDCODED
(new AMenuStartItem (m_note_Menu_ID, true, Msg.translate(m_ctx, "AD_Note_ID"), this)).start(); // async load
} // gotoMessage

View File

@ -90,6 +90,7 @@ import org.compiere.model.MRole;
import org.compiere.model.MToolBarButtonRestrict;
import org.compiere.model.MUser;
import org.compiere.model.MWindow;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_AD_ToolBarButton;
import org.compiere.plaf.CompiereColor;
import org.compiere.print.AReport;
@ -143,7 +144,7 @@ import org.compiere.util.Util;
* @sponsor www.metas.de
*/
public final class APanel extends CPanel
implements DataStatusListener, ChangeListener, ActionListener, IProcessMonitor
implements DataStatusListener, ChangeListener, ActionListener, IProcessMonitor, SystemIDs
{
/**
*
@ -2509,7 +2510,7 @@ public final class APanel extends CPanel
record_ID = Env.getContextAsInt (m_ctx, m_curWindowNo, "AD_Language_ID");
// Record_ID - Change Log ID
if (record_ID == -1
&& (vButton.getProcess_ID() == 306 || vButton.getProcess_ID() == 307))
&& (vButton.getProcess_ID() == PROCESS_AD_CHANGELOG_UNDO || vButton.getProcess_ID() == PROCESS_AD_CHANGELOG_REDO))
{
Integer id = (Integer)m_curTab.getValue("AD_ChangeLog_ID");
record_ID = id.intValue();

View File

@ -41,6 +41,7 @@ import org.compiere.model.MQuery;
import org.compiere.model.MRMA;
import org.compiere.model.MRequest;
import org.compiere.model.MUser;
import org.compiere.model.SystemIDs;
import org.compiere.swing.CMenuItem;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
@ -58,7 +59,7 @@ import org.compiere.util.Msg;
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>BF [ 1904928 ] Request: Related Request field not filled
*/
public class ARequest implements ActionListener
public class ARequest implements ActionListener, SystemIDs
{
/**
* Constructor
@ -209,7 +210,7 @@ public class ARequest implements ActionListener
query.setRecordCount(0);
}
//
int AD_Window_ID = 232; // 232=all - 201=my
int AD_Window_ID = WINDOW_REQUESTS_ALL; // 232=all - 201=my
AWindow frame = new AWindow(m_graphicsconfig);
if (!frame.initWindow(AD_Window_ID, query))
return;

View File

@ -37,6 +37,7 @@ import javax.swing.JSeparator;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.exceptions.DBException;
import org.adempiere.util.IProcessMonitor;
import org.compiere.model.SystemIDs;
import org.compiere.print.ReportCtl;
import org.compiere.print.ReportEngine;
import org.compiere.process.ProcessInfo;
@ -64,10 +65,10 @@ import org.compiere.util.Msg;
* - Implement ShowHelp option on processes and reports
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>BF [ 1893525 ] ProcessDialog: Cannot select the text from text field
* <li>BF [ 1963128 ] Running a process w/o trl should display an error
*/
* <li>BF [ 1963128 ] Running a process w/o trl should display an error
*/
public class ProcessDialog extends CFrame
implements ActionListener, IProcessMonitor
implements ActionListener, IProcessMonitor, SystemIDs
{
/**
*
@ -441,9 +442,9 @@ public class ProcessDialog extends CFrame
{
log.config("");
// Print invoices
if (m_AD_Process_ID == 119)
if (m_AD_Process_ID == PROCESS_C_INVOICE_GENERATE)
printInvoices();
else if (m_AD_Process_ID == 118)
else if (m_AD_Process_ID == PROCESS_M_INOUT_GENERATE)
printShipments();
}

View File

@ -45,6 +45,7 @@ import org.compiere.grid.ed.VLookup;
import org.compiere.minigrid.MiniTable;
import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.SystemIDs;
import org.compiere.plaf.CompiereColor;
import org.compiere.swing.CPanel;
import org.compiere.swing.CTextField;
@ -55,7 +56,7 @@ import org.compiere.util.Trx;
import org.compiere.util.TrxRunnable;
public class VAllocation extends Allocation
implements FormPanel, ActionListener, TableModelListener, VetoableChangeListener
implements FormPanel, ActionListener, TableModelListener, VetoableChangeListener, SystemIDs
{
private CPanel panel = new CPanel();
@ -240,21 +241,21 @@ public class VAllocation extends Allocation
public void dynInit() throws Exception
{
// Currency
int AD_Column_ID = 3505; // C_Invoice.C_Currency_ID
int AD_Column_ID = COLUMN_C_INVOICE_C_CURRENCY_ID; // C_Invoice.C_Currency_ID
MLookup lookupCur = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.TableDir);
currencyPick = new VLookup("C_Currency_ID", true, false, true, lookupCur);
currencyPick.setValue(new Integer(m_C_Currency_ID));
currencyPick.addVetoableChangeListener(this);
// Organization filter selection
AD_Column_ID = 839; //C_Period.AD_Org_ID (needed to allow org 0)
AD_Column_ID = COLUMN_C_PERIOD_AD_ORG_ID; //C_Period.AD_Org_ID (needed to allow org 0)
MLookup lookupOrg = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.TableDir);
organizationPick = new VLookup("AD_Org_ID", true, false, true, lookupOrg);
organizationPick.setValue(Env.getAD_Org_ID(Env.getCtx()));
organizationPick.addVetoableChangeListener(this);
// BPartner
AD_Column_ID = 3499; // C_Invoice.C_BPartner_ID
AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
MLookup lookupBP = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.Search);
bpartnerSearch = new VLookup("C_BPartner_ID", true, false, true, lookupBP);
bpartnerSearch.addVetoableChangeListener(this);

View File

@ -42,6 +42,7 @@ import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MPaySelectionCheck;
import org.compiere.model.MPaymentBatch;
import org.compiere.model.SystemIDs;
import org.compiere.plaf.CompiereColor;
import org.compiere.print.ReportCtl;
import org.compiere.print.ReportEngine;
@ -65,7 +66,7 @@ import org.compiere.util.ValueNamePair;
* Contributors:
* Carlos Ruiz - GlobalQSS - FR 3132033 - Make payment export class configurable per bank
*/
public class VPayPrint extends PayPrint implements FormPanel, ActionListener, VetoableChangeListener
public class VPayPrint extends PayPrint implements FormPanel, ActionListener, VetoableChangeListener, SystemIDs
{
private CPanel panel = new CPanel();
@ -198,7 +199,7 @@ public class VPayPrint extends PayPrint implements FormPanel, ActionListener, Ve
{
// C_PaySelection_ID
int AD_Column_ID = 7670; // C_PaySelectionCheck.C_PaySelection_ID
int AD_Column_ID = COLUMN_C_PAYSELECTIONCHECK_C_PAYSELECTION_ID; // C_PaySelectionCheck.C_PaySelection_ID
MLookup lookupPS = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.Search);
paySelectSearch = new VLookup("C_PaySelection_ID", true, false, true, lookupPS);
paySelectSearch.addVetoableChangeListener(this);

View File

@ -46,6 +46,7 @@ import org.compiere.grid.ed.VCheckBox;
import org.compiere.grid.ed.VComboBox;
import org.compiere.grid.ed.VDate;
import org.compiere.minigrid.MiniTable;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_C_PaySelection;
import org.compiere.plaf.CompiereColor;
import org.compiere.process.ProcessInfo;
@ -65,7 +66,7 @@ import org.compiere.util.ValueNamePair;
* @author Jorg Janke
* @version $Id: VPaySelect.java,v 1.2 2008/07/11 08:20:12 cruiz Exp $
*/
public class VPaySelect extends PaySelect implements FormPanel, ActionListener, TableModelListener, IProcessMonitor
public class VPaySelect extends PaySelect implements FormPanel, ActionListener, TableModelListener, IProcessMonitor, SystemIDs
{
/** @todo withholding */
private CPanel panel = new CPanel();
@ -365,7 +366,7 @@ public class VPaySelect extends PaySelect implements FormPanel, ActionListener,
return;
// Prepare Process
int AD_Proces_ID = 155; // C_PaySelection_CreatePayment
int AD_Proces_ID = PROCESS_C_PAYSELECTION_CREATEPAYMENT; // C_PaySelection_CreatePayment
ProcessInfo pi = new ProcessInfo (m_frame.getTitle(), AD_Proces_ID,
X_C_PaySelection.Table_ID, m_ps.getC_PaySelection_ID());
pi.setAD_User_ID (Env.getAD_User_ID(Env.getCtx()));
@ -403,7 +404,7 @@ public class VPaySelect extends PaySelect implements FormPanel, ActionListener,
return;
// Start PayPrint
int AD_Form_ID = 106; // Payment Print/Export
int AD_Form_ID = FORM_PAYMENT_PRINT_EXPORT; // Payment Print/Export
FormFrame ff = new FormFrame();
ff.openForm (AD_Form_ID);
// Set Parameter

View File

@ -82,6 +82,7 @@ import org.compiere.model.MProduct;
import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.model.MUserQuery;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_AD_Column;
import org.compiere.swing.CButton;
import org.compiere.swing.CComboBox;
@ -112,7 +113,7 @@ import org.compiere.util.ValueNamePair;
* <li>BF [ 2564070 ] Saving user queries can produce unnecessary db errors
*/
public final class Find extends CDialog
implements ActionListener, ChangeListener, DataStatusListener
implements ActionListener, ChangeListener, DataStatusListener, SystemIDs
{
/**
*
@ -209,7 +210,7 @@ public final class Find extends CDialog
/** Length of Fields on first tab */
public static final int FIELDLENGTH = 20;
/** Reference ID for Yes/No */
public static final int AD_REFERENCE_ID_YESNO = 319;
public static final int AD_REFERENCE_ID_YESNO = REFERENCE_YESNO;
//

View File

@ -31,6 +31,7 @@ import org.compiere.grid.ed.VLookup;
import org.compiere.minigrid.IDColumn;
import org.compiere.model.Lookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.SystemIDs;
import org.compiere.swing.CButton;
import org.compiere.swing.CLabel;
import org.compiere.util.DB;
@ -45,7 +46,7 @@ import org.compiere.util.Msg;
* @author Jorg Janke
* @version $Id: InfoAssignment.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $
*/
public class InfoAssignment extends Info
public class InfoAssignment extends Info implements SystemIDs
{
/**
*
@ -120,10 +121,10 @@ public class InfoAssignment extends Info
{
try
{
int AD_Column_ID = 6851; // S_Resource.S_ResourceType_ID
int AD_Column_ID = COLUMN_S_RESOURCE_S_RESOURCETYPE_ID; // S_Resource.S_ResourceType_ID
Lookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir);
fieldResourceType = new VLookup ("S_ResourceType_ID", false, false, true, lookup);
AD_Column_ID = 6826; // S_ResourceAssignment.S_Resource_ID
AD_Column_ID = COLUMN_S_RESOURCEASSIGNMENT_S_RESOURCE_ID; // S_ResourceAssignment.S_Resource_ID
lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir);
fieldResource = new VLookup ("S_Resource_ID", false, false, true, lookup);
}

View File

@ -35,6 +35,7 @@ import org.compiere.model.GridTab;
import org.compiere.model.MDocType;
import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.SystemIDs;
import org.compiere.swing.CPanel;
import org.compiere.util.CLogger;
import org.compiere.util.DisplayType;
@ -42,7 +43,7 @@ import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg;
public class VCreateFromInvoiceUI extends CreateFromInvoice implements ActionListener, VetoableChangeListener
public class VCreateFromInvoiceUI extends CreateFromInvoice implements ActionListener, VetoableChangeListener, SystemIDs
{
private static final long serialVersionUID = 1L;
@ -251,7 +252,7 @@ public class VCreateFromInvoiceUI extends CreateFromInvoice implements ActionLis
protected void initBPartner (boolean forInvoice) throws Exception
{
// load BPartner
int AD_Column_ID = 3499; // C_Invoice.C_BPartner_ID
int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search);
bPartnerField = new VLookup ("C_BPartner_ID", true, false, true, lookup);
//

View File

@ -30,13 +30,14 @@ import org.compiere.grid.ed.VLookup;
import org.compiere.model.GridTab;
import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.SystemIDs;
import org.compiere.swing.CPanel;
import org.compiere.util.CLogger;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Msg;
public class VCreateFromRMAUI extends CreateFromRMA implements VetoableChangeListener
public class VCreateFromRMAUI extends CreateFromRMA implements VetoableChangeListener, SystemIDs
{
private static final long serialVersionUID = 1L;
@ -155,7 +156,7 @@ public class VCreateFromRMAUI extends CreateFromRMA implements VetoableChangeLis
protected void initBPartner (boolean forInvoice) throws Exception
{
// load BPartner
int AD_Column_ID = 3499; // C_Invoice.C_BPartner_ID
int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search);
bPartnerField = new VLookup ("C_BPartner_ID", true, false, true, lookup);
//

View File

@ -52,6 +52,7 @@ import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MProduct;
import org.compiere.model.Query;
import org.compiere.model.SystemIDs;
import org.compiere.swing.CPanel;
import org.compiere.util.CLogger;
import org.compiere.util.DisplayType;
@ -59,11 +60,8 @@ import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg;
public class VCreateFromShipmentUI extends CreateFromShipment implements ActionListener, VetoableChangeListener
public class VCreateFromShipmentUI extends CreateFromShipment implements ActionListener, VetoableChangeListener, SystemIDs
{
private static final int WINDOW_CUSTOMER_RETURN = 53097;
private static final int WINDOW_RETURN_TO_VENDOR = 53098;
private VCreateFromDialog dialog;
@ -161,7 +159,7 @@ public class VCreateFromShipmentUI extends CreateFromShipment implements ActionL
*/
private void jbInit() throws Exception
{
boolean isRMAWindow = ((getGridTab().getAD_Window_ID() == WINDOW_RETURN_TO_VENDOR) || (getGridTab().getAD_Window_ID() == WINDOW_CUSTOMER_RETURN));
boolean isRMAWindow = ((getGridTab().getAD_Window_ID() == WINDOW_RETURNTOVENDOR) || (getGridTab().getAD_Window_ID() == WINDOW_CUSTOMERRETURN));
bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));
orderLabel.setText(Msg.getElement(Env.getCtx(), "C_Order_ID", false));
@ -304,7 +302,7 @@ public class VCreateFromShipmentUI extends CreateFromShipment implements ActionL
protected void initBPartner (boolean forInvoice) throws Exception
{
// load BPartner
int AD_Column_ID = 3499; // C_Invoice.C_BPartner_ID
int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search);
bPartnerField = new VLookup ("C_BPartner_ID", true, false, true, lookup);
//

View File

@ -43,6 +43,7 @@ import org.compiere.model.MColumn;
import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MPayment;
import org.compiere.model.SystemIDs;
import org.compiere.swing.CButton;
import org.compiere.swing.CLabel;
import org.compiere.swing.CPanel;
@ -52,7 +53,7 @@ import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Msg;
public class VCreateFromStatementUI extends CreateFromStatement implements ActionListener
public class VCreateFromStatementUI extends CreateFromStatement implements ActionListener, SystemIDs
{
private static final long serialVersionUID = 1L;
@ -145,7 +146,7 @@ public class VCreateFromStatementUI extends CreateFromStatement implements Actio
dialog.setTitle(getTitle());
int AD_Column_ID = 4917; // C_BankStatement.C_BankAccount_ID
int AD_Column_ID = COLUMN_C_BANKSTATEMENT_C_BANKACCOUNT_ID; // C_BankStatement.C_BankAccount_ID
MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir);
bankAccountField = new VLookup ("C_BankAccount_ID", true, true, true, lookup);
// Set Default

View File

@ -61,6 +61,7 @@ import org.compiere.model.MAccountLookup;
import org.compiere.model.MAcctSchema;
import org.compiere.model.MAcctSchemaElement;
import org.compiere.model.MQuery;
import org.compiere.model.SystemIDs;
import org.compiere.swing.CButton;
import org.compiere.swing.CDialog;
import org.compiere.swing.CPanel;
@ -76,7 +77,7 @@ import org.compiere.util.Msg;
* @version $Id: VAccountDialog.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $
*/
public final class VAccountDialog extends CDialog
implements ActionListener, DataStatusListener, VetoableChangeListener
implements ActionListener, DataStatusListener, VetoableChangeListener, SystemIDs
{
/**
*
@ -272,7 +273,7 @@ public final class VAccountDialog extends CDialog
Env.setContext(Env.getCtx(), m_WindowNo, "C_AcctSchema_ID", m_C_AcctSchema_ID);
// Model
int AD_Window_ID = 153; // Maintain Account Combinations
int AD_Window_ID = WINDOW_ACCOUNTCOMBINATION; // Maintain Account Combinations
GridWindowVO wVO = Env.getMWindowVO (m_WindowNo, AD_Window_ID, 0);
if (wVO == null)
return false;

View File

@ -50,6 +50,7 @@ import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.model.MTable;
import org.compiere.model.MWarehouse;
import org.compiere.model.SystemIDs;
import org.compiere.swing.CButton;
import org.compiere.swing.CMenuItem;
import org.compiere.util.CLogger;
@ -64,7 +65,7 @@ import org.compiere.util.Msg;
* @version $Id: VLocator.java,v 1.5 2006/07/30 00:51:27 jjanke Exp $
*/
public class VLocator extends JComponent
implements VEditor, ActionListener
implements VEditor, ActionListener, SystemIDs
{
/**
*
@ -521,7 +522,7 @@ public class VLocator extends JComponent
{
int AD_Window_ID = MTable.get(Env.getCtx(), MLocator.Table_ID).getAD_Window_ID();
if (AD_Window_ID <= 0)
AD_Window_ID = 139; // hardcoded window Warehouse & Locators
AD_Window_ID = WINDOW_WAREHOUSE_LOCATOR; // hardcoded window Warehouse & Locators
log.info("");
//
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

View File

@ -58,6 +58,7 @@ import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.model.SystemIDs;
import org.compiere.swing.CButton;
import org.compiere.swing.CMenuItem;
import org.compiere.swing.CTextField;
@ -95,7 +96,7 @@ import org.compiere.util.ValueNamePair;
* @sponsor www.metas.de
*/
public class VLookup extends JComponent
implements VEditor, ActionListener, FocusListener
implements VEditor, ActionListener, FocusListener, SystemIDs
{
/**
*
@ -169,7 +170,7 @@ public class VLookup extends JComponent
*/
public static VLookup createBPartner (int WindowNo)
{
int AD_Column_ID = 3499; // C_Invoice.C_BPartner_ID
int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
try
{
Lookup lookup = MLookupFactory.get (Env.getCtx(), WindowNo,
@ -190,7 +191,7 @@ public class VLookup extends JComponent
*/
public static VLookup createProduct (int WindowNo)
{
int AD_Column_ID = 3840; // C_InvoiceLine.M_Product_ID
int AD_Column_ID = COLUMN_C_INVOICELINE_M_PRODUCT_ID; // C_InvoiceLine.M_Product_ID
try
{
Lookup lookup = MLookupFactory.get (Env.getCtx(), WindowNo, 0,
@ -211,7 +212,7 @@ public class VLookup extends JComponent
*/
public static VLookup createUser (int WindowNo)
{
int AD_Column_ID = 10443; // AD_WF_Activity.AD_User_UD
int AD_Column_ID = COLUMN_AD_WF_ACTIVITY_AD_USER_ID; // AD_WF_Activity.AD_User_UD
try
{
Lookup lookup = MLookupFactory.get (Env.getCtx(), WindowNo, 0,

View File

@ -43,6 +43,7 @@ import org.compiere.model.GridTab;
import org.compiere.model.MAttributeSet;
import org.compiere.model.MPAttributeLookup;
import org.compiere.model.MProduct;
import org.compiere.model.SystemIDs;
import org.compiere.swing.CButton;
import org.compiere.swing.CMenuItem;
import org.compiere.util.CLogger;
@ -61,7 +62,7 @@ import org.compiere.util.Msg;
* <li>BF [ 2011222 ] ASI Dialog is reseting locator
*/
public class VPAttribute extends JComponent
implements VEditor, ActionListener
implements VEditor, ActionListener, SystemIDs
{
/**
*
@ -400,7 +401,7 @@ public class VPAttribute extends JComponent
+ ", AD_Column_ID=" + m_AD_Column_ID);
// M_Product.M_AttributeSetInstance_ID = 8418
boolean productWindow = m_AD_Column_ID == 8418; // HARDCODED
boolean productWindow = m_AD_Column_ID == COLUMN_M_PRODUCT_M_ATTRIBUTESETINSTANCE_ID; // HARDCODED
// Exclude ability to enter ASI
boolean exclude = true;

View File

@ -54,6 +54,7 @@ import org.compiere.model.MLotCtl;
import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.model.MSerNoCtl;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_M_MovementLine;
import org.compiere.swing.CButton;
import org.compiere.swing.CCheckBox;
@ -79,7 +80,7 @@ import org.compiere.util.Msg;
* @version $Id: VPAttributeDialog.java,v 1.4 2006/07/30 00:51:27 jjanke Exp $
*/
public class VPAttributeDialog extends CDialog
implements ActionListener
implements ActionListener, SystemIDs
{
/**
*
@ -600,7 +601,7 @@ public class VPAttributeDialog extends CDialog
// teo_sarca [ 1564520 ] Inventory Move: can't select existing attributes
int M_Locator_ID = 0;
if (m_AD_Column_ID == 8551) { // TODO: hardcoded: M_MovementLine[324].M_AttributeSetInstance_ID[8551]
if (m_AD_Column_ID == COLUMN_M_MOVEMENTLINE_M_ATTRIBUTESETINSTANCE_ID) { // TODO: hardcoded: M_MovementLine[324].M_AttributeSetInstance_ID[8551]
M_Locator_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNoParent, X_M_MovementLine.COLUMNNAME_M_Locator_ID, true); // only window
}
@ -683,7 +684,7 @@ public class VPAttributeDialog extends CDialog
//
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
//
int AD_Window_ID = 257; // Lot
int AD_Window_ID = WINDOW_LOT; // Lot
AWindow frame = new AWindow();
if (frame.initWindow(AD_Window_ID, zoomQuery))
{

View File

@ -53,6 +53,7 @@ import org.compiere.model.MPOS;
import org.compiere.model.MPOSKey;
import org.compiere.model.MPayment;
import org.compiere.model.MPaymentValidate;
import org.compiere.model.SystemIDs;
import org.compiere.swing.CButton;
import org.compiere.swing.CComboBox;
import org.compiere.swing.CDialog;
@ -64,7 +65,7 @@ import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.ValueNamePair;
public class PosPayment extends CDialog implements PosKeyListener, VetoableChangeListener, ActionListener {
public class PosPayment extends CDialog implements PosKeyListener, VetoableChangeListener, ActionListener, SystemIDs {
/**
*
*/
@ -247,7 +248,7 @@ public class PosPayment extends CDialog implements PosKeyListener, VetoableChang
mainPanel.add(new CLabel(Msg.translate(p_ctx, "TenderType"), "growx"));
// Payment type selection
int AD_Column_ID = 8416; //C_Payment_v.TenderType
int AD_Column_ID = COLUMN_C_PAYMENT_V_TENDERTYPE; //C_Payment_v.TenderType
MLookup lookup = MLookupFactory.get(Env.getCtx(), 0, 0, AD_Column_ID, DisplayType.List);
ArrayList<Object> types = lookup.getData(true, false, true, true);

View File

@ -80,6 +80,7 @@ import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.model.MUser;
import org.compiere.model.PrintInfo;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_C_Invoice;
import org.compiere.swing.CButton;
import org.compiere.swing.CCheckBox;
@ -124,7 +125,7 @@ import org.compiere.util.ValueNamePair;
*
*/
public class Viewer extends CFrame
implements ActionListener, ChangeListener, WindowStateListener, IReportEngineEventListener
implements ActionListener, ChangeListener, WindowStateListener, IReportEngineEventListener, SystemIDs
{
/**
*
@ -1188,7 +1189,7 @@ public class Viewer extends CFrame
{
AWindow win = new AWindow (getGraphicsConfiguration());
new AWindowListener (win, this); // forwards Window Events
int AD_Window_ID = 240; // hardcoded
int AD_Window_ID = WINDOW_PRINTFORMAT; // hardcoded
int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID();
boolean loadedOK = win.initWindow(AD_Window_ID, MQuery.getEqualQuery("AD_PrintFormat_ID", AD_PrintFormat_ID));
if (loadedOK)

View File

@ -58,6 +58,7 @@ import org.compiere.model.MPInstance;
import org.compiere.model.MPInstancePara;
import org.compiere.model.MPrivateAccess;
import org.compiere.model.MRMA;
import org.compiere.model.SystemIDs;
import org.compiere.plaf.CompiereColor;
import org.compiere.print.ReportCtl;
import org.compiere.print.ReportEngine;
@ -83,7 +84,7 @@ import org.compiere.util.Trx;
*/
public class VInOutInvoiceGen extends CPanel
implements FormPanel, ActionListener, VetoableChangeListener,
ChangeListener, TableModelListener, IProcessMonitor
ChangeListener, TableModelListener, IProcessMonitor, SystemIDs
{
/**
*
@ -534,11 +535,11 @@ public class VInOutInvoiceGen extends CPanel
if (docTypeKNPair.getKey() == MRMA.Table_ID)
{
AD_Process_ID = 52001; // M_InOut_GenerateRMA - org.adempiere.process.InOutGenerateRMA
AD_Process_ID = PROCESS_M_INOUT_GENERATERMA_MANUAL; // M_InOut_GenerateRMA - org.adempiere.process.InOutGenerateRMA
}
else
{
AD_Process_ID = 199; // M_InOut_Generate - org.compiere.process.InOutGenerate
AD_Process_ID = PROCESS_M_INOUT_GENERATE_MANUAL; // M_InOut_Generate - org.compiere.process.InOutGenerate
}
MPInstance instance = new MPInstance(Env.getCtx(), AD_Process_ID, 0);
@ -702,11 +703,11 @@ public class VInOutInvoiceGen extends CPanel
if (docTypeKNPair.getKey() == MRMA.Table_ID)
{
AD_Process_ID = 52002; // C_Invoice_GenerateRMA - org.adempiere.process.InvoiceGenerateRMA
AD_Process_ID = PROCESS_C_INVOICE_GENERATERMA_MANUAL; // C_Invoice_GenerateRMA - org.adempiere.process.InvoiceGenerateRMA
}
else
{
AD_Process_ID = 134; // HARDCODED C_InvoiceCreate
AD_Process_ID = PROCESS_C_INVOICE_GENERATE_MANUAL; // HARDCODED C_InvoiceCreate
}
MPInstance instance = new MPInstance(Env.getCtx(), AD_Process_ID, 0);
if (!instance.save())
@ -864,12 +865,12 @@ public class VInOutInvoiceGen extends CPanel
public void unlockUI (ProcessInfo pi)
{
//
if(pi.getAD_Process_ID() == 199)
if(pi.getAD_Process_ID() == PROCESS_M_INOUT_GENERATE_MANUAL)
{
generateShipments_complete(pi);
generateInvoices ();
}
if(pi.getAD_Process_ID() == 134)
if(pi.getAD_Process_ID() == PROCESS_C_INVOICE_GENERATE_MANUAL)
{
generateInvoice_complete(pi);
this.setEnabled(true);

View File

@ -9,6 +9,7 @@ import org.adempiere.webui.component.Window;
import org.adempiere.webui.panel.ADForm;
import org.adempiere.webui.session.SessionManager;
import org.compiere.model.MBPartner;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -27,7 +28,7 @@ import org.zkoss.zul.Menupopup;
* @author Jorg Janke
* @version $Id: AArchive.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $
*/
public class WArchive implements EventListener
public class WArchive implements EventListener, SystemIDs
{
/**
* Constructor
@ -153,7 +154,7 @@ public class WArchive implements EventListener
{
if (e.getTarget() instanceof Menuitem)
{
int AD_Form_ID = 118; // ArchiveViewer
int AD_Form_ID = FORM_ARCHIVEVIEWER; // ArchiveViewer
ADForm form = ADForm.openForm(AD_Form_ID);
WArchiveViewer av = (WArchiveViewer) form.getICustomForm();

View File

@ -35,6 +35,7 @@ import org.compiere.model.MQuery;
import org.compiere.model.MRMA;
import org.compiere.model.MRequest;
import org.compiere.model.MUser;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -56,7 +57,7 @@ import org.zkoss.zul.Menupopup;
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>BF [ 1904928 ] Request: Related Request field not filled
*/
public class WRequest implements EventListener
public class WRequest implements EventListener, SystemIDs
{
/**
* Constructor
@ -204,7 +205,7 @@ public class WRequest implements EventListener
query.setRecordCount(0);
}
int AD_Window_ID = 232; // 232=all - 201=my
int AD_Window_ID = WINDOW_REQUESTS_ALL; // 232=all - 201=my
ADWindow frame = SessionManager.getAppDesktop().openWindow(AD_Window_ID, query);
if(frame == null)
return;

View File

@ -38,6 +38,7 @@ import org.compiere.model.MAcctSchemaElement;
import org.compiere.model.MFactAcct;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MRefList;
import org.compiere.model.SystemIDs;
import org.compiere.report.core.RColumn;
import org.compiere.report.core.RModel;
import org.compiere.util.CLogger;
@ -57,7 +58,7 @@ import org.compiere.util.ValueNamePair;
* July 27, 2007
*/
public class WAcctViewerData
public class WAcctViewerData implements SystemIDs
{
/** Window */
public int WindowNo;
@ -199,7 +200,7 @@ public class WAcctViewerData
protected void fillPostingType (Listbox cb)
{
int AD_Reference_ID = 125;
int AD_Reference_ID = REFERENCE_POSTING_TYPE;
ValueNamePair[] pt = MRefList.getList(Env.getCtx(), AD_Reference_ID, true);
for (int i = 0; i < pt.length; i++)

View File

@ -14,7 +14,6 @@ import java.util.logging.Level;
import org.adempiere.util.IProcessMonitor;
import org.adempiere.util.ServerContext;
import org.adempiere.webui.AdempiereWebUI;
import org.adempiere.webui.apps.ProcessDialog.ProcessDialogRunnable;
import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.Window;
@ -23,6 +22,7 @@ import org.adempiere.webui.process.WProcessInfo;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.window.FDialog;
import org.adempiere.webui.window.SimplePDFViewer;
import org.compiere.model.SystemIDs;
import org.compiere.print.ReportEngine;
import org.compiere.process.ProcessInfo;
import org.compiere.process.ProcessInfoUtil;
@ -33,7 +33,6 @@ import org.compiere.util.Msg;
import org.zkoss.zk.au.out.AuEcho;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Desktop;
import org.zkoss.zk.ui.Execution;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
@ -80,7 +79,7 @@ import com.lowagie.text.pdf.PdfWriter;
* @author arboleda - globalqss
* - Implement ShowHelp option on processes and reports
*/
public class ProcessDialog extends Window implements EventListener, IProcessMonitor
public class ProcessDialog extends Window implements EventListener, IProcessMonitor, SystemIDs
{
/**
* generate serial version ID
@ -483,9 +482,9 @@ public class ProcessDialog extends Window implements EventListener, IProcessMoni
{
log.config("");
// Print invoices
if (m_AD_Process_ID == 119)
if (m_AD_Process_ID == PROCESS_C_INVOICE_GENERATE)
printInvoices();
else if (m_AD_Process_ID == 118)
else if (m_AD_Process_ID == PROCESS_M_INOUT_GENERATE)
printShipments();
}

View File

@ -47,6 +47,7 @@ import org.adempiere.webui.window.FDialog;
import org.compiere.apps.form.Allocation;
import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.SystemIDs;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Msg;
@ -69,7 +70,7 @@ import org.zkoss.zul.Space;
* Contributor : Fabian Aguilar - OFBConsulting - Multiallocation
*/
public class WAllocation extends Allocation
implements IFormController, EventListener, WTableModelListener, ValueChangeListener
implements IFormController, EventListener, WTableModelListener, ValueChangeListener, SystemIDs
{
/**
@ -294,21 +295,21 @@ public class WAllocation extends Allocation
public void dynInit() throws Exception
{
// Currency
int AD_Column_ID = 3505; // C_Invoice.C_Currency_ID
int AD_Column_ID = COLUMN_C_INVOICE_C_CURRENCY_ID; // C_Invoice.C_Currency_ID
MLookup lookupCur = MLookupFactory.get (Env.getCtx(), form.getWindowNo(), 0, AD_Column_ID, DisplayType.TableDir);
currencyPick = new WTableDirEditor("C_Currency_ID", true, false, true, lookupCur);
currencyPick.setValue(new Integer(m_C_Currency_ID));
currencyPick.addValueChangeListener(this);
// Organization filter selection
AD_Column_ID = 839; //C_Period.AD_Org_ID (needed to allow org 0)
AD_Column_ID = COLUMN_C_PERIOD_AD_ORG_ID; //C_Period.AD_Org_ID (needed to allow org 0)
MLookup lookupOrg = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, AD_Column_ID, DisplayType.TableDir);
organizationPick = new WTableDirEditor("AD_Org_ID", true, false, true, lookupOrg);
organizationPick.setValue(Env.getAD_Org_ID(Env.getCtx()));
organizationPick.addValueChangeListener(this);
// BPartner
AD_Column_ID = 3499; // C_Invoice.C_BPartner_ID
AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
MLookup lookupBP = MLookupFactory.get (Env.getCtx(), form.getWindowNo(), 0, AD_Column_ID, DisplayType.Search);
bpartnerSearch = new WSearchEditor("C_BPartner_ID", true, false, true, lookupBP);
bpartnerSearch.addValueChangeListener(this);

View File

@ -37,6 +37,7 @@ import org.compiere.model.GridTab;
import org.compiere.model.MDocType;
import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
@ -48,7 +49,7 @@ import org.zkoss.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zul.Space;
public class WCreateFromInvoiceUI extends CreateFromInvoice implements EventListener, ValueChangeListener
public class WCreateFromInvoiceUI extends CreateFromInvoice implements EventListener, ValueChangeListener, SystemIDs
{
private static final long serialVersionUID = 1L;
@ -246,7 +247,7 @@ public class WCreateFromInvoiceUI extends CreateFromInvoice implements EventList
protected void initBPartner (boolean forInvoice) throws Exception
{
// load BPartner
int AD_Column_ID = 3499; // C_Invoice.C_BPartner_ID
int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search);
bPartnerField = new WSearchEditor ("C_BPartner_ID", true, false, true, lookup);
//

View File

@ -32,6 +32,7 @@ import org.compiere.grid.CreateFromRMA;
import org.compiere.model.GridTab;
import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
@ -39,7 +40,7 @@ import org.compiere.util.Msg;
import org.zkoss.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
public class WCreateFromRMAUI extends CreateFromRMA implements ValueChangeListener
public class WCreateFromRMAUI extends CreateFromRMA implements ValueChangeListener, SystemIDs
{
private static final long serialVersionUID = 1L;
@ -148,7 +149,7 @@ public class WCreateFromRMAUI extends CreateFromRMA implements ValueChangeListen
protected void initBPartner (boolean forInvoice) throws Exception
{
// load BPartner
int AD_Column_ID = 3499; // C_Invoice.C_BPartner_ID
int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search);
bPartnerField = new WSearchEditor ("C_BPartner_ID", true, false, true, lookup);
//

View File

@ -45,6 +45,7 @@ import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MProduct;
import org.compiere.model.MRMA;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
@ -57,11 +58,8 @@ import org.zkoss.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zul.Space;
public class WCreateFromShipmentUI extends CreateFromShipment implements EventListener, ValueChangeListener
public class WCreateFromShipmentUI extends CreateFromShipment implements EventListener, ValueChangeListener, SystemIDs
{
private static final int WINDOW_CUSTOMER_RETURN = 53097;
private static final int WINDOW_RETURN_TO_VENDOR = 53098;
private WCreateFromWindow window;
@ -149,7 +147,7 @@ public class WCreateFromShipmentUI extends CreateFromShipment implements EventLi
protected void zkInit() throws Exception
{
boolean isRMAWindow = ((getGridTab().getAD_Window_ID() == WINDOW_RETURN_TO_VENDOR) || (getGridTab().getAD_Window_ID() == WINDOW_CUSTOMER_RETURN));
boolean isRMAWindow = ((getGridTab().getAD_Window_ID() == WINDOW_RETURNTOVENDOR) || (getGridTab().getAD_Window_ID() == WINDOW_CUSTOMERRETURN));
bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));
orderLabel.setText(Msg.getElement(Env.getCtx(), "C_Order_ID", false));

View File

@ -44,6 +44,7 @@ import org.compiere.model.MColumn;
import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MPayment;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
@ -55,7 +56,7 @@ import org.zkoss.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zul.Hbox;
public class WCreateFromStatementUI extends CreateFromStatement implements EventListener
public class WCreateFromStatementUI extends CreateFromStatement implements EventListener, SystemIDs
{
private static final long serialVersionUID = 1L;
@ -143,7 +144,7 @@ public class WCreateFromStatementUI extends CreateFromStatement implements Event
window.setTitle(getTitle());
int AD_Column_ID = 4917; // C_BankStatement.C_BankAccount_ID
int AD_Column_ID = COLUMN_C_BANKSTATEMENT_C_BANKACCOUNT_ID; // C_BankStatement.C_BankAccount_ID
MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir);
bankAccountField = new WTableDirEditor ("C_BankAccount_ID", true, false, true, lookup);
// Set Default

View File

@ -49,6 +49,7 @@ import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MPaySelectionCheck;
import org.compiere.model.MPaymentBatch;
import org.compiere.model.SystemIDs;
import org.compiere.print.ReportEngine;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
@ -72,7 +73,7 @@ import org.zkoss.zul.Filedownload;
* Contributors:
* Carlos Ruiz - GlobalQSS - FR 3132033 - Make payment export class configurable per bank
*/
public class WPayPrint extends PayPrint implements IFormController, EventListener, ValueChangeListener
public class WPayPrint extends PayPrint implements IFormController, EventListener, ValueChangeListener, SystemIDs
{
private CustomForm form = new CustomForm();
@ -194,7 +195,7 @@ public class WPayPrint extends PayPrint implements IFormController, EventListene
private void dynInit()
{
// C_PaySelection_ID
int AD_Column_ID = 7670; // C_PaySelectionCheck.C_PaySelection_ID
int AD_Column_ID = COLUMN_C_PAYSELECTIONCHECK_C_PAYSELECTION_ID; // C_PaySelectionCheck.C_PaySelection_ID
MLookup lookupPS = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.Search);
paySelectSearch = new WSearchEditor("C_PaySelection_ID", true, false, true, lookupPS);
paySelectSearch.addValueChangeListener(this);

View File

@ -45,9 +45,9 @@ import org.adempiere.webui.panel.IFormController;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.window.FDialog;
import org.compiere.apps.form.PaySelect;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_C_PaySelection;
import org.compiere.process.ProcessInfo;
import org.compiere.util.ASyncProcess;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg;
@ -73,7 +73,7 @@ import org.zkoss.zul.Space;
* @version $Id: VPaySelect.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $
*/
public class WPaySelect extends PaySelect
implements IFormController, EventListener, WTableModelListener, IProcessMonitor
implements IFormController, EventListener, WTableModelListener, IProcessMonitor, SystemIDs
{
/** @todo withholding */
@ -375,7 +375,7 @@ public class WPaySelect extends PaySelect
return;
// Prepare Process
int AD_Proces_ID = 155; // C_PaySelection_CreatePayment
int AD_Proces_ID = PROCESS_C_PAYSELECTION_CREATEPAYMENT; // C_PaySelection_CreatePayment
// Execute Process
ProcessModalDialog dialog = new ProcessModalDialog(this, m_WindowNo,
@ -426,7 +426,7 @@ public class WPaySelect extends PaySelect
this.dispose();
// Start PayPrint
int AD_Form_ID = 106; // Payment Print/Export
int AD_Form_ID = FORM_PAYMENT_PRINT_EXPORT; // Payment Print/Export
ADForm form = SessionManager.getAppDesktop().openForm(AD_Form_ID);
if (m_ps != null)
{

View File

@ -21,6 +21,7 @@ import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.window.FDialog;
import org.compiere.model.MTree;
import org.compiere.model.MTreeNode;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -44,7 +45,7 @@ import org.zkoss.zul.Vbox;
* @author Elaine
* @date November 20, 2008
*/
public class DPFavourites extends DashboardPanel implements EventListener {
public class DPFavourites extends DashboardPanel implements EventListener, SystemIDs {
/**
*
@ -98,7 +99,7 @@ public class DPFavourites extends DashboardPanel implements EventListener {
+ " INNER JOIN AD_Role r ON (ci.AD_Client_ID=r.AD_Client_ID) "
+ "WHERE AD_Role_ID=?", AD_Role_ID);
if (AD_Tree_ID <= 0)
AD_Tree_ID = 10; // Menu
AD_Tree_ID = TREE_MENUPRIMARY; // Menu
m_AD_Tree_ID = AD_Tree_ID;

View File

@ -39,6 +39,7 @@ import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.model.MTable;
import org.compiere.model.MWarehouse;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -54,7 +55,7 @@ import org.zkoss.zk.ui.event.Events;
* @date Jul 23, 2007
*/
public class WLocatorEditor extends WEditor implements EventListener, PropertyChangeListener, ContextMenuListener, IZoomableEditor
public class WLocatorEditor extends WEditor implements EventListener, PropertyChangeListener, ContextMenuListener, IZoomableEditor, SystemIDs
{
private static final String[] LISTENER_EVENTS = {Events.ON_CLICK};
@ -269,7 +270,7 @@ public class WLocatorEditor extends WEditor implements EventListener, PropertyCh
{
int AD_Window_ID = MTable.get(Env.getCtx(), MLocator.Table_ID).getAD_Window_ID();
if (AD_Window_ID <= 0)
AD_Window_ID = 139; // hardcoded window Warehouse & Locators
AD_Window_ID = WINDOW_WAREHOUSE_LOCATOR; // hardcoded window Warehouse & Locators
log.info("");
//

View File

@ -27,6 +27,7 @@ import org.compiere.model.GridTab;
import org.compiere.model.Lookup;
import org.compiere.model.MAttributeSet;
import org.compiere.model.MProduct;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
import org.zkoss.zk.ui.event.Event;
@ -37,7 +38,7 @@ import org.zkoss.zk.ui.event.Events;
* @author Low Heng Sin
*
*/
public class WPAttributeEditor extends WEditor implements ContextMenuListener
public class WPAttributeEditor extends WEditor implements ContextMenuListener, SystemIDs
{
private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE, Events.ON_OK};
@ -167,7 +168,7 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
+ ", AD_Column_ID=" + gridField.getAD_Column_ID());
// M_Product.M_AttributeSetInstance_ID = 8418
boolean productWindow = (gridField.getAD_Column_ID() == 8418); // HARDCODED
boolean productWindow = (gridField.getAD_Column_ID() == COLUMN_M_PRODUCT_M_ATTRIBUTESETINSTANCE_ID); // HARDCODED
// Exclude ability to enter ASI
boolean exclude = true;

View File

@ -39,6 +39,7 @@ import org.compiere.model.Lookup;
import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MRole;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
@ -54,7 +55,7 @@ import org.zkoss.zk.ui.event.Events;
* @author Ashley G Ramdass
*
*/
public class WSearchEditor extends WEditor implements ContextMenuListener, ValueChangeListener, IZoomableEditor
public class WSearchEditor extends WEditor implements ContextMenuListener, ValueChangeListener, IZoomableEditor, SystemIDs
{
private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE, Events.ON_OK};
private Lookup lookup;
@ -822,7 +823,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
* @return WSearchEditor
*/
public static WSearchEditor createBPartner(int windowNo) {
int AD_Column_ID = 3499; // C_Invoice.C_BPartner_ID
int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
try
{
Lookup lookup = MLookupFactory.get (Env.getCtx(), windowNo,
@ -841,7 +842,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
* @return WSearchEditor
*/
public static WSearchEditor createProduct(int windowNo) {
int AD_Column_ID = 3840; // C_InvoiceLine.M_Product_ID
int AD_Column_ID = COLUMN_C_INVOICELINE_M_PRODUCT_ID; // C_InvoiceLine.M_Product_ID
try
{
Lookup lookup = MLookupFactory.get (Env.getCtx(), windowNo, 0,

View File

@ -69,6 +69,7 @@ import org.compiere.model.MProcess;
import org.compiere.model.MQuery;
import org.compiere.model.MRecentItem;
import org.compiere.model.MRole;
import org.compiere.model.SystemIDs;
import org.compiere.process.DocAction;
import org.compiere.process.ProcessInfo;
import org.compiere.process.ProcessInfoUtil;
@ -118,7 +119,7 @@ import org.zkoss.zul.Menupopup;
* https://sourceforge.net/tracker/?func=detail&aid=2985892&group_id=176962&atid=955896
*/
public abstract class AbstractADWindowPanel extends AbstractUIPart implements ToolbarListener,
EventListener, DataStatusListener, ActionListener, IProcessMonitor
EventListener, DataStatusListener, ActionListener, IProcessMonitor, SystemIDs
{
private static final CLogger logger;
@ -2061,7 +2062,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
// Record_ID - Change Log ID
if (record_ID == -1
&& (wButton.getProcess_ID() == 306 || wButton.getProcess_ID() == 307))
&& (wButton.getProcess_ID() == PROCESS_AD_CHANGELOG_UNDO || wButton.getProcess_ID() == PROCESS_AD_CHANGELOG_REDO))
{
Integer id = (Integer)curTab.getValue("AD_ChangeLog_ID");
record_ID = id.intValue();

View File

@ -40,6 +40,7 @@ import org.compiere.minigrid.ColumnInfo;
import org.compiere.minigrid.IDColumn;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MQuery;
import org.compiere.model.SystemIDs;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
@ -66,7 +67,7 @@ import org.zkoss.zul.Vbox;
* @version InfoAssignment.java Adempiere Swing UI 3.4.1
*/
public class InfoAssignmentPanel extends InfoPanel implements EventListener, ValueChangeListener
public class InfoAssignmentPanel extends InfoPanel implements EventListener, ValueChangeListener, SystemIDs
{
/**
*
@ -157,13 +158,13 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val
{
try
{
int AD_Column_ID = 6851; // S_Resource.S_ResourceType_ID
int AD_Column_ID = COLUMN_S_RESOURCE_S_RESOURCETYPE_ID; // S_Resource.S_ResourceType_ID
fieldResourceType = new WSearchEditor (
MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir),
Msg.translate(Env.getCtx(), "S_ResourceType_ID"), "", false, false, true);
AD_Column_ID = 6826; // S_ResourceAssignment.S_Resource_ID
AD_Column_ID = COLUMN_S_RESOURCEASSIGNMENT_S_RESOURCE_ID; // S_ResourceAssignment.S_Resource_ID
fieldResource = new WSearchEditor (
MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir),

View File

@ -30,6 +30,7 @@ import org.compiere.model.MRole;
import org.compiere.model.MTree;
import org.compiere.model.MTreeNode;
import org.compiere.model.MUser;
import org.compiere.model.SystemIDs;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
@ -53,7 +54,7 @@ import org.zkoss.zul.Treerow;
* @date Feb 25, 2007
* @version $Revision: 0.10 $
*/
public class MenuPanel extends Panel implements EventListener
public class MenuPanel extends Panel implements EventListener, SystemIDs
{
/**
*
@ -144,7 +145,7 @@ public class MenuPanel extends Panel implements EventListener
+ " INNER JOIN AD_Role r ON (ci.AD_Client_ID=r.AD_Client_ID) "
+ "WHERE AD_Role_ID=?", adRoleId);
if (AD_Tree_ID <= 0)
AD_Tree_ID = 10; // Menu
AD_Tree_ID = TREE_MENUPRIMARY; // Menu
return AD_Tree_ID;
}

View File

@ -67,6 +67,7 @@ import org.compiere.model.MProduct;
import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.model.MUserQuery;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_AD_Column;
import org.compiere.util.AdempiereSystemError;
import org.compiere.util.CLogger;
@ -96,7 +97,7 @@ import org.zkoss.zul.Hbox;
* @author Sendy Yagambrum
* @date June 27, 2007
*/
public class FindWindow extends Window implements EventListener,ValueChangeListener
public class FindWindow extends Window implements EventListener,ValueChangeListener, SystemIDs
{
/**
*
@ -157,7 +158,7 @@ public class FindWindow extends Window implements EventListener,ValueChangeListe
/** Length of Fields on first tab */
public static final int FIELDLENGTH = 20;
/** Reference ID for Yes/No */
public static final int AD_REFERENCE_ID_YESNO = 319;
public static final int AD_REFERENCE_ID_YESNO = REFERENCE_YESNO;
private int m_AD_Tab_ID = 0;
private MUserQuery[] userQueries;

View File

@ -48,6 +48,7 @@ import org.compiere.model.MAccountLookup;
import org.compiere.model.MAcctSchema;
import org.compiere.model.MAcctSchemaElement;
import org.compiere.model.MQuery;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -72,7 +73,7 @@ import org.zkoss.zul.Vbox;
* @author Low Heng Sin
*/
public final class WAccountDialog extends Window
implements EventListener, DataStatusListener, ValueChangeListener
implements EventListener, DataStatusListener, ValueChangeListener, SystemIDs
{
private static final long serialVersionUID = 7999516267209766287L;
@ -272,7 +273,7 @@ public final class WAccountDialog extends Window
Env.setContext(Env.getCtx(), m_WindowNo, "C_AcctSchema_ID", m_C_AcctSchema_ID);
// Model
int AD_Window_ID = 153; // Maintain Account Combinations
int AD_Window_ID = WINDOW_ACCOUNTCOMBINATION; // Maintain Account Combinations
GridWindowVO wVO = AEnv.getMWindowVO (m_WindowNo, AD_Window_ID, 0);
if (wVO == null)
return false;

View File

@ -51,6 +51,7 @@ import org.compiere.model.MLotCtl;
import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.model.MSerNoCtl;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_M_MovementLine;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
@ -78,7 +79,7 @@ import org.zkoss.zul.impl.InputElement;
* ZK Port
* @author Low Heng Sin
*/
public class WPAttributeDialog extends Window implements EventListener
public class WPAttributeDialog extends Window implements EventListener, SystemIDs
{
/**
*
@ -793,7 +794,7 @@ public class WPAttributeDialog extends Window implements EventListener
// teo_sarca [ 1564520 ] Inventory Move: can't select existing attributes
int M_Locator_ID = 0;
if (m_AD_Column_ID == 8551) { // TODO: hardcoded: M_MovementLine[324].M_AttributeSetInstance_ID[8551]
if (m_AD_Column_ID == COLUMN_M_MOVEMENTLINE_M_ATTRIBUTESETINSTANCE_ID) { // TODO: hardcoded: M_MovementLine[324].M_AttributeSetInstance_ID[8551]
M_Locator_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNoParent, X_M_MovementLine.COLUMNNAME_M_Locator_ID, true); // only window
}

View File

@ -53,6 +53,7 @@ import org.compiere.model.MRole;
import org.compiere.model.MSysConfig;
import org.compiere.model.MTable;
import org.compiere.model.MUser;
import org.compiere.model.SystemIDs;
import org.compiere.print.ArchiveEngine;
import org.compiere.print.MPrintFormat;
import org.compiere.print.ReportEngine;
@ -100,7 +101,7 @@ import org.zkoss.zul.Vbox;
*
* @author Low Heng Sin
*/
public class ZkReportViewer extends Window implements EventListener, ITabOnCloseHandler {
public class ZkReportViewer extends Window implements EventListener, ITabOnCloseHandler, SystemIDs {
/**
*
*/
@ -997,7 +998,7 @@ public class ZkReportViewer extends Window implements EventListener, ITabOnClose
*/
private void cmd_customize()
{
int AD_Window_ID = 240; // hardcoded
int AD_Window_ID = WINDOW_PRINTFORMAT; // hardcoded
int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID();
AEnv.zoom(AD_Window_ID, MQuery.getEqualQuery("AD_PrintFormat_ID", AD_PrintFormat_ID));
} // cmd_customize

View File

@ -12,13 +12,14 @@ import org.compiere.minigrid.IMiniTable;
import org.compiere.model.MFactReconciliation;
import org.compiere.model.MRole;
import org.compiere.model.Query;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg;
public class FactReconcile {
public class FactReconcile implements SystemIDs {
/** Logger */
public static CLogger log = CLogger.getCLogger(FactReconcile.class);
@ -37,10 +38,10 @@ public class FactReconcile {
public int idColIndex = 8;
public int amtColIndex = 0;
static protected int col_C_AcctSchema_ID = 2513; // Fact_Acct.C_AcctSchema_ID
static protected int col_AD_Org_ID = 839; // C_Period.AD_Org_ID (needed to allow org 0)
static protected int col_C_BPartner_ID = 3499; // C_Invoice.C_BPartner_ID
static protected int col_M_Product_ID = 2527; // Fact_Acct.M_Product_ID
static protected int col_C_AcctSchema_ID = COLUMN_FACT_ACCT_C_ACCTSCHEMA_ID; // Fact_Acct.C_AcctSchema_ID
static protected int col_AD_Org_ID = COLUMN_C_PERIOD_AD_ORG_ID; // C_Period.AD_Org_ID (needed to allow org 0)
static protected int col_C_BPartner_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
static protected int col_M_Product_ID = COLUMN_FACT_ACCT_M_PRODUCT_ID; // Fact_Acct.M_Product_ID
public void dynInit() throws Exception

View File

@ -29,6 +29,7 @@ import org.compiere.model.MPInstance;
import org.compiere.model.MPInstancePara;
import org.compiere.model.MPrivateAccess;
import org.compiere.model.MRMA;
import org.compiere.model.SystemIDs;
import org.compiere.print.ReportEngine;
import org.compiere.process.ProcessInfo;
import org.compiere.util.CLogger;
@ -42,7 +43,7 @@ import org.compiere.util.Trx;
* Generate Shipment (manual) controller class
*
*/
public class InOutGen extends GenForm
public class InOutGen extends GenForm implements SystemIDs
{
/** Logger */
private static CLogger log = CLogger.getCLogger(InOutGen.class);
@ -264,11 +265,11 @@ public class InOutGen extends GenForm
if (docTypeKNPair.getKey() == MRMA.Table_ID)
{
AD_Process_ID = 52001; // M_InOut_GenerateRMA - org.adempiere.process.InOutGenerateRMA
AD_Process_ID = PROCESS_M_INOUT_GENERATERMA_MANUAL; // M_InOut_GenerateRMA - org.adempiere.process.InOutGenerateRMA
}
else
{
AD_Process_ID = 199; // M_InOut_Generate - org.compiere.process.InOutGenerate
AD_Process_ID = PROCESS_M_INOUT_GENERATE_MANUAL; // M_InOut_Generate - org.compiere.process.InOutGenerate
}
MPInstance instance = new MPInstance(Env.getCtx(), AD_Process_ID, 0);

View File

@ -29,6 +29,7 @@ import org.compiere.model.MPInstance;
import org.compiere.model.MPInstancePara;
import org.compiere.model.MPrivateAccess;
import org.compiere.model.MRMA;
import org.compiere.model.SystemIDs;
import org.compiere.print.ReportEngine;
import org.compiere.process.ProcessInfo;
import org.compiere.util.CLogger;
@ -42,7 +43,7 @@ import org.compiere.util.Trx;
* Generate Invoice (manual) controller class
*
*/
public class InvoiceGen extends GenForm
public class InvoiceGen extends GenForm implements SystemIDs
{
/** Logger */
private static CLogger log = CLogger.getCLogger(InvoiceGen.class);
@ -263,11 +264,11 @@ public class InvoiceGen extends GenForm
if (docTypeKNPair.getKey() == MRMA.Table_ID)
{
AD_Process_ID = 52002; // C_Invoice_GenerateRMA - org.adempiere.process.InvoiceGenerateRMA
AD_Process_ID = PROCESS_C_INVOICE_GENERATERMA_MANUAL; // C_Invoice_GenerateRMA - org.adempiere.process.InvoiceGenerateRMA
}
else
{
AD_Process_ID = 134; // HARDCODED C_InvoiceCreate
AD_Process_ID = PROCESS_C_INVOICE_GENERATE_MANUAL; // HARDCODED C_InvoiceCreate
}
MPInstance instance = new MPInstance(Env.getCtx(), AD_Process_ID, 0);
if (!instance.save())

View File

@ -28,6 +28,7 @@ import org.compiere.model.MLookupFactory;
import org.compiere.model.MLookupInfo;
import org.compiere.model.MPaySelectionCheck;
import org.compiere.model.MPaymentBatch;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -35,7 +36,7 @@ import org.compiere.util.KeyNamePair;
import org.compiere.util.Language;
import org.compiere.util.ValueNamePair;
public class PayPrint {
public class PayPrint implements SystemIDs {
/** Window No */
public int m_WindowNo = 0;
@ -143,7 +144,7 @@ public class PayPrint {
ArrayList<ValueNamePair> data = new ArrayList<ValueNamePair>();
// load PaymentRule for Bank
int AD_Reference_ID = 195; // MLookupInfo.getAD_Reference_ID("All_Payment Rule");
int AD_Reference_ID = REFERENCE_PAYMENTRULE; // MLookupInfo.getAD_Reference_ID("All_Payment Rule");
Language language = Language.getLanguage(Env.getAD_Language(Env.getCtx()));
MLookupInfo info = MLookupFactory.getLookup_List(language, AD_Reference_ID);
String sql = info.Query.substring(0, info.Query.indexOf(" ORDER BY"))

View File

@ -31,6 +31,7 @@ import org.compiere.model.MLookupInfo;
import org.compiere.model.MPaySelection;
import org.compiere.model.MPaySelectionLine;
import org.compiere.model.MRole;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_C_Order;
import org.compiere.process.ProcessInfo;
import org.compiere.util.CLogger;
@ -44,7 +45,7 @@ import org.compiere.util.Trx;
import org.compiere.util.ValueNamePair;
public class PaySelect
public class PaySelect implements SystemIDs
{
/** @todo withholding */
@ -247,7 +248,7 @@ public class PaySelect
ArrayList<ValueNamePair> data = new ArrayList<ValueNamePair>();
int AD_Reference_ID = 195; // MLookupInfo.getAD_Reference_ID("All_Payment Rule");
int AD_Reference_ID = REFERENCE_PAYMENTRULE; // MLookupInfo.getAD_Reference_ID("All_Payment Rule");
Language language = Env.getLanguage(Env.getCtx());
MLookupInfo info = MLookupFactory.getLookup_List(language, AD_Reference_ID);
String sql = info.Query.substring(0, info.Query.indexOf(" ORDER BY"))

View File

@ -24,12 +24,13 @@ import org.compiere.model.GridTab;
import org.compiere.model.GridWindow;
import org.compiere.model.GridWindowVO;
import org.compiere.model.MQuery;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
public class TrxMaterial {
public class TrxMaterial implements SystemIDs {
/** Window No */
public int m_WindowNo = 0;
@ -47,10 +48,10 @@ public class TrxMaterial {
* Based on AD_Window: Material Transactions
*/
public void dynInit(IStatusBar statusBar)
{
{
m_staticQuery = new MQuery();
m_staticQuery.addRestriction("AD_Client_ID", MQuery.EQUAL, Env.getAD_Client_ID(Env.getCtx()));
int AD_Window_ID = 223; // Hardcoded
int AD_Window_ID = WINDOW_MATERIALTRANSACTIONS_INDIRECTUSER; // Hardcoded
GridWindowVO wVO = Env.getMWindowVO (m_WindowNo, AD_Window_ID, 0);
if (wVO == null)
return;
@ -126,9 +127,9 @@ public class TrxMaterial {
{
log.fine("M_InOutLine_ID=" + lineID);
if (Env.getContext(Env.getCtx(), m_WindowNo, "MovementType").startsWith("C"))
AD_Window_ID = 169; // Customer
AD_Window_ID = WINDOW_SHIPMENT_CUSTOMER; // Customer
else
AD_Window_ID = 184; // Vendor
AD_Window_ID = WINDOW_MATERIALRECEIPT; // Vendor
ColumnName = "M_InOut_ID";
SQL = "SELECT M_InOut_ID FROM M_InOutLine WHERE M_InOutLine_ID=?";
}
@ -138,7 +139,7 @@ public class TrxMaterial {
if (lineID != 0)
{
log.fine("M_InventoryLine_ID=" + lineID);
AD_Window_ID = 168;
AD_Window_ID = WINDOW_PHYSICALINVENTORY;
ColumnName = "M_Inventory_ID";
SQL = "SELECT M_Inventory_ID FROM M_InventoryLine WHERE M_InventoryLine_ID=?";
}
@ -148,7 +149,7 @@ public class TrxMaterial {
if (lineID != 0)
{
log.fine("M_MovementLine_ID=" + lineID);
AD_Window_ID = 170;
AD_Window_ID = WINDOW_INVENTORYMOVE;
ColumnName = "M_Movement_ID";
SQL = "SELECT M_Movement_ID FROM M_MovementLine WHERE M_MovementLine_ID=?";
}
@ -158,7 +159,7 @@ public class TrxMaterial {
if (lineID != 0)
{
log.fine("M_ProductionLine_ID=" + lineID);
AD_Window_ID = 191;
AD_Window_ID = WINDOW_PRODUCTION;
ColumnName = "M_Production_ID";
SQL = "SELECT M_Production_ID FROM M_ProductionLine WHERE M_ProductionLine_ID=?";
}
@ -191,4 +192,6 @@ public class TrxMaterial {
if (parentID == 0)
log.log(Level.SEVERE, "No ParentValue - " + SQL + " - " + lineID);
} // zoom
}

View File

@ -27,6 +27,7 @@ import org.compiere.model.MProcess;
import org.compiere.model.MQuery;
import org.compiere.model.MTable;
import org.compiere.model.PrintInfo;
import org.compiere.model.SystemIDs;
import org.compiere.process.ProcessInfo;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
@ -40,7 +41,7 @@ import org.compiere.util.Env;
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>FR [ 1866739 ] ReportCtl: use printformat from the transient/serializable
*/
public class ReportCtl
public class ReportCtl implements SystemIDs
{
/**
* @deprecated Please use {@link ServerReportCtl#PARAM_PRINTER_NAME}
@ -115,21 +116,21 @@ public class ReportCtl
/**
* Order Print
*/
if (pi.getAD_Process_ID() == 110) // C_Order
if (pi.getAD_Process_ID() == PROCESS_RPT_C_ORDER) // C_Order
return startDocumentPrint(ReportEngine.ORDER, pi.getRecord_ID(), parent, WindowNo, !pi.isPrintPreview());
if (pi.getAD_Process_ID() == MProcess.getProcess_ID("Rpt PP_Order", null)) // C_Order
return startDocumentPrint(ReportEngine.MANUFACTURING_ORDER, pi.getRecord_ID(), parent, WindowNo, !pi.isPrintPreview());
if (pi.getAD_Process_ID() == MProcess.getProcess_ID("Rpt DD_Order", null)) // C_Order
return startDocumentPrint(ReportEngine.DISTRIBUTION_ORDER, pi.getRecord_ID(), parent, WindowNo, !pi.isPrintPreview());
else if (pi.getAD_Process_ID() == 116) // C_Invoice
else if (pi.getAD_Process_ID() == PROCESS_RPT_C_INVOICE) // C_Invoice
return startDocumentPrint(ReportEngine.INVOICE, pi.getRecord_ID(), parent, WindowNo, !pi.isPrintPreview());
else if (pi.getAD_Process_ID() == 117) // M_InOut
else if (pi.getAD_Process_ID() == PROCESS_RPT_M_INOUT) // M_InOut
return startDocumentPrint(ReportEngine.SHIPMENT, pi.getRecord_ID(), parent, WindowNo, !pi.isPrintPreview());
else if (pi.getAD_Process_ID() == 217) // C_Project
else if (pi.getAD_Process_ID() == PROCESS_RPT_C_PROJECT) // C_Project
return startDocumentPrint(ReportEngine.PROJECT, pi.getRecord_ID(), parent, WindowNo, !pi.isPrintPreview());
else if (pi.getAD_Process_ID() == 276) // C_RfQResponse
else if (pi.getAD_Process_ID() == PROCESS_RPT_C_RFQRESPONSE) // C_RfQResponse
return startDocumentPrint(ReportEngine.RFQ, pi.getRecord_ID(), parent, WindowNo, !pi.isPrintPreview());
else if (pi.getAD_Process_ID() == 313) // C_Payment
else if (pi.getAD_Process_ID() == PROCESS_RPT_C_PAYMENT) // C_Payment
return startCheckPrint(pi.getRecord_ID(), !pi.isPrintPreview());
/**
else if (pi.getAD_Process_ID() == 290) // Movement Submission by VHARCQ
@ -139,10 +140,10 @@ public class ReportCtl
else if (pi.AD_Process_ID == 9999999) // PaySelection
return startDocumentPrint(REMITTANCE, pi, IsDirectPrint);
**/
else if (pi.getAD_Process_ID() == 159) // Dunning
else if (pi.getAD_Process_ID() == PROCESS_RPT_C_DUNNING) // Dunning
return startDocumentPrint(ReportEngine.DUNNING, pi.getRecord_ID(), parent, WindowNo, !pi.isPrintPreview());
else if (pi.getAD_Process_ID() == 202 // Financial Report
|| pi.getAD_Process_ID() == 204) // Financial Statement
else if (pi.getAD_Process_ID() == PROCESS_RPT_FINREPORT // Financial Report
|| pi.getAD_Process_ID() == PROCESS_RPT_FINSTATEMENT) // Financial Statement
return startFinReport (pi);
/********************
* Standard Report